在linux下添加永久静态路由
来源:互联网 发布:常用sql查询语句大全 编辑:程序博客网 时间:2024/04/29 11:27
博客地址:http://blog.chinaunix.net/uid-8504518-id-2030407.html
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
# 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下(Ubuntu、centos)添加永久静态路由的方法
- linux下(Ubuntu、centos)添加永久静态路由的方法
- CentOS添加永久静态路由
- CentOS添加永久静态路由
- 添加CentOS永久静态路由
- CentOS添加永久静态路由
- Windows 添加永久静态路由
- CentOS添加永久静态路由
- CentOS添加永久静态路由
- 服务器添加永久静态路由
- centos添加永久静态路由
- Windows 添加永久静态路由
- POJ3210 a stack or a queue
- Android模仿华为长按功能键实现清除内存功能
- Linux下重要日志文件及查看方式
- 在linux下新增一块硬盘的操作。(包含大于2T的硬盘在linux下挂载操作)
- Box2D一:基础知识
- 在linux下添加永久静态路由
- Android 打造炫目的圆形菜单 秒秒钟高仿建行圆形菜单
- 基本数据结构:链表
- 二叉树中的那些常见的面试题
- Opencv的Rect类-矩形类
- 五岳归来不看山
- Introduction to Java Programming编程题7.11<硬币游戏:显示正反面>
- C++中 类 占 内存问题
- [leetcode-228]Summary Ranges(java)