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 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

 

posted @ 2015-09-16 09:36  wiessharling  阅读(922)  评论(0编辑  收藏  举报