From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charan" Subject: Forward to a Cache Server Date: Sat, 23 Aug 2003 19:53:51 +0530 Sender: netfilter-admin@lists.netfilter.org Message-ID: <093601c36982$2cd753c0$f58047ca@Charanbeer> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0933_01C369B0.46665CE0" Return-path: Errors-To: netfilter-admin@lists.netfilter.org List-Help: List-Post: List-Subscribe: , List-Id: List-Unsubscribe: , List-Archive: To: netfilter@lists.netfilter.org This is a multi-part message in MIME format. ------=_NextPart_000_0933_01C369B0.46665CE0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi List I have a Linux box that allows LAN users with local IP addresses to = access Internet using the following IPtables based shell script. I have = basic understanding of IPtables and have done some reading on how to fwd = all dport 80 traffic to a separate box that runs a caching server (Squid = in my case). Can someone help me with changes in the existing setup: --> to forward all the traffic to the squid port (say 8080) on a = separate box or; -->to a local port (say 4000) running transproxy that simply forwards = all the requests coming to local:4000 on to the squid box at port 8080. #!/bin/sh # Set up default policies iptables -P INPUT ACCEPT iptables -P OUTPUT ACCEPT iptables -P FORWARD DROP # Flush all tables iptables -F iptables -t nat -F iptables -t mangle -F #NAT iptables -t nat -A POSTROUTING -o eth0 -s 192.168.1.0/24 -j SNAT = --to-source 202.xx.xxx.xx # Forward all traffic for Local Network iptables -t filter -A FORWARD -s 192.168.1.0/24 -j ACCEPT iptables -t filter -A FORWARD -d 192.168.1.0/24 -j ACCEPT # Enable IP forwarding. echo "1" > /proc/sys/net/ipv4/ip_forward Also, please guide me to some good document on IPtables. Thanks in advance Charan ------=_NextPart_000_0933_01C369B0.46665CE0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi List
 
I have a Linux box that allows LAN = users=20 with local IP addresses to access Internet using the following = IPtables=20 based shell script. I have basic understanding of = IPtables=20 and have done some reading on how to fwd all dport 80 traffic = to a=20 separate box that runs a caching server (Squid in my case). Can someone = help me=20 with changes in the existing setup:
--> to forward all the traffic to = the squid port=20 (say 8080) on a separate box or;
-->to a local  port (say 4000) = running=20 transproxy that simply forwards all the requests coming = to local:4000=20 on to the squid box at port 8080.
 
#!/bin/sh
 
# Set up default policies
iptables = -P INPUT=20 ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD = DROP
 
# Flush all tables
iptables = -F
iptables -t=20 nat -F
iptables -t mangle -F
 
#NAT
iptables -t nat -A POSTROUTING = -o eth0 -s=20 192.168.1.0/24 -j SNAT --to-source 202.xx.xxx.xx
 
# Forward all traffic for Local = Network
iptables=20 -t filter -A FORWARD -s 192.168.1.0/24 -j ACCEPT
iptables -t filter = -A=20 FORWARD -d 192.168.1.0/24 -j ACCEPT
 
# Enable IP forwarding.
echo "1" = >=20 /proc/sys/net/ipv4/ip_forward
 
Also, please guide me to some = good document on=20 IPtables.
 
Thanks in advance
Charan
------=_NextPart_000_0933_01C369B0.46665CE0--