有三种网络连接模式,分别是桥接模式,仅主机模式,NAT模式
1.桥接模式
点击“编辑虚拟机设置”来设置网卡模式,点击“网络适配器”,并点击确定
确定自己的网关,DNS,ip地址等信息

[root@localhost ~]# ping www.baidu.com -c3
PING www.a.shifen.com (14.215.177.38) 56(84) bytes of data.
64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=1 ttl=54 time=54.9 ms
64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=2 ttl=54 time=75.10 ms
64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=3 ttl=54 time=97.3 ms
--- www.a.shifen.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 6ms
rtt min/avg/max/mdev = 54.891/76.058/97.330/17.327 ms
2.NAT

[root@localhost ~]# ping www.baidu.com -c3
PING www.a.shifen.com (14.215.177.39) 56(84) bytes of data.
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=1 ttl=128 time=186 ms
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=2 ttl=128 time=99.7 ms
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=3 ttl=128 time=117 ms
--- www.a.shifen.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 13ms
rtt min/avg/max/mdev = 99.659/134.124/185.536/37.050 ms
3.主机模式

主机模式不可上网
[root@localhost ~]# ping www.baidu.com
ping: www.baidu.com: Name or service not known

1717

被折叠的 条评论
为什么被折叠?



