route 变更

1、

10.1.21.105,10.1.21.106,10.1.21.107添加主机路由指向10.1.21.254:
10.0.0.0掩码255.0.0.0 网关10.1.21.254
192.168.0.0掩码255.255.0.0网关10.1.21.254


添加主机路由

route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.1.21.254
route add -net 192.168.0.0 netmask 255.255.0.0 gw 10.1.21.254


2、

10.1.21.105,10.1.21.106,10.1.21.107更改默认网关到 10.1.21.111:

a、添加默认网关
route add default gw 10.1.21.111
b、删除原默认网关
route del default gw 10.1.21.254
c、修改网卡配置(不启动网卡
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
NM_CONTROLLED=yes
ONBOOT=yes
TYPE=Ethernet
HWADDR=2c:44:fd:8b:aa:a4
IPADDR=10.1.21.105
NETMASK=255.255.255.0
GATEWAY=10.1.21.254  修改为   10.1.21.111
IPV6INIT=no

你可能感兴趣的:(route 变更)