linux 多网卡 同网段 的ARP机制

作者: admin 分类: linux 发布时间: 2014-12-01 14:48 ė 6 没有评论

直接上解决办法吧

The solution has been found, thanks to one of the guys on our local tech
mailing list (who is a truly wonderful and extremely knowedgable and
helpful person).

For the benefit of anyone else who might have occasion to do this, here
is the complete solution.

My IP addresses are eth1$.89.92.178, eth2$.89.92.180
Gateway for both is 24.89.92.1

First, add two lines to /etc/iproute2/rt_tables, so it looks like this:

#
# reserved values
#
255 local
254 main
253 default
0 unspec
#
# local
#
#1 inr.ruhep
50 access1
60 access2

Then add the following routes:

ip route add 24.89.92.0/24 dev eth1 table access1
ip route add default via 24.89.92.1 dev eth1 table access1
ip rule add from 24.89.92.178/32 lookup access1

ip route add 24.89.92.0/24 dev eth2 table access2
ip route add default via 24.89.92.1 dev eth2 table access2
ip rule add from 24.89.92.180/32 lookup access2

在来原理吧
http://www.linuxjournal.com/node/7291/print
这个文章也挺不错

本文出自 小Q,转载时请注明出处及相应链接。

本文永久链接: http://www.linuxqq.com/archives/1395.html

0
更多
Ɣ回顶部