All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simone Sestini <simone.sestini@eutelia.it>
To: netfilter@lists.netfilter.org
Subject: NAT Box
Date: Wed, 16 Jun 2004 15:07:04 +0200	[thread overview]
Message-ID: <40D045F8.9070101@eutelia.it> (raw)

Hi all..

I'm developing a nat box for some special Internet Value Added Services.
I have a lot of NAS boxes that receives calls and then the default 
router for all is the nat box.
The box has 2 ethernet interfaces, one public for internet acces and one 
over my intranet lan.
I have just done a lot of special configuration but right now i'm in 
front of a problem..
Normaly a /23 subnet is always natted with a public ip address.
Now.. i need to resolve a problem..

A special /23 need to browse only on some specific destination.. but if 
one client with the ip into the /23 try to
browse out of the range of the ip permitted i need to redirect the 
request automatically to 1 or more specific
ip address.


This is the example that is working correct without the automatically 
redirection.
The 10.30.14.0 /23 can browse some public ip addresses but if it try to 
go out of the range the REJECT rules
block the packet and the final client will not browse..

/usr/local/sbin/iptables -t nat -A POSTROUTING -s 10.30.14.0/23 -o eth0 
-j SNAT --to PUBLIC_IP_FOR_NAT

/usr/local/sbin/iptables -N PERSONAL_RULES
/usr/local/sbin/iptables -A PERSONAL_RULES -j ACCEPT -s 10.30.14.0/23 -d 
First_Public_IP
/usr/local/sbin/iptables -A PERSONAL_RULES -j ACCEPT -s 10.30.14.0/23 -d 
Second_Public_IP
/usr/local/sbin/iptables -A PERSONAL_RULES -j ACCEPT -s 10.30.14.0/23 -d 
Third_Public_IP
/usr/local/sbin/iptables -A PERSONAL_RULES -j ACCEPT -s 10.30.14.0/23 -d 
Other_Public_IP
/usr/local/sbin/iptables -A PERSONAL_RULES -j ACCEPT -s 10.30.14.0/23 -d 
Other_Public_IP
/usr/local/sbin/iptables -A PERSONAL_RULES -j REJECT -s 10.30.14.0/23 -d 0/0

/usr/local/sbin/iptables -A FORWARD -s 10.30.14.0/23 -p tcp --dport 80 
-j PERSONAL_RULES

Now i have to do something that permit me to add a new feature..
I have to remove the REJECT rules and have to find the way to redirect 
the request to a specific ip.. maybe with a DNAT ??

Any idea ? all is appreciated..

Best Regards.


             reply	other threads:[~2004-06-16 13:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-16 13:07 Simone Sestini [this message]
2004-06-16 14:14 ` NAT Box John A. Sullivan III

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=40D045F8.9070101@eutelia.it \
    --to=simone.sestini@eutelia.it \
    --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.