Skip to contentSkip to conversation

Redirection question.

DISCUSSION Hernán Mailluquet 2 participants 2 messages Mar 11, 2003

lore
Share & tools
lore
#0 lore raw

Hi, i have doing transparent proxy with squid and this port redirect rule:

iptables -t nat -A PREROUTING -i eth1 -p TCP --dport 80 -j REDIRECT --to-port 8080

and works fine. Now, i want dont't redirect some request to destination dirs like 192.168.0.0/24 and 192.168.1.0/24 (for example). How i can do this?

Thanks.

#1 lore raw
Quoted 9 lines

Hi, i have doing transparent proxy with squid and this port redirect rule:

iptables -t nat -A PREROUTING -i eth1 -p TCP --dport 80 -j REDIRECT --to-port 8080

and works fine. Now, i want dont't redirect some request to destination dirs like 192.168.0.0/24 and 192.168.1.0/24 (for example). How i can do this?

You could make som ACCEPT'ing rules before you REDIRECT:

iptables -t nat -A PREROUTING -i eth1 -p TCP --dport 80 -d 192.168.0.0/24 -j ACCEPT
iptables -t nat -A PREROUTING -i eth1 -p TCP --dport 80 -d 192.168.1.0/24 -j ACCEPT

Regards, Jesper