ping不通百度,未知的名称或服务

在这里插入图片描述

解决方法

route添加一条路由,需要先安装net-tools工具包

[root@localhost ~]# yum install net-tools -y
[root@localhost ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     100    0        0 enp3s0
[root@localhost ~]# route add default gw 192.168.1.1
[root@localhost ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 enp3s0
192.168.1.0     0.0.0.0         255.255.255.0   U     100    0        0 enp3s0

成功解决

[root@localhost ~]# ping www.baidu.com
PING www.a.shifen.com (220.181.38.149) 56(84) bytes of data.
64 bytes from 220.181.38.149 (220.181.38.149): icmp_seq=1 ttl=49 time=3.73 ms
64 bytes from 220.181.38.149 (220.181.38.149): icmp_seq=2 ttl=49 time=2.64 ms
^C
--- www.a.shifen.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 2.647/3.193/3.739/0.546 ms

在这里插入图片描述

Logo

云原生社区为您提供最前沿的新闻资讯和知识内容

更多推荐