All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Charan" <charanbeer.s@net4india.net>
To: netfilter@lists.netfilter.org
Subject: Forward to a Cache Server
Date: Sat, 23 Aug 2003 19:53:51 +0530	[thread overview]
Message-ID: <093601c36982$2cd753c0$f58047ca@Charanbeer> (raw)

[-- 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 --]

                 reply	other threads:[~2003-08-23 14:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='093601c36982$2cd753c0$f58047ca@Charanbeer' \
    --to=charanbeer.s@net4india.net \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.