`
shihuan830619
  • 浏览: 573950 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

验证RedHat6是否能够联网

阅读更多
验证RedHat6是否能够联网:
[root@testagent ~]# ping 8.8.8.8
[root@testagent ~]# ping 8.8.4.4
下载www.baidu.com首页并且显示下载信息:
[root@testagent ~]# wget -d http://www.baidu.com
能成功下载百度首页index.html文件,但不一定能ping http://www.baidu.com

[root@testagent ~]# ping 180.76.76.76
[root@testagent ~]# ping 23.5.5.5
[root@testagent ~]# ping http://www.baidu.com

[root@testagent ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
NETMASK=255.255.255.0
IPADDR=192.168.3.56
HWADDR=00:0C:29:C1:D6:8A
TYPE=Ethernet
#UUID=6a73447a-4baa-4ad4-bdca-73d3a654583f
ONBOOT=yes
#NM_CONTROLLED=yes
BOOTPROTO=static
GATEWAY=192.168.3.1
NETWORKING=yes
#DEFROUTE=yes
#DNS1=8.8.8.8
#DNS2=8.8.4.4
#DNS1=202.96.209.5
#DNS2=202.96.209.133
DNS1=180.76.76.76
DNS2=23.5.5.5


如果还是不能连接外网,可以用route -n查看一下路由情况:
[root@dokcer ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.10.2    0.0.0.0         UG    0      0        0 ens33
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 ens33
192.168.10.0    0.0.0.0         255.255.255.0   U     0      0        0 ens33
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics