配置临时静态路由:(11.2.80.0 代表目标地址)
添加静态路由:route add -net 11.2.80.0 netmask 255.255.255.0 gw 11.2.81.1
删除静态路由:route del -net 11.2.80.0 netmask 255.255.255.0 gw 11.2.81.1
永久配置静态路由:(11.2.80.0 代表目标地址)
suse 11 sp3
vi /etc/sysconfig/network/routes
修改内容为:
---------------------------------------
11.2.80.0 11.2.81.1 255.255.255.0 em2
default 11.6.42.1 - -
-----------------------------------------
重启服务:service network restart
redhat6.8
vi /etc/sysconfig/network-scripts route-eth0
添加内容为:
-------------------------------------------
11.2.80.0/28 via 11.2.81.1
-------------------------------------------
重启服务:service network restart