Port forwarding and IPtables commands

Andy ag1234 at carmen.se
Wed Jan 19 09:38:59 UTC 2005


Tammar K. Ajam wrote:

 > iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 \
 >	-j REDIRECT -d 192.168.0.2/24 --to-port 3128

The REDIRECT target is valid only for the local machine. You have to use
the DNAT target, like Alexander Dalloz suggests, except that you dont't 
have to bother about udp: http is a tcp-only protocol.

There are a lot of other things to take care of: routes, name-resolving, 
allowing access with NAT from the squid machine to the internet and 
maybe something else that I can't think of now.

/Andy




More information about the fedora-list mailing list