It *should* work. A standards-compliant router does longest-prefix match: if it has a static route to 84.18.228.42/32 and a connected route to 84.18.228.0/22, the former will be followed when the destination address of a datagram is .42
It will then see the next-hop of .1, which it can resolve via the connected route.
I just realised what you're saying. Networks don't work like this, sorry. Directly connected routes are not treated in the same manner as unconnected ones. On basic kit metrics or whatever they call it are a thing with directly connected always taking precedence, on more complex equipment admin distances. These end up in the RIB as route preference. Prefix length is further down the decision tree to differentiate routes with the same route preference. I'm not aware of any equipment or OS that assigns the same preference to directly connected as static. Cisco, Juniper, Fortinet, PAN, Aruba, Checkpoint, Linux, BSD, Windows all prefer connected over static, prefix length comparison never done as doesn't matter.
I have no idea why I wrote this. It's nonsense and I need to not post while, yeah never mind. You get the idea given the time of day. *Sigh* LPM wins, admin distance is later in the tree and I'm going to go hide somewhere.to rethink my life choices. The reason it may not work like that here is the behaviour of the switch chip in the router being used for hardware forwarding and how it's been programmed. I need to go relearn the basics it seems and perhaps see a doctor. This is incredibly fundamental stuff. Sorry OP/candlerb.
Edited by XGS_Is_On (Sun 19-Jul-26 17:09:58)



Pages in this thread:
Print Thread
