Score:1

Alma Linux -Static route configuration is not working as fall back mechanism, when default gateway is down

no flag

Currently I am using Alma-Linux, where I need to create 2 default gateways for the same NIC. Main intent of 2 default gateway configuration is.. when any one of the gateways is down then other one will work so that there will be no communication lost to remote host which is in different subnet altogether.

enter image description here

Gateway Configuration Below IPs are used for routing

  1. 11.12.13.1 ( As a default gateway)
  2. 11.12.13.2 (static route Next hop)

Both IPs are ping-able.

For testing fail over scenario, I disabled the NIC with IP 11.12.13.1 and performed the traceroute command on a random remote host which is in different subnet.

command : traceroute 17.18.19.2

but traceroute result is destination unreachable.

In this scenario, I assume packets will go through static route 11.12.13.2 ip as a fall back option. since configured gateway is down. It is not working as I expected.

Note: When I add exact IP 17.18.19.2 as destination/prefix address instead of Default(0.0.0.0) then Static route is working fine in this case.

Need some pointers to get this scenario work. Please correct me, incase my understanding is not correct.

enter image description here

Romeo Ninov avatar
in flag
What is the result of `netstat -rn`?
cpp_learner avatar
no flag
@RomeoNinov: Added route table for your reference. If I replace 0.0.0.0 with actual destination address 17.18.19.2 in the static route rules then "Destination Unreachable" message is going off.
Romeo Ninov avatar
in flag
Add text, no images. And show us the device via which is the second route. Is it the same as default or not.
cpp_learner avatar
no flag
0.0.0.0 via 11.12.13.2 is my second route. First route is "default via 11.12.13.1"
Romeo Ninov avatar
in flag
On which interface? I suppose you have two of them because otherwise the way you test it is meaningless.
cpp_learner avatar
no flag
I have ONLY one NIC interface (say 'eth0'). Trying to create 2 default routes(via default gateway and default static route) for SAME interface (eth0). Is this an invalid configuration? Same interface cannot support multiple default routes? I am new to networking stuff. Need your guidance to understand and test the 2nd gateway in case of first gateway failure occurs
Romeo Ninov avatar
in flag
The simplest test of fail-over is to down the gateway (interface with IP 11.12.13.1) and then check. If you down the interface on machine you want to implement the solution you loose entire network connectivity.
cpp_learner avatar
no flag
Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/147864/discussion-between-cpp-learner-and-romeo-ninov).
A.B avatar
cl flag
A.B
Note: 0.0.0.0/32 is a never matching *route* but not a default route (which would be 0.0.0.0/0 not /32) . OP's new question asking the same ( https://serverfault.com/questions/1141794/alma-linux-gateway-fall-back-is-not-working-when-gateway-ip-with-lower-metric ) doesn't show any command's output so this won't be detectable by reading it.
Score:0
no flag

With @A.B suggestion I was able to solve the issue by using proper destination IP. 0.0.0.0/0 semantics is equal to default but I used wrong subnet mask value. Thanks @A.B

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.