port 80 out new ISP

Brent Clark bclark at eccotours.dyndns.org
Fri Aug 19 17:55:16 CEST 2005

Hi all

For a few days now I have been struggling to get my HTTP traffic across my new ISP.

I currently have been reading the following doc.


and have changed my scripts accordingly.

But for some reason, it still dont work

my setup is as so

eth0    -> Routes traffic to old ISP
eth1    -> Private Lan
eth2    -> for ADSL

Adsl modem:
ipaddress: (external ip dynamically assigned)

## Create the table
ip route flush table TELKOM  >>/dev/null
ip route show table main |grep -Ev ^default\
   | while read ROUTE ; do
     ip route add table TELKOM $ROUTE

## Add the ADSL as route to route table 4

ip route add default via dev eth2 table TELKOM >>/dev/null

## Add the route to table TELKOM

ip rule add fwmark 1 table TELKOM >> /dev/null

$IPT -t nat -A PREROUTING -i eth1 -t mangle -p tcp --dport 80 -j MARK --set-mark 1
$IPT -t nat -A PREROUTING -i eth1 -t mangle -p tcp --dport 443 -j MARK --set-mark 1

# SNAT the Private LAN
$IPT -t nat -A POSTROUTING -o eth0 -s -j SNAT --to-source
#$IPT -t nat -A POSTROUTING -o eth2 -s -j SNAT --to-source
$IPT -t nat -A POSTROUTING -o eth2 -s -j MASQUERADE

More information about the netfilter mailing list