标签:
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
标签:
原文地址:http://www.cnblogs.com/rohens-hbg/p/5193334.html