VMWare上的Ubuntu17--网络运行得很好,突然间就不行了。尝试桥接和NAT都没有用,所以我看linux方面。
$ ifconfig -a
ens33: flags=4098 mtu 1500
ether 00:**:**:**:**:** 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 mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback)
RX packets 1876 bytes 114200 (114.2 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1876 bytes 114200 (114.2 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0在我看来,这个界面被禁用了:
$ ip link show
1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens33: mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether 00:0c:29:f8:f7:47 brd ff:ff:ff:ff:ff:ff但是ifup似乎不知道ens33 (或eth0):
$ ifup ens33
Unknown interface ens33
$ ifup eth0
Unknown interface eth0发布于 2018-03-24 17:55:35
好的,界面似乎没有“存在”。
向/etc/network/interfaces添加以下行:
iface ens33 inet dhcp打开它(启用它):
sudo ifup ens33很好去:
ping google.com耶!
https://unix.stackexchange.com/questions/433290
复制相似问题