Linux – Automatically updating routing table on server

linuxrouting

I have a LAN with three routers on it, one connected to the Internet, one VPN router connected to a few remote sites, and a final route connected to a private network (using BGP to get prefix advertisements).

On the same LAN I have multiple Linux servers which needs access to the networks behind each router. I have achieved this by configuring static routes on the server, pointing the different network prefixes to the correct router.

This has worked well, but every time we connect to a new remote VPN, we have to change all the servers to be aware that the network is now accessible via the VPN, and not via the default Internet route.

What I want is a way to automatically update the routes on all of the servers, when the route is added to a routers.

Now, I could install Quagga or something similar on all the servers to receive router advertisements, but that seems like overkill. So my question is what is the easiest/simpliest way to update the routing tables on the server automatically, and what protocol is best suited for this purpose.

thanks

Best Answer

Configure a dynamic routing protocol on all of the routers and configure the servers (and any other hosts) to use the "main" router as their DG. The DG should then handle redirecting traffic to the appropriate router based on entries in the dynamic routing table.

It's not an extra hop in the sense that the traffic destined for one of the other networks won't be forwarded through the default gateway to that network. If I'm not mistaken, the default gateway should issue an ICMP redirect to the host, directing the host to the preferred gateway for the network in question. The only time the default gateway will forward traffic is when it doesn't have a route for the network in question (an external network), in which case it will forward it to it's default gateway.

My comment is based on the assumption that all of the routers have an interface connected to the same LAN subnet (as implied in your question).

Related Topic