Armbian hostname and WiFi configuration
来源:互联网 发布:叶子流量卡淘宝店地址 编辑:程序博客网 时间:2024/05/22 09:12
In previous post i have described installation of Armbian on Orange Pi PC Plus. Now is the time for some initial configuration (hostname and WIFI setup).
Table of Contents
- Changing hostname
- Configuring WIFI to work with WPA2
Changing hostname
- Check current hostname with
hostname
- Check current fully qualified domain name (or FQDN) with
hostname --fqd
- Set new hostname:
sudo hostname pi
- Update
/etc/hostname
for Debian to get new hostname after reboot Update
/etc/hosts
so that FQDN is before short localhost next to IP:127.0.0.1 pi.example.com pi localhost::1 pi.example.com pi localhost ip6-localhost ip6-loopbackfe00::0 ip6-localnetff00::0 ip6-mcastprefixff02::1 ip6-allnodesff02::2 ip6-allrouters
Reboot with
sudo reboot
Configuring WIFI to work with WPA2
There are various ways for configuring WIFI with wpa_suplicant. You may consider settings things up in /etc/network/interfaces
if you want WIFI to be started automatically upon system startup. I have decided on another approach: using script for starting all manually.
- wpa_supplicant should be installed but needs to be run as root:
sudo wpa_supplicant -v
.` - In the next steps you will need BSSID (access point MAC address) and channel. Turn on your WIFI card with
sudo ifconfig wlan0 up
and scan for your network withsudo iwlist wlan0 scan | egrep 'Address|ESSID|Channel'
. - Prepare configuration file for wpa_supplicant in
/etc/wpa_supplicant
folder. You could have more files there with different names. Our file will be namedwifi.conf
. Adjust the content of the file: replace
00:14:6C:AE:EA:AE
,my-wifi
andP@ssw0rd
with your access point MAC address, your WIFI network name and your WIFI password respectively:ctrl_interface=DIR=/var/run/wpa_supplicantnetwork={ bssid=00:14:6C:AE:EA:AE ssid="my-wifi" scan_ssid=1 key_mgmt=WPA-PSK psk="P@ssw0rd"}
Create a script and add execute permissions. Replace
my-wifi
,8
andwifi.conf
with your WIFI name, channel and WPA supplicant configuration file name:#!/usr/bin/env bashDEV=$(iw dev | awk '/Interface/ {interf=$2} END {print interf}')DHCL_PIDFILE=/var/run/dhclient-$DEV.pidWPA_PIDFILE=/var/run/wpa_supplicant-$DEV.pidif [[ -f $DHCL_PIDFILE ]] && kill -9 $(cat $DHCL_PIDFILE)then dhclient -v -r $DEV echo "IP address released"fiif [[ -f $WPA_PIDFILE ]] && kill -9 $(cat $WPA_PIDFILE) then echo "WPA supplicant killed"fikillall wpa_supplicantecho "wpa_supplicant killed :)"ifconfig -v $DEV downsleep 1ifconfig -v $DEV upecho "$DEV interface is up again"iwconfig $DEV essid 'my-wifi' channel 8echo "starting wpa_supplicant.."sleep 2wpa_supplicant -B -dd -i$DEV -P$WPA_PIDFILE -c/etc/wpa_supplicant/wifi.confsleep 2echo "getting IP address.."dhclient -v -pf $DHCL_PIDFILE $DEV
Run the script as root
- Armbian hostname and WiFi configuration
- configuration of the WIFI
- exim and hostname fqdn problem
- BeagleBone Green Wireless WIFI configuration
- phpmyadmin (Invalid hostname for server 1. Please review your configuration)
- mod_dav Installation and Configuration
- MTS Configuration and Operation
- Grub installation and configuration
- Busybox and benchmark configuration
- mainlman install and configuration
- Molecular Configuration and Conformation.
- SD Configuration and Setup
- DSS Compile and Configuration
- git usage and configuration
- JSP installation and configuration
- hadoop -- setup and configuration
- freeradius and jradius configuration
- spark configuration and monitor
- Dom4j解析XML来读取数据库配置文件信息
- 第一个Applet小程序
- Android Studio创建Xposed模块项目时BridgeApi的正确添加方式
- String字符串
- Win7如何取消开机启动项?win7取消开机启动项的方法
- Armbian hostname and WiFi configuration
- HTML DOM 和 XML DOM
- App有奖邀请技术方案比较
- Python中用GDAL实现矢量对栅格的切割
- MFC 实现对显示的界面(最小宽度和最小高度的限制)
- Mysql EXPLAIN 命令详解
- 手机端自适应
- lighttpd/1.4.45 301从定向
- TensorFlow 学习