600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > 物理机ping通Centos虚拟机 但虚拟机ping不通物理机的解决方法

物理机ping通Centos虚拟机 但虚拟机ping不通物理机的解决方法

时间:2021-04-15 18:14:56

相关推荐

物理机ping通Centos虚拟机 但虚拟机ping不通物理机的解决方法

文章目录

1.首先判断IP地址是否在同一网段2.物理机ping通虚拟机3.虚拟机ping物理机,无法ping通4.关掉物理机防火墙操作如下:5.虚拟机ping物理机

1.首先判断IP地址是否在同一网段

centos7 虚拟机,网络模式为桥接,ip:192.168.1.25

物理机,win 10 , ip: 192.168.1.4

2.物理机ping通虚拟机

代码如下(示例):

C:\Users\75377>ping 192.168.1.25正在 Ping 192.168.1.25 具有 32 字节的数据:来自 192.168.1.25 的回复: 字节=32 时间<1ms TTL=64来自 192.168.1.25 的回复: 字节=32 时间<1ms TTL=64来自 192.168.1.25 的回复: 字节=32 时间<1ms TTL=64来自 192.168.1.25 的回复: 字节=32 时间<1ms TTL=64192.168.1.25 的 Ping 统计信息:数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),往返行程的估计时间(以毫秒为单位):最短 = 0ms,最长 = 0ms,平均 = 0ms

3.虚拟机ping物理机,无法ping通

[root@centos7pc1 ~]# ping 192.168.1.4PING 192.168.1.4 (192.168.1.4) 56(84) bytes of data.

原因:虚拟机ping不通物理机是因为物理机的防火墙不允许,关掉物理机公网的防火墙即可。

4.关掉物理机防火墙操作如下:

打开控制面板,点击系统安全

5.虚拟机ping物理机

[root@centos7pc1 ~]# ping 192.168.1.4PING 192.168.1.4 (192.168.1.4) 56(84) bytes of data.64 bytes from 192.168.1.4: icmp_seq=1 ttl=128 time=0.211 ms64 bytes from 192.168.1.4: icmp_seq=2 ttl=128 time=0.195 ms64 bytes from 192.168.1.4: icmp_seq=3 ttl=128 time=0.190 ms^C--- 192.168.1.4 ping statistics ---3 packets transmitted, 3 received, 0% packet loss, time 1999msrtt min/avg/max/mdev = 0.190/0.198/0.211/0.018 ms

是由于公用网络的ICMPv4-In规则导致虚拟机无法ping通物理机。

因为长时间关闭防火墙会对系统安全造成威胁,所以我们要开启ICMPv4-In规则

1>.先将防火墙打开,

然后打开控制面板–>系统安全–>Windows Defender 防火墙–>高级设置

2>.点击入站规则

3>.找到ICMPv4-In规则,点击右键,启用规则

最后,在用虚拟机ping物理机

[root@centos7pc1 ~]# ping 192.168.1.4PING 192.168.1.4 (192.168.1.4) 56(84) bytes of data.64 bytes from 192.168.1.4: icmp_seq=1 ttl=128 time=0.211 ms64 bytes from 192.168.1.4: icmp_seq=2 ttl=128 time=0.195 ms64 bytes from 192.168.1.4: icmp_seq=3 ttl=128 time=0.190 ms^C--- 192.168.1.4 ping statistics ---3 packets transmitted, 3 received, 0% packet loss, time 1999msrtt min/avg/max/mdev = 0.190/0.198/0.211/0.018 ms

ok,问题解决!

好啦,今天的分享就到这里啦,每天进步一点点,小白变菜鸟~(~ ̄▽ ̄)~

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。