Check the packages that should go through eth1:
iptables -A PREROUTING -i eth0 -t mangle -p tcp --dports 22,53,80,443 -j MARK --set-mark 1
Add a rule eth1.outto route marked packets:
echo "201 eth1.out" >> /etc/iproute2/rt_tables
ip rule add fwmark 1 table eth1.out
Route all marked packages with eth1:
/sbin/ip route add default via 192.168.2.1 dev eth1 table eth1.out
Get the rest through eth2:
/sbin/ip route add default via 192.168.3.1 dev eth2
If the rule MARKdoes not work, try using CONNMARK.
source
share