码迷,mamicode.com
首页 > 系统相关 > 详细

Linux多网卡多IP配置

时间:2015-09-16 09:43:10      阅读:268      评论:0      收藏:0      [点我收藏+]

标签:

    echo "210 local100" >> /etc/iproute2/rt_tables
    echo "220 local200" >> /etc/iproute2/rt_tables
    echo "230 local300" >> /etc/iproute2/rt_tables
     
    ip route add 192.168.0.0 dev eth0 src 192.168.0.251 table local100
    ip route add 192.168.0.0 dev eth1 src 192.168.0.252 table local200
    ip route add 192.168.0.0 dev eth2 src 192.168.0.253 table local300
     
    ip route add default dev eth0 table local100
    ip route add default dev eth1 table local200
    ip route add default dev eth2 table local300
     
    ip rule add from 192.168.0.251 table local100
    ip rule add from 192.168.0.252 table local200
    ip rule add from 192.168.0.253 table local300

 

Linux多网卡多IP配置

标签:

原文地址:http://www.cnblogs.com/wiessharling/p/4812244.html

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