sugarcane:/ # wpa_cli remove_network 0
Using interface 'wlan0'
OK
sugarcane:/ # wpa_cli add_network
Using interface 'wlan0'
0
sugarcane:/ # wpa_cli set_network 0 ssid '"HUAWEI-AIRPLAY"'
Using interface 'wlan0'
OK
sugarcane:/ # wpa_cli set_network 0 key_mgmt WPA-PSK
Using interface 'wlan0'
OK
sugarcane:/ # wpa_cli set_network 0 psk '"111222333"'
Using interface 'wlan0'
OK
sugarcane:/ # wpa_cli select_network 0
Using interface 'wlan0'
OK
sugarcane:/ # wpa_cli status
Using interface 'wlan0'
bssid=20:a6:80:9d:8c:cc
freq=2457
ssid=HUAWEI-AIRPLAY
id=0
mode=station
pairwise_cipher=CCMP
group_cipher=CCMP
key_mgmt=WPA2-PSK
wpa_state=COMPLETED
p2p_device_address=ac:35:ee:a6:cd:92
address=ac:35:ee:a6:cd:92
uuid=12345678-9abc-def0-1234-56789abcdef0
sugarcane:/ # ifconfig
eth0 Link encap:Ethernet HWaddr 00:30:1b:ba:02:db
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 TX bytes:0
Interrupt:41 Base address:0x4000
wlan0 Link encap:Ethernet HWaddr ac:35:ee:a6:cd:92 Driver rtl8723bu
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:66 errors:0 dropped:0 overruns:0 frame:0
TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:20225 TX bytes:288
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope: Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:51742 errors:0 dropped:0 overruns:0 frame:0
TX packets:51742 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:4052467 TX bytes:4052467
p2p0 Link encap:Ethernet HWaddr ae:35:ee:a6:cd:92 Driver rtl8723bu
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:543 errors:0 dropped:0 overruns:0 frame:0
TX packets:197 errors:0 dropped:23 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:158779 TX bytes:48785
sugarcane:/ # ifconfig wlan0 192.168.100.188
sugarcane:/ # ifconfig
eth0 Link encap:Ethernet HWaddr 00:30:1b:ba:02:db
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 TX bytes:0
Interrupt:41 Base address:0x4000
wlan0 Link encap:Ethernet HWaddr ac:35:ee:a6:cd:92 Driver rtl8723bu
inet addr:192.168.100.188 Bcast:192.168.100.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:107 errors:0 dropped:2 overruns:0 frame:0
TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:35748 TX bytes:1597
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope: Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:52378 errors:0 dropped:0 overruns:0 frame:0
TX packets:52378 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:4102099 TX bytes:4102099
p2p0 Link encap:Ethernet HWaddr ae:35:ee:a6:cd:92 Driver rtl8723bu
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:543 errors:0 dropped:0 overruns:0 frame:0
TX packets:197 errors:0 dropped:23 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:158779 TX bytes:48785
sugarcane:/ # busybox route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.100.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
sugarcane:/ # busybox route add default gw 192.168.100.1
sugarcane:/ # busybox route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.100.1 0.0.0.0 UG 0 0 0 wlan0
192.168.100.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
sugarcane:/ # ping 192.168.100.1
PING 192.168.100.1 (192.168.100.1) 56(84) bytes of data.
64 bytes from 192.168.100.1: icmp_seq=1 ttl=64 time=13.3 ms
64 bytes from 192.168.100.1: icmp_seq=2 ttl=64 time=4.77 ms
^C
--- 192.168.100.1 ping statistics ---
3 packets transmitted, 2 received, 33% packet loss, time 2002ms
rtt min/avg/max/mdev = 4.770/9.084/13.399/4.315 ms
sugarcane:/ # ping www.baidu.com
ping: unknown host www.baidu.com
2|sugarcane:/ # ping 172.17.7.1
PING 172.17.7.1 (172.17.7.1) 56(84) bytes of data.
64 bytes from 172.17.7.1: icmp_seq=1 ttl=254 time=64.0 ms
64 bytes from 172.17.7.1: icmp_seq=2 ttl=254 time=86.4 ms
64 bytes from 172.17.7.1: icmp_seq=3 ttl=254 time=65.1 ms
64 bytes from 172.17.7.1: icmp_seq=4 ttl=254 time=600 ms
64 bytes from 172.17.7.1: icmp_seq=5 ttl=254 time=11.3 ms
^C
--- 172.17.7.1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4005ms
rtt min/avg/max/mdev = 11.315/165.422/600.096/218.746 ms