[LARTC] Two outbound internet links, using one network interface

Pio Mendez pio_mendez at hotmail.com
Wed Oct 11 18:31:40 CEST 2006


PREROUTING chain is not traversed by local traffic, but OUTPUT chain does. 
What about this script?

---------------------------------------------------------------------------------

IPT=/sbin/iptables
PORT_LIST="22 53"
for PORT in $PORT_LIST
do
$IPT -t mangle -A PREROUTING -p tcp --dport $PORT -s <ip-lan> -j MARK 
--set-mark 4
$IPT -t mangle -A OUTPUT -p tcp --dport $PORT -s <ip-lan> -j MARK --set-mark 
4
done

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

ip route add 192.168.10.0/24 dev eth0 table 4
ip route add default via 192.168.10.1 table 4

ip rule add fwmark 4 table 4

Paolo Malfatti
CiDiS Camiri

_________________________________________________________________
Charla con tus amigos en línea mediante MSN Messenger: 
http://messenger.latam.msn.com/



More information about the LARTC mailing list