当前位置:首页 > 操作系统 > Linux

Linux多网卡多IP配置

    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 from192.168.0.251 table local100
    ip rule add from192.168.0.252 table local200
    ip rule add from192.168.0.253 table local300

 

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


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!

相关教程推荐

其他课程推荐