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

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

posted @ 2016-02-16 17:09  hbg-rohens  阅读(1610)  评论(0编辑  收藏  举报