linux使用ping的通内外网,但是一直提示:From 192.168.1.3 (192.168.1.3) icmp_seq=1 Redirect Network(New nexthop: gatewa
[root@localhost ~]# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
From 192.168.1.3 icmp_seq=1 Redirect Network(New nexthop: 192.168.1.1)
From 192.168.1.3: icmp_seq=1 Redirect Network(New nexthop: 192.168.1.1)
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=1.36 ms
[root@localhost ~]# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 192.168.1.3 icmp_seq=1 Redirect Network(New nexthop: 192.168.1.1)
From 192.168.1.3: icmp_seq=1 Redirect Network(New nexthop: 192.168.1.1)
64 bytes from 8.8.8.8: icmp_seq=1 ttl=115 time=188 ms
[root@localhost ~]# ping aliyun.com
PING aliyun.com (140.205.32.13) 56(84) bytes of data.
From 192.168.1.3 (192.168.1.3) icmp_seq=1 Redirect Network(New nexthop: gateway (192.168.1.1))
From 192.168.1.3 (192.168.1.3): icmp_seq=1 Redirect Network(New nexthop: gateway (192.168.1.1))
64 bytes from 140.205.32.13 (140.205.32.13): icmp_seq=1 ttl=41 time=10.3 ms
经过分析,内网外网都ping的通,发现是开了wifi共享的原因,主机被识别为路由了
解决:
//注释掉,再重启网络服务即可
[root@localhost ~]# vim /etc/sysconfig/network
# NETWORKING=yes
# HOSTNAME=localhost
# GATEWAY=192.168.1.1