网关ping的通,外网ping不通

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/qq_26228013/article/details/52996644

这个问题今天就是设置了IP地址之后,发现可以ping内网,外网不行,这时候很有可能是网关的问题

先route看看有没有你要的网关,没有就route add default gw 192.168.1.1 dev eth0

之后重启网络服务 service network restart就可以了


展开阅读全文

centos 无法ping外网,但可以ping网关

11-13

centos 无法ping通外网,但可以ping通网关rnrnrn###这是我/etc/sysconfig/network-scripts/ifcfg-eth0 的网络配置信息rnrn[code=text]DEVICE="eth0"rnBOOTPROTO=nonernHWADDR="00:23:54:DE:01:69"rnONBOOT="yes"rnTYPE="Ethernet"rnUSERCTL=nornIPV6INIT=nornPEERDNS=yesrnNETMASK=255.255.255.0rnIPADDR=192.168.1.110rnGATEWAY=192.168.1.1rnDNS1=202.96.134.133rnDNS2=202.96.128.86[/code]rnrn###############ifconfig详细rn[code=text][root@laobi /]# ifconfigrneth0 Link encap:Ethernet HWaddr 00:23:54:DE:01:69 rn inet addr:192.168.1.110 Bcast:192.168.1.255 Mask:255.255.255.0rn inet6 addr: fe80::223:54ff:fede:169/64 Scope:Linkrn UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1rn RX packets:1924 errors:0 dropped:0 overruns:0 frame:0rn TX packets:1239 errors:0 dropped:0 overruns:0 carrier:0rn collisions:0 txqueuelen:1000 rn RX bytes:211170 (206.2 KiB) TX bytes:119004 (116.2 KiB)rn Interrupt:27 Base address:0xe000 rnrnlo Link encap:Local Loopback rn inet addr:127.0.0.1 Mask:255.0.0.0rn inet6 addr: ::1/128 Scope:Hostrn UP LOOPBACK RUNNING MTU:16436 Metric:1rn RX packets:229 errors:0 dropped:0 overruns:0 frame:0rn TX packets:229 errors:0 dropped:0 overruns:0 carrier:0rn collisions:0 txqueuelen:0 rn RX bytes:22287 (21.7 KiB) TX bytes:22287 (21.7 KiB)[/code]rnrn#########################ping 网关rn[code=text][root@laobi /]# ping 192.168.1.1rnPING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.rn64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.377 msrn64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.150 msrn64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=0.144 msrn64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=0.140 ms[/code]rnrnrn 论坛

没有更多推荐了,返回首页