码迷,mamicode.com
首页 > 系统相关 > 详细

linux配置网络,但无法与主机ping通

时间:2017-11-22 13:18:40      阅读:513      评论:0      收藏:0      [点我收藏+]

标签:linux系统基础问题

刚刚新建的虚拟机,打算配置个静态ip,便于管理。但是配置好ip发现竟然不能互相ping通!

本次使用nat模式!


[root@localhost Desktop]# ping 10.0.0.1

PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.

From 10.0.0.2 icmp_seq=11 Destination Host Unreachable

From 10.0.0.2 icmp_seq=12 Destination Host Unreachable

From 10.0.0.2 icmp_seq=13 Destination Host Unreachable

From 10.0.0.2 icmp_seq=15 Destination Host Unreachable


通过网上许多方法,例如:在/etc/sysconfig/network-script/ifcfg-eth0中添加各种东西

但是结果并不理想。没什么用!

重启网络服务也成功,但是就是不能ping。新建一个别的虚拟机,经测试。两台虚拟机可以互相ping通。则,感觉大概不是linux的原因。


后经过仔细研究发现,原因不在linux。而是在与win(真机)

需要通过控制面板--系统和安全--管理工具--服务

并且在服务中找到vmware nat..的服务并且启动。(如果是想要动态获取ip,则需要启动vmware dhcp服务)


此时大功告成。

[root@localhost ~]# ping 10.0.0.1

PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.

64 bytes from 10.0.0.1: icmp_seq=1 ttl=128 time=0.267 ms

64 bytes from 10.0.0.1: icmp_seq=2 ttl=128 time=0.288 ms


本文出自 “学习使我快乐” 博客,请务必保留此出处http://slient.blog.51cto.com/11702434/1984044

linux配置网络,但无法与主机ping通

标签:linux系统基础问题

原文地址:http://slient.blog.51cto.com/11702434/1984044

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!