centos配置静态IP和dns后,不能上网,也ping不通默认网关

xiangfangwei 发布于 2013/10/17 13:48
阅读 26K+
收藏 0

在虚拟机上装了centos6.4,尝试将centos的ip设置成跟本地主机同一网段,dns和默认网关也配置成跟本地主机一样的,防火墙也关闭了,service network restart也试了,在虚拟机vm的setting中也将Network Adapter设置成Brid了

但配置完之后不能上网,也ping不通默认网关,请问是什么原因?

详细情况如下:

[root@localhost ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:E5:9C:5F  
          inet addr:172.16.3.98  Bcast:172.16.3.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fee5:9c5f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1756 errors:0 dropped:0 overruns:0 frame:0
          TX packets:307 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:155339 (151.6 KiB)  TX bytes:13369 (13.0 KiB)
          Interrupt:19 Base address:0x2024

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:36384 errors:0 dropped:0 overruns:0 frame:0
          TX packets:36384 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:11625407 (11.0 MiB)  TX bytes:11625407 (11.0 MiB)

[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="static"
HWADDR="00:0C:29:E5:9C:5F"
IPV6INIT="no"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Ethernet"
UUID="9663d550-4153-44b2-b5f6-8e49fc89a7e7"
IPADDR=172.16.3.98
NETMASK=255.255.255.0
GATEWAY=172.16.3.254
DNS1=10.1.1.4
DNS2=210.22.70.3

[root@localhost ~]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
172.16.3.0      *               255.255.255.0   U     0      0        0 eth0
link-local      *               255.255.0.0     U     1002   0        0 eth0
default         172.16.3.254    0.0.0.0         UG    0      0        0 eth0

[root@localhost ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=localhost.localdomain
GATEWAY=172.16.3.254

[root@localhost ~]# cat /etc/resolv.conf
; generated by /sbin/dhclient-script
search localdomain
nameserver 10.1.1.4
nameserver 210.22.70.3








加载中
0
十舍七匹狼
十舍七匹狼

lz我在vmare中安装的centos6.4,然后也不懂怎么上网,后来百度了这篇:

vmare下设置Centos

我已经成功的在6.4中上网了。也和本机通信了。

不知道对你有没有帮助。这个恰巧是我前天百度的。

xiaopapa
xiaopapa
回复 @xiangfangwei : 不说一下怎么解决的?
TJW123
TJW123
回复 @xiangfangwei : 这个问题怎么解决的,求帮助啊大神?
x
xiangfangwei
问题解决了,不过还是谢谢阿!
0
gesanghua
gesanghua
怎么解决的呀
返回顶部
顶部