List Info

Thread: Per-client NAT routing -- possible?




Per-client NAT routing -- possible?
user name
2006-03-22 17:16:41
Hi,

I'm trying to set up a Linux box as a NATting router.  But
here's the
trick: my box's external interface is on a LAN that has a
whole bunch
of routers on it, any of which can be used to access the
Internet. 
I'm trying to figure out how to configure iptables so that
the NAT box
selects the router to use based on client IP address (i.e.,
the IP
address on the inside interface).

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.

Could someone please point me in the right direction?  Or is
this not possible?

Thanks!

--Jeremy

Per-client NAT routing -- possible?
user name
2006-03-27 06:37:54
On Wed, 2006-03-22 at 09:16 -0800, Jeremy Elson wrote:
> Hi,
> 
> I'm trying to set up a Linux box as a NATting router. 
But here's the
> trick: my box's external interface is on a LAN that
has a whole bunch
> of routers on it, any of which can be used to access
the Internet. 
> I'm trying to figure out how to configure iptables so
that the NAT box
> selects the router to use based on client IP address
(i.e., the IP
> address on the inside interface).


It sounds like you need policy routing (multiple routing
tables).

/Oskar

-- 
Oskar Berggren <beosgs.o.se>


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )