linux下添加路由的方法
2011-08-04 23:28
459 查看
以下内容转载自http://blog.ligj.eol.cn/628
linux下添加路由的方法:
一:使用 route 命令添加
使用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
linux下添加路由的方法:
一:使用 route 命令添加
使用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
相关文章推荐
- linux和windows路由条目添加方法。
- linux下添加路由的方法
- linux下添加路由的方法:
- Linux添加路由的两种方法
- linux系统添加永久路由的几种方法
- Linux添加路由的两种方法
- linux 添加路由的方法
- linux下添加路由的方法:
- linux 添加永久路由的几种方法。
- linux和windows路由条目添加方法。
- linux下添加路由的方法以及参数详解
- Linux添加路由的两种方法
- Linux和Windos XP下向路由表添加路由
- Linux 6 添加网卡方法
- linux添加ip、路由相关命令
- loadrunner中添加windows和linux资源监控器的方法
- Linux添加主机路由
- Linux内核添加设备驱动方法
- Linux下为PHP添加扩展库的方法
- 关于linux的添加永久静态路由的static-routes方法