Requesting Direction regarding iptables

From: Brad S (brad_at_akwwc.com)
Date: 07/29/04


Date: 28 Jul 2004 15:05:06 -0700

Hello, thanks for taking the time to read my msg.

I am trying to setup my iptables to use squid as the gateway for the
network (which looks like)
http://www.garnessengineering.com/images/currentconfig.gif

To get my cards to interact as a gateway I use the commands.

iptables --table nat --append POSTROUTING --out-interface eth1 -j
MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT

This allows my client machines to connect to the 149.0.0.1 gateway and
use the 192.168.0.1 gateway to communicate with the internet. I need
the http traffic to be routed through the squid proxy, prior to being
sent out to the router.

In the squid faq they give this command (BELOW) in order to use squid
as the gateway proxy. I tried implementing this with no sucess, I
think i am close, but some expert direction would be greatly
appreciated.

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

I am using linux slackware current, squid 2.5 & my kernel has support
for masqurading and iptables configured. I just am not sure which
iptables commands to use in my startup script to configure my network.
I really appreciate it thanks alot. yikes iptables is confusing and
intimidating, but I think i can get it with some direction.

Brad Garness



Relevant Pages

  • Re: Getting access out through gateway
    ... I can't see that the REJECT target at the end of the chain in the filter ... table is the main part of the problem because when iptables are stopped, ... Something in the network setup is awry. ... I see on the gateway 192.168.0.0/24 is defined in the rules and on the ...
    (Fedora)
  • combining iptables with squid to set access to internet
    ... about network where everything happens. ... Default Gateway: 192.168.1.248 (points to local proxy ... Default policy for all iptables chains is ...
    (comp.os.linux.networking)
  • Re: Tunneling server for http and https traffic
    ... I have a linux machine which is routed via eth0 to "network A" and via ... I am not interested in doing any kind of caching with squid. ... using iptables to allow IP forwarding for TCP ports ...
    (comp.os.linux.networking)
  • Re: Can I get email and Internet to dial automatically
    ... This is sort of like having a default gateway ... This should do the masquerading: ... iptables -t nat -A POSTROUTING -j MASQUERADE ... Don't forget to restart the network. ...
    (comp.os.linux.networking)
  • Re: IP masquerading: squid or iptables?
    ... If u use squid as a proxy, your client connects to the proxy-server, which in turn establishes a new connection to the internet. ... This is independent of iptables. ...
    (alt.os.linux.redhat)