檢查是否有載入無線網路模組
# lsmod | grep bcmdhd
bcmdhd 497637 0
如果沒有的話
# echo bcmdhd >> /etc/modules-load.d/cubie.conf
建立無線網路設定檔
# cp /etc/netctl/examples/wireless-wpa /etc/netctl/wlan0[@more@]
修改設定檔
# egrep -v ‘^#|^$’ /etc/netctl/wlan0
Description=’A simple WPA encrypted wireless connection’
Interface=wlan0
Connection=wireless
Security=wpa
IP=dhcp
ESSID=’CHTN_T07AW’
Key=’123456789′
連上無線網路
# cd /etc/netctl
# netctl start wlan0
查看無線網路
# ifconfig wlan0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.1.3 netmask 255.255.255.0 broadcast 10.0.1.255
inet6 fe80::9a3b:16ff:fe1e:67d8 prefixlen 64 scopeid 0x20<link>
ether 98:3b:11:1e:67:d8 txqueuelen 1000 (Ethernet)
RX packets 10 bytes 1276 (1.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 30 bytes 3512 (3.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
先切換有線網路 eth0
# ifconfig eth0 down
測試是否能連上網路
# ping -c 4 140.111.66.1
PING 140.111.66.1 (140.111.66.1) 56(84) bytes of data.
64 bytes from 140.111.66.1: icmp_seq=1 ttl=54 time=37.3 ms
64 bytes from 140.111.66.1: icmp_seq=2 ttl=54 time=349 ms
64 bytes from 140.111.66.1: icmp_seq=3 ttl=54 time=11.5 ms
64 bytes from 140.111.66.1: icmp_seq=4 ttl=54 time=11.9 ms
— 140.111.66.1 ping statistics —
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 11.581/102.619/349.571/142.959 ms
中斷無線網路
# netctl stop waln0