Does the order of entries in the routing table matter?
The order in the table doesn't matter; routes with a longer prefix always take priority. If you stop clinging to netmasks and consider the prefix lengths instead (which ip route
shows), you have 123.x.x.128/27
and 123.x.x.151/32
, and the latter – more specific – route will take priority over the former (more generic one).
Order only matters if you have duplicate routes. Don't do that.
For example, if two interfaces have the same destination, netmask, and gateway of 0.0.0.0, the first one will grab all the traffic for that network.
What's more, I've found some systems will randomly reorder on boot which one comes first. If only one works, or only one has a router gateway set, this can result in losing access to that network on reboot.