Skip to contentSkip to conversation

iproute2 and kernel 2.2.x NAT

LARTC Nels Lindquist 1 participant 1 message Apr 12, 2005

lore
Share & tools
lore
#0 lore raw

Hi there.

I'm trying to implement NAT on a 2.2 kernel using iproute2 according to Appendix C of the IP Command Reference that comes with iproute2.

We're also moving to a multiple uplink configuration which complicates things a bit.

The kernel is 2.2.27-rc2, built with the various advanced routing options (except for large routing tables) turned on. It seems to be working with the multiple path stuff; I've created lookup tables for each external interface and the routing is working properly.

I've tried adding a NAT host with "ip route add nat [external ip] via [internal ip]" and "ip r sh table local" indicates that the command was accepted:

nat [external ip] via [internal ip] scope host

If I try and ping the NAT ip from the router, I get:

connect: Invalid argument

Not sure if that's expected behavour or not. The next part is tricky; with the multipath routing set up, I want packets from one particular internal server to only be NATted if they go out via one of the interfaces, but not NATted if they go out via the other.

The "ip rule" syntax allows for a source interface and ip address, but not a destination interface. Is there any way to set this up the way I want?

Am I barking up the wrong tree entirely?

----
Nels Lindquist <*>
Information Systems Manager
Morningstar Air Express Inc.

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc