码迷,mamicode.com
首页 > 其他好文 > 详细

双网段设置路由

时间:2016-11-16 02:27:38      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:spec   使用   cal   5.0   iproute   rom   ipad   表名   linux   

1. 注册路由表名称

# cat /etc/iproute2/rt_tables 
#
# reserved values
#
255     local
254     main
253     default
97      jiuqi
0       unspec
#
# local
#
#1      inr.ruhep

2. 设置IP地址

# cat ifcfg-eth2:0
DEVICE=eth2:0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.97.9
NETMASK=255.255.255.0

3. 设置路由表内容

# cat route-eth2\:0 
default via 10.10.32.200 dev eth2 table jiuqi

4. 设置使用路由表的条件

# cat rule-eth2\:0 
from 192.168.97.0/24 table jiuqi pre 5

5. 重启网络

service network restart

ip route list table jiuqi
ip rule list

 

参考地址

http://coderazzi.net/linux/dual_nic_linux.htm

双网段设置路由

标签:spec   使用   cal   5.0   iproute   rom   ipad   表名   linux   

原文地址:http://www.cnblogs.com/osroot/p/6067802.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!