Linux/window增加删除路由 添加路由: route add -net 191.0.0.0 netmask 255.0.0.0 dev eth0 删除路由: route del -net 191.0.0.0 netmask 255.0.0.0 dev eth0 添加默认路由: route add default gw 160.19.4.254 删除默认路由: route del default gw 160.19.4.254 或者route del default linux下添加路由的方法: 使用route 命令添加的路由,机器重启或者网卡重启后路由就失效了,方法: //添加到主机的路由 # route add –host 192.168.168.110 dev eth0 # route add –host 192.168.168.119 gw 192.168.168.1 //添加到网络的路由 # route add –net IP netmask MASK eth0 # route add –net IP netmask MASK gw IP # route add –net IP/24 eth1 //添加默认网关 # route add default gw IP //删除路由 # route del –host 192.168.168.110 dev eth0 在linux下设置永久路由的方法: 1.在/etc/rc.local里添加 route add -net 192.168.3.0/24 dev eth0 route add -net 192.168.2.0/24 gw 192.168.3.254 2.在/etc/sysconfig/network里添加到末尾 方法:GATEWAY=gw-ip 或者 GATEWAY=gw-dev 3./etc/sysconfig/static-router : any net x.x.x.x/24 gw y.y.y.y window增加删除路由: route add 160.0.0.0 mask 255.0.0.0 本机IP -p route delete 160.0.0.0
(免责声明:文章内容如涉及作品内容、版权和其它问题,请及时与我们联系,我们将在第一时间删除内容,文章内容仅供参考)
未经允许不得转载:本文采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权!
路由网 »
Linux/window增加删除路由