All of lore.kernel.org
 help / color / mirror / Atom feed
From: Askar <askarali@gmail.com>
To: netfilter <netfilter@lists.netfilter.org>
Subject: multiple SNAT
Date: Wed, 4 May 2005 12:23:42 +0500	[thread overview]
Message-ID: <a0f69e5050504002326a08e85@mail.gmail.com> (raw)

hi,
we have a netfilter iptables base gateway (NATing), doing SNAT.

interfaces

eth0: public ip + single alias for RFC 1918 (192.168.1.x)
eth1: 192.168.50.3 (pvt) 

Our web,mail server also have  192.168.50.x subnet ips

Now I want to SNAT the traffic to companies web server and mail via
eth1 and the rest (Internet) via eth0.
we are also MARKing port 80 traffic to send for our cache /proxy server.

Portion from the iptables ruleset.

#echo 200 cache.out >> /etc/iproute2/rt_tables
#ip rule add fwmark 1 table cache.out
#ip route add default via xxx.xxx.xxx.xx dev eth0 table cache.out
#ip route flush cache
############Ip Tables Mangle For Above Rule####################
# Mark all port 80
iptables -A PREROUTING -i eth0 -t mangle -p tcp --dport 80 -j MARK --set-mark 1

# re mark port 80 towards company web server that by passing cache/server
iptables -A PREROUTING -i eth0 -t mangle -p tcp -d xxx.xxx.xxx.xx -j
MARK --set-mark 2

# marking mail traffic to company mail server
iptables -A PREROUTING -i eth0 -t mangle -p tcp -d xxx.xxx.xxx.xx -j
MARK --set-mark 2
#


Regards

Askar Ali

-- 
I love deadlines. I like the whooshing sound they make as they fly by.
Douglas Adams


             reply	other threads:[~2005-05-04  7:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-04  7:23 Askar [this message]
2005-05-04  7:33 ` multiple SNAT Ing. Rogelio Sevilla Fernandez
  -- strict thread matches above, loose matches on Subject: below --
2002-08-20 20:56 (no subject) saki
2002-09-09 12:06 ` Multiple SNAT Antony Stone

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=a0f69e5050504002326a08e85@mail.gmail.com \
    --to=askarali@gmail.com \
    --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.