序
VMware下装的Ubuntu,修改了Ubuntu 的ip后无法联网无法ping通各类网段,然后按照网上的一堆办法越整越乱,,,最后重设虚拟网卡解决。
一、报错信息
1、ping开发板
ping 192.168.1.136
PING 192.168.1.136 (192.168.1.136) 56(84) bytes of data.
From 192.168.237.155 icmp_seq=1 Destination Host Unreachable
From 192.168.237.155 icmp_seq=2 Destination Host Unreachable
From 192.168.237.155 icmp_seq=3 Destination Host Unreachable
^C
--- 192.168.1.136 ping statistics ---
5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 4045ms
pipe 3
2、ping宿主机
ping 192.168.1.55
PING 192.168.1.55 (192.168.1.55) 56(84) bytes of data.
From 192.168.237.155 icmp_seq=1 Destination Host Unreachable
From 192.168.237.155 icmp_seq=2 Destination Host Unreachable
^C
--- 192.168.1.55 ping statistics ---
5 packets transmitted, 0 received, +2 errors, 100% packet loss, time 4046ms
pipe 2
3、ping baidu
ping baidu.com
ping: unknown host baidu.com
二、添加、移除网卡
1、查看当前网卡信息 # ifconfig
2、添加一个网卡,vmware菜单栏,虚拟机—>设置。
添加一个网卡
3、查看当前网卡信息,多了一个网卡
4、移除旧的网卡,重启下 # reboot
5、查看当前网卡信息
6、测试ping baidu,成功
ping baidu.com
PING baidu.com (39.156.69.79) 56(84) bytes of data.
64 bytes from 39.156.69.79: icmp_seq=1 ttl=128 time=27.0 ms
64 bytes from 39.156.69.79: icmp_seq=2 ttl=128 time=25.4 ms
64 bytes from 39.156.69.79: icmp_seq=3 ttl=128 time=25.3 ms
--- baidu.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 25.349/25.944/27.004/0.751 ms