pxblog

检查路由

# route -n

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.0.1     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.0.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

 

如果提示:bash: route: command not found

先执行:

yum install net-tools

 

 

 

如果你缺失第一个路由,是肯定无法ping通外网的这里写代码片
添加dns

# vim /etc/resolv.conf


nameserver 8.8.8.8

添加路由

# route add default gw 192.168.0.1

重启网卡

service network restart

分类:

技术点:

相关文章:

  • 2021-11-21
  • 2022-12-23
  • 2021-06-20
  • 2022-02-15
  • 2022-12-23
  • 2021-07-17
  • 2021-06-10
  • 2022-12-23
猜你喜欢
  • 2022-01-01
  • 2022-01-01
  • 2021-09-12
  • 2022-01-05
  • 2022-01-01
  • 2022-12-23
相关资源
相似解决方案