Re: Two outbound internet links, using one network interface

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/

_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux