Find the answer to your Linux question:
Results 1 to 3 of 3
I am setting up a squid proxy server which currently is working. I am how ever having issues with IPtables and getting the correct command and syntax basically I want ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2011
    Posts
    3

    iptables


    I am setting up a squid proxy server which currently is working. I am how ever having issues with IPtables and getting the correct command and syntax basically I want all HTTP traffic coming in on port routed to port 3128 and all other traffic would be sent to the router. Can any one tell me how to get that setup. Below is the command and syntax I used.
    iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j DNAT --to 172.20.20.201:3128

    Basically my squid proxy server sites behind the router and would filter HPTP traffic then send it to the router and all other traffic would be sent on itís way to the router and off to the internet .
    My plan was to setup dhcp so the default gateway would be my proxy server that way we donít have to configure their web browser it would all be transparent.

  2. #2
    Linux Enthusiast scathefire's Avatar
    Join Date
    Jan 2010
    Location
    Western Kentucky
    Posts
    626
    Code:
    iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
    This will send all port 80 traffic to port 3128. I assuming your proxy is running transparently.
    linux user # 503963

  3. #3
    Just Joined!
    Join Date
    Nov 2011
    Posts
    3
    I sure am. I found the problem had to add the below line in the
    squid.conf file

    http_port IP:3128 transparent

    Here Ip is the IP address of my proxy box

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •