[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: iptables redir of 80 to 8080



also sprach Petre Daniel <dani@cyber.ro> [2002.01.04.1457 +0100]:
> how can i redirect the 80 port to 8080,like i want all clients that try to 
> browse web pages to collect data from my squid.. instead of direct access..?
> thx..

you do need to configure squid as a transparent proxy, you know that,
right?

other than that:

iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080

on the proxy if traffic is passing through the proxy already, or if
traffic is going through a router, and the proxy is at 1.2.3.4

iptables -t nat -A PREROUTING -p tcp --dport 80 -s ! 1.2.3.4 \
  -j DNAT --to-destination 1.2.3.4:8080

-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:"; net@madduck
  
someday we'll find it
the rainbow connection
the lovers, the dreamers,
and me!
                                                             -- kermit

Attachment: pgp2HH0UHmLQy.pgp
Description: PGP signature


Reply to: