IPADDR = 192.168.1.254
再增加一条静态路由:
# route add -net 192.168.1.0 netmask 255.255.255.0
这样网络中就有三条静态路由记录了: # route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface
172.16.0.0 * 255.255.0.0 U 0 0 0 eth0
10.0.0.0 * 255.0.0.0 U 0 0 0 eth1
192.168.1.0 * 255.255.255.0 U 0 0 0 eth2
还要为系统增加一条缺省路由,因为缺省的路由是把所有的数据包都发往它的上一级网关(假设地址是172.16.1.100,这个地址依赖于使用的网络而定,由网络管理员分配),因此增加如下的缺省路由记录:
# route add default gw 172.16.1.100
这样系统的静态路由表建立完成,它的内容是
# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface
172.16.0.0 * 255.255.0.0 U 0 0 0 eth0
10.0.0.0 * 255.0.0.0 U 0 0 0 eth1
192.168.1.0 * 255.255.255.0 U 0 0 0 eth2
default 172.16.1.100 0.0.0.0 UG 0 0 0 eth0