debian服务器上不了网,缺少默认网关

root@hbg:/# 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     0      0        0 eth2
192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1

 

添加网关

root@hbg:/# route add default gw 192.168.1.1

上网网段为192.168.1.X网段

 

添加后查询路由表信息如下:

root@hbg:/# 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    eth2
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0     eth2
192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0     eth1

相关文章:

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