给linux主机添加删除默认路由

route add default gw x.x.x.x 

route del default gw x.x.x.x

详细的路由添加方法

//添加到主机的路由
# route add –host 192.168.1.11 dev eth0
# route add –host 192.168.1.12 gw 192.168.1.1
//添加到网络的路由
# route add –net 192.168.1.11  netmask 255.255.255.0 eth0
# route add –net 192.168.1.11  netmask 255.255.255.0 gw 192.168.1.1
# route add –net 192.168.1.0/24 eth1
//添加默认网关
# route add default gw 192.168.2.1
//删除路由
# route del –host 192.168.1.11 dev eth0
--------------------- 

转载自:https://blog.csdn.net/xchong3/article/details/80773105 
 

你可能感兴趣的:(Linux)