修改配置文件

1
2
3
4
5
6
7
8
9
root@NanoPi-Duo2:~# vim /etc/network/interfaces

auto eth0
iface eth0 inet dhcp

auto wlan0
iface wlan0 inet dhcp
wpa-ssid xxxxxxxx
wpa-psk XXXXXXXX

NetworkManager 多管闲事

1
2
3
root@NanoPi-Duo2:~# systemctl  stop     NetworkManager.service
root@NanoPi-Duo2:~# systemctl disable NetworkManager.service
root@NanoPi-Duo2:~# systemctl restart networking.service

查看连接状态

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
root@NanoPi-Duo2:~# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 02:81:ff:f8:25:c6
inet addr:192.168.88.108 Bcast:192.168.88.255 Mask:255.255.255.0
inet6 addr: fe80::a22d:30c:76ab:6b04/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5582 errors:0 dropped:0 overruns:0 frame:0
TX packets:4363 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:580703 (580.7 KB) TX bytes:567387 (567.3 KB)
Interrupt:41

root@NanoPi-Duo2:~#
root@NanoPi-Duo2:~#

root@NanoPi-Duo2:~# ifconfig wlan0
wlan0 Link encap:Ethernet HWaddr c0:84:7d:a0:2f:dc
inet addr:192.168.88.110 Bcast:192.168.88.255 Mask:255.255.255.0
inet6 addr: fe80::c284:7dff:fea0:2fdc/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:370 errors:0 dropped:0 overruns:0 frame:0
TX packets:456 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:42480 (42.4 KB) TX bytes:62057 (62.0 KB)

root@NanoPi-Duo2:~#
root@NanoPi-Duo2:~#

root@NanoPi-Duo2:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.88.3 0.0.0.0 UG 0 0 0 wlan0
0.0.0.0 192.168.88.3 0.0.0.0 UG 100 0 0 eth0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.88.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
192.168.88.0 0.0.0.0 255.255.255.0 U 100 0 0 eth0
192.168.173.0 0.0.0.0 255.255.255.0 U 0 0 0 VPN
root@NanoPi-Duo2:~#