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.
Gateway Configuration Below IPs are used for routing
- 11.12.13.1 ( As a default gateway)
- 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.