step1: 查看所有的网卡
ifconfig -a
可以看到ens33 这个不work了
stdpain@ubuntu:~$ ifconfig -a
ens33: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether 00:0c:29:45:7a:69 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 720 bytes 52068 (52.0 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 720 bytes 52068 (52.0 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
重置网卡:
sudo service network-manager stop
sudo rm /var/lib/NetworkManager/NetworkManager.state
sudo service network-manager start
执行 ifconfig -a
stdpain@ubuntu:~$ ifconfig -a
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.240.129 netmask 255.255.255.0 broadcast 192.168.240.255
inet6 fe80::927f:a7ea:7e75:5d00 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:45:7a:69 txqueuelen 1000 (Ethernet)
RX packets 19 bytes 2761 (2.7 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 44 bytes 5357 (5.3 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 746 bytes 54188 (54.1 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 746 bytes 54188 (54.1 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0