All of lore.kernel.org
 help / color / mirror / Atom feed
* Forward to a Cache Server
@ 2003-08-23 14:23 Charan
  0 siblings, 0 replies; only message in thread
From: Charan @ 2003-08-23 14:23 UTC (permalink / raw)
  To: netfilter

[-- Attachment #1: Type: text/plain, Size: 1212 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 2578 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-08-23 14:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-23 14:23 Forward to a Cache Server Charan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.