iptables forwarding from one interface to another
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,