Setup nework設定網路
01 搜尋無線網路
pi@raspberry:~$sudo iwlist scan | grep ESSID
02 pi@raspberry:~$sudo nano /etc/network/interfaces
Add below...
【Example】
---------------------------------------------------------------------------------------------------------------------
#/etc/network/interface
#修改/etc/network/interface文件,修改成功後保存,最後執行/etc/init.d/networking restart即可
iface lo inet loopback
iface eth0 inet dhcp
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-ssid "myssid"
wpa-psk "mypsk"
Explanation說明:
auto wlan0 :說明系統啟動時自動啟動wlan0;
allow-hotplug wlan0:允許熱插拔wlan0;
iface wlan0 inet dhcp:對wlan0網口使用dhcp方式獲取IP地址;
wpa-ssid "myssid":設置准備連接的wifi熱點的ESSID;
wpa-psk "mypsk":設置wifi熱點的密碼。這裏需要注意的是mypsk不是wifi熱點的密碼,而是通過使用wpa_passphrase命令得到的結果的psk值;
---------------------------------------------------------------------------------------------------------------------
【網路配置方法】
---------------------------------------------------------------------------------------------------------------------
#sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="AirPort_Router"
psk="abcdefghij123"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
auth_alg=OPEN
}
network={
ssid="ssidname"
psk="ssidpassowrd"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
auth_alg=OPEN
}
---------------------------------------------------------------------------------------------------------------------
No comments:
Post a Comment