From: Menno Smits <menno@netboxblue.com>
Cc: Netfilter Mailing list <netfilter@lists.netfilter.org>
Subject: Re: Per-client routing, plus masquerading -- possible?
Date: Thu, 23 Mar 2006 17:35:19 +1000 [thread overview]
Message-ID: <44224FB7.3020502@netboxblue.com> (raw)
In-Reply-To: <51e5f6120603221910j3a7d3827oddb2b3bdcacaa818@mail.gmail.com>
Jeremy Elson wrote:
> I've been tinkering with a command like this:
>
> iptables -t nat -A POSTROUTING -i $INTERNAL_CLIENT_IP -o
> external-iface0 -j SNAT --to $EXTERNAL_ROUTER_IP
>
> ...but it seems that --to controls the new source address given to the
> packet (i.e., the router's outside-interface IP), and not the
> destination to which the NATted packet is sent.
This is correct. SNAT is not about routing packets; it's for changing
the source address of a packet.
> Could someone please point me in the right direction? Or is this not possible?
What you want to do is possible but you'll need to employ source policy
routing using the "ip" command. This isn't part of the netfilter
project. In simple terms, you need to set up routes for each client
IP/network and gateway you want to use.
The Linux Advanced Routing & Traffic Control HOWTO covers source policy
routing among other things. The routing policy database section should
get you on right track: http://lartc.org/howto/lartc.rpdb.html
HTH,
Menno
Scanned by the NetBox from NetBox Blue
(http://netboxblue.com/)
next prev parent reply other threads:[~2006-03-23 7:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-23 3:10 Per-client routing, plus masquerading -- possible? Jeremy Elson
2006-03-23 7:35 ` Menno Smits [this message]
2006-03-23 9:35 ` Jeremy Elson
2006-03-23 12:23 ` Sven Schuster
2006-03-27 6:13 ` Menno Smits
2006-03-23 13:46 ` Steven M Campbell
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=44224FB7.3020502@netboxblue.com \
--to=menno@netboxblue.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.