linux 添加路由的方法
来源:互联网 发布:雄安大数据概念股 编辑:程序博客网 时间:2024/06/07 02:33
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
一:使用 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
0 0
- linux 添加路由的方法
- Linux下添加静态路由的方法
- Linux添加路由的两种方法
- Linux添加路由的两种方法
- Linux添加路由的两种方法
- Linux添加临时路由及永久路由的方法
- linux下添加路由的方法以及参数详解
- CentOS6 Linux系统添加永久静态路由的方法
- suse 11 Linux 静态路由的添加方法
- 添加URL路由的几种方法
- Windows 手动添加路由的方法
- 关于添加WINDOWS静态路由的方法
- linux下添加新的路由
- Linux中添加静态路由的方法(临时的和永久的)
- 关于linux的添加永久静态路由的static-routes方法
- linux下(Ubuntu、centos)添加永久静态路由的方法
- linux下(Ubuntu、centos)添加永久静态路由的方法
- linux添加路由
- 查看linux重启时间方法
- mysql ERROR 2002
- 去掉word中的波浪线
- 查看redhat版本
- 新建的nagios,本地RHEL6.0报HTTP/1.1--403错误
- linux 添加路由的方法
- 什么是redis
- 张廷玉 的诗
- 查看硬盘的型号信息
- linux 下查看CPU基本信息
- failover
- linux/windows查看端口被占用情况
- 使用word编辑文字时,按空格键会出现一连串的点.怎么取消呢
- Linux下查看CPU信息, 包括位数和多核信息