(E-Mail Removed) wrote:
> I have 3 network cards on my system and I want to be able to forward
> from LAN0 eth0 to LAN1 eth1 and LAN0 eth0 to LAN2 eth2 but not LAN1
> eth1 to LAN2 eth2. I added a rule in iptables to stop forwarding from
> the IP address on eth1 to eth2.
> But I started looking at ethereal packets to determine how I was
> getting from LAN1 to LAN2 and the ethereal output indicated that I was
> going through eth0.
> I'm sure that I can probably fiddle around with iptables until I can
> stop this, but is there a way configure routes more explicitly to
> prevent this action.
Since you need ip_forward=1 you are discovering one of the effects of
the weak ES model that Linux uses. Ie., the addresses belong to the
_host_ and _not_ to the nic despite what networking utils would lead
you to believe ;-)
You can (already have in other post?) address this with netfilter rules
but it's messy and may prove to be difficult to maintain.
Your best solution, IMHO, is to use multiple routing tables and route
selection rules. Since you're the one that will maintain it, I will
for now suggest you look at these to see if you want to go that way for
a solution. It can be a bit confusing at first :-)
http://www.policyrouting.org/PolicyR...NLINE/TOC.html
especially
http://www.policyrouting.org/PolicyR...5.web.html#5.5
It helps to have handy a copy of this:
http://snafu.freedom.org/linux2.2/do...f/ip-cref.html
Also available here with another useful ref:
http://linux-ip.net/gl/ip-cref/
http://linux-ip.net/html/
Multiple routing tables are not that hard to manage once you get your
head around them.
good luck,
prg