Link to home
Start Free TrialLog in
Avatar of BurnOut9
BurnOut9

asked on

iptables, use alternate connection based on source ip or port

Hi All,
I have a linux firewall setup with 4 NIC's.

eth0 - 192.168.42.254 (LAN)
eth1 - 111.111.111.111 (Ethernet wireless corporate connection)
eth2 - 222.222.222.222 (ADSL 2+) (ppp1)
eth3 - 333.333.333.333 (ADSL 2+) (ppp0)

Currently all traffic goes out through eth1, I have port forwards and other rules for inbound connections and they are working OK. But I'm trying to get all traffic from a couple of source IP's to use eth3 and be able to send all FTP (port 21) traffic out eth2.

I've tried using
iptables -t NAT -A POSTROUTING -s 192.168.42.100 -d 0.0.0.0 -p tcp -o eth3 -j MASQUERADE

I also tried quite a few other combinations, can't seem to get it working. I've tried using good old Google to find an answer, but can't.

Questions.
Is it possible to do this with iptables?
If so, what should I be using?
If Not, what other solution is available?

Cheers,
Terry
ASKER CERTIFIED SOLUTION
Avatar of Blaz
Blaz
Flag of Slovenia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Qlemo
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.