I have a ROS that connected to 4 routers that advertise dgw via OSPF, my route table looks something like[admin@ybortr1] > /ip route pr # DST-ADDRESS PREF-SRC GATEWAY DISTANCE
0 ADo 0.0.0.0/0 10.31.17.3 110
10.31.18.3
10.31.18.2
10.31.17.2
Which gateway is ROS going to use ?? is it round robin or . I always thought it was lowest ip address, but I have been doing some tests and its not ..
You can, instead, have multiple route entries covering the same destination prefix, in which case only one route at a time can be “active”. The active route is chosen first based on the distance metric, and if there is a tie with distance, then the manual states that route selection is undefined/arbitrary, and not based on the “lowest” gateway IP number:
With ECMP routes, my understanding is that in Linux, selection of gateway for any given flow or session is based on a hash of the source and destination IPs in the packets, not a round-robin algorithm. So traffic from one particular IP address to one particular IP address should tend to have an affinity for a particular gateway.