Prob with IPTABLES + REDIRECT + IPROUTE2

Sebastião Antônio Campos (GWA) sa.campos at datasulsp.com.br
Fri Jun 24 02:45:57 CEST 2005


Someone could help me???



I have two links to internet, one by ADSL (512 kbps) e other EMBRATEL ( 1024
Kpbs ).
I did "ip route" e it happen ok, but whem I put the with iptables to traffic
on 80 port redirect to 3128 port of SQUID, I can only use the ADSL link,
what is default link.
The configurations:

( ADSL 512K )       eth0
Server IP  = 192.168.7.2
Modem IP     = 192.168.7.1

( EMBRATEL 1024K )  eth1
Server IP  = 200.200.200.2
Router IP    = 200.200.200.1

( LAN 1)      eth2
Server IP  = 10.0.0.1
LAN   = 10.0.0.0/24

( LAN 2)      eth2:1
Server IP  = 192.168.0.1
LAN   = 192.168.0.0/24

#iptables -t nat -A POSTROUTING -o eth0 -s 192.168.0.0/24 -j
SNAT --to-soutce 192.168.7.1
#iptables -t nat -A POSTROUTING -o eth1 -s 10.0.0.20 -j SNAT --to-soutce
200.200.200.2
#ip rule add from 10.0.0.20/32 table embratel
#ip route add 200.200.200.1 dev eth1 table embratel
#ip route add default via 200.200.200.1 table embratel
#ip route add 10.0.0.20/32 via 10.0.0.1 table embratel

Here everything is workingm, but when I put the following rule....the
traffic goes to only ADSL Link that is the default gateway.

#iptables -t nat -A PREROUTING -p tcp -i eth2 --dport 80 -j
REDIRECT --to-port 3128

I am some help me.

Tks

Sebastião Antônio Campos 




More information about the netfilter mailing list