Definitely go with standards, some tips follows
#mark desires packets
iptables -t mangle -A PREROUTING -p tcp --dport http -j MARK --set-mark 2
iptables -t mangle -A PREROUTING -p tcp --dport https -j MARK --set-mark 2
#create the alternative routing table
#add standard routes like
ip route add 192.168.1.0/24 dev eth0 table 102
...
#add the default route via second link
ip route add default via 1.2.3.4 dev eth1 table 102 #eth1 assumed for the second gateway
#and tell kernel to use the alternative routing table sometimes
ip rule add fwmark 0x2 lookup 102 prio 102
Main Topics
Browse All Topics





by: BlazPosted on 2009-06-11 at 03:29:57ID: 24600481
You could use the ROUTE target in iptables to do that.
entation/H OWTO/netfi lter- exten sions-HOWT O-4.html#s s4.5
http://netfilter.org/docum
As said in the HOWTO the preferred way is to use MARK target with iproute2 rules but it is more complicated.