Results 1 to 3 of 3
Hello everyone,
I have three interfaces,
eth0 - aaa.aaa.aaa.aaa - external
eth1 - bbb.bbb.bbb.bbb - internal
eth2 - ccc.ccc.ccc.ccc - external
I want all internal traffic (from eth1) to go ...
- 03-15-2007 #1Just Joined!
- Join Date
- Mar 2007
- Posts
- 2
iptables forwarding from one interface to another
Hello everyone,
I have three interfaces,
eth0 - aaa.aaa.aaa.aaa - external
eth1 - bbb.bbb.bbb.bbb - internal
eth2 - ccc.ccc.ccc.ccc - external
I want all internal traffic (from eth1) to go out eth0, with the exception of HTTP traffic which I want to go out eth2.
I've satisfied my major condition with my routing table, but I can't seem to implement the exception. I've tried POSTROUTING/MASQUERADE and PREROUTING/SNAT, but I can't seem to figure it out.
My problem is that I don't know how to tell iptables which interface the packet should leave the system through. I can specify what the destination ip should be, but I'm not sure how to tell it which interface.
Any help would be appreciated.
Thanks in advance,
//Rob
- 03-15-2007 #2Just Joined!
- Join Date
- Mar 2007
- Posts
- 2
ROUTE patch
Through investigation on the web it seems that there is a ROUTE patch for iptables that allows exactly what I want. I'd really like to avoid rebuilding my kernel, does anyone know of another solution?
//Rob
- 03-15-2007 #3
Shouldn't be a big deal with iptables. Just use the option -i and -o for the interfaces and ! -dport in conjunction with -d. You'll get further details with 'man iptables'.
"Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect." Linus Benedict Torvalds


Reply With Quote