dhclient with multiple routing tables

Simon Hobson dhcp1 at thehobsons.co.uk
Tue May 21 17:47:34 UTC 2013


Fernando wrote:
> in both cases my network will be under two NATs, one from the routers and other 
>from the server itself.

You can fix that easily - don't do any NAT other than on the routers.
Say your router A NATs its public IP to 192.168.1.0/24, and router B NATs its public IP to 192.168.2.0/24. You give your machine an interface in both subnets, and ROUTE between those and your internal network on (say) 192.168.3.0/24. Note I said ROUTE - just route without any NAT and you eliminate the second NAT layer.
All it needs is to add a static route to each router so it knows to send packets for 192.168.3.0/24 via your server. You could possibly include the two "external" networks as well, but I doubt that's required - ie give router A a static route for 192.168.2.0/24 via your server, and router B a static route for 192.168.1.0/24 via your server.

That will eliminate the two layers of NAT, though if you want to configure stuff that the routers can't do then you may still have a reason for wanting to get rid of them.

Also, you might cnsider getting the DHCP client to do all the stuff that will keep the ISP happy, but statically config your server (assuming you have a static IP). Not sure whether that can be done by making the scripts "null scripts", or whether you'd need to hack the code to stop it altering network configs.


More information about the dhcp-users mailing list