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
The second router is

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

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


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:


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.