今天把服务器移至内网,在配置linux网络时候,可以ping通局域网,ping DNS时提示: connect: network is unreachable 这条命令就可以搞定: route add default gw 192.168.1.1 后面那是你的网关。现在 route 一下 [root@localhost ~]# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.1.0 * 255.255.255.0 U 0 0 0 eth0 link-local * 255.255.0.0 U 1002 0 0 eth0 default 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
[root@localhost ~]# ping www.baidu.com PING www.a.shifen.com (220.181.111.111) 56(84) bytes of data. 64 bytes from 220.181.111.111: icmp_seq=1 ttl=54 time=30.5 ms 64 bytes from 220.181.111.111: icmp_seq=2 ttl=54 time=27.1 ms
|