0

I have several servers and 2 different routers with different internet connectivity and I want the servers to have the ability to access the internet if the main gateway goes down.

For example the main router is 192.168.10.254
The second router is 192.168.10.1

The routers are located in 2 different sites (Production and DR) and I want to make sure that the servers can access the internet if the main router will be unavailable for some reason.

What should I do on the servers? 2 default gateways? Add a second static route? How will the OS know that the main gateway is down?

  • 1
    What is the OS? – e2-e4 Aug 25 '20 at 14:15
2

In this scenario one solution would be to add two default routes and add a metric. If you want your Client/Server to prefer your main gateway you will have to specify a lower metric on this default route than on the default route via the secondary router. The OS can decide with the metric which default route to prefer.

Below for example on Ubuntu:

shell# ip route

default via [ip-primaryrouter] dev enps0 metric 200

default via [ip-secondaryrouter] dev enps1 metric 400

In Windows you can lookup the routes with metric with

cmd:> ROUTE PRINT

Of course you need to make sure that your servers are physically connected to all routers and can connect to them.

Check below resources for configuration in Windows:

https://www.aoddy.com/2007/11/10/how-to-change-default-gateway-on-windows-by-command-line/

What you also might looking at, is a fetaure called "Dead Gateway Detection": https://docs.microsoft.com/en-us/previous-versions/aa454008(v=msdn.10)?redirectedfrom=MSDN

Not the answer you're looking for? Browse other questions tagged or ask your own question.