Skip to main content
added 334 characters in body
Source Link
Zac67
  • 88.1k
  • 4
  • 73
  • 137

if it receives a packet with destination IP address of 192.168.22.1 according to Longest Prefix Matching, it will choose the routing entry with subnet /25 and forward the packet

Yes, that's how it works.

what if the Destination Network doesn't have the intended IP Address according to my Schema

Then your network design is flawed.

Sometimes, overlapping prefixes are OK - but they might not be. It all depends on your overall design.

Having different gateways for 192.168.22.0/23 and 192.168.22.0/25 means that you want packets for 192.168.22.0/25 go one way and all other packets from 192.168.22.0/23 go the other way. Effectively, 192.168.22.128/23 works here as a summary route for 192.168.22.128/25, 192.168.23.0/25, and 192.168.23.128/25 - if you're using all of them with /25 subnets.

Note that you cannot have any IP address from 192.168.22.0/25 behind the 'other way' router. You do need to keep your addressing unambiguous and cannot have overlapping subnets, whatever you do.

A scenario where that routing might make sense is a branch router that attaches 192.168.22.0/23 to a larger network. It's got an uplink (possibly towards 192.168.0.0/16) and a directly attached subnet 192.168.22.0/25. Within that subnet is a layer-3 switch that routes between the other local subnets from 192.168.22.0/23.

Overlapping prefixes may be counter-intuitive, so you might want to avoid them altogether. After all, somewhat modern devices usually don't mind a few more or less routing entries, and being transparent and avoiding human error may be much more important.

if it receives a packet with destination IP address of 192.168.22.1 according to Longest Prefix Matching, it will choose the routing entry with subnet /25 and forward the packet

Yes, that's how it works.

what if the Destination Network doesn't have the intended IP Address according to my Schema

Then your network design is flawed.

Sometimes, overlapping prefixes are OK - but they might not be. It all depends on your overall design.

Having different gateways for 192.168.22.0/23 and 192.168.22.0/25 means that you want packets for 192.168.22.0/25 go one way and all other packets from 192.168.22.0/23 go the other way. Effectively, 192.168.22.128/23 works here as a summary route for 192.168.22.128/25, 192.168.23.0/25, and 192.168.23.128/25 - if you're using all of them with /25 subnets.

Note that you cannot have any IP address from 192.168.22.0/25 behind the 'other way' router. You do need to keep your addressing unambiguous and cannot have overlapping subnets, whatever you do.

Overlapping prefixes may be counter-intuitive, so you might want to avoid them altogether. After all, somewhat modern devices usually don't mind a few more or less routing entries, and being transparent and avoiding human error may be much more important.

if it receives a packet with destination IP address of 192.168.22.1 according to Longest Prefix Matching, it will choose the routing entry with subnet /25 and forward the packet

Yes, that's how it works.

what if the Destination Network doesn't have the intended IP Address according to my Schema

Then your network design is flawed.

Sometimes, overlapping prefixes are OK - but they might not be. It all depends on your overall design.

Having different gateways for 192.168.22.0/23 and 192.168.22.0/25 means that you want packets for 192.168.22.0/25 go one way and all other packets from 192.168.22.0/23 go the other way. Effectively, 192.168.22.128/23 works here as a summary route for 192.168.22.128/25, 192.168.23.0/25, and 192.168.23.128/25 - if you're using all of them with /25 subnets.

Note that you cannot have any IP address from 192.168.22.0/25 behind the 'other way' router. You do need to keep your addressing unambiguous and cannot have overlapping subnets, whatever you do.

A scenario where that routing might make sense is a branch router that attaches 192.168.22.0/23 to a larger network. It's got an uplink (possibly towards 192.168.0.0/16) and a directly attached subnet 192.168.22.0/25. Within that subnet is a layer-3 switch that routes between the other local subnets from 192.168.22.0/23.

Overlapping prefixes may be counter-intuitive, so you might want to avoid them altogether. After all, somewhat modern devices usually don't mind a few more or less routing entries, and being transparent and avoiding human error may be much more important.

Source Link
Zac67
  • 88.1k
  • 4
  • 73
  • 137

if it receives a packet with destination IP address of 192.168.22.1 according to Longest Prefix Matching, it will choose the routing entry with subnet /25 and forward the packet

Yes, that's how it works.

what if the Destination Network doesn't have the intended IP Address according to my Schema

Then your network design is flawed.

Sometimes, overlapping prefixes are OK - but they might not be. It all depends on your overall design.

Having different gateways for 192.168.22.0/23 and 192.168.22.0/25 means that you want packets for 192.168.22.0/25 go one way and all other packets from 192.168.22.0/23 go the other way. Effectively, 192.168.22.128/23 works here as a summary route for 192.168.22.128/25, 192.168.23.0/25, and 192.168.23.128/25 - if you're using all of them with /25 subnets.

Note that you cannot have any IP address from 192.168.22.0/25 behind the 'other way' router. You do need to keep your addressing unambiguous and cannot have overlapping subnets, whatever you do.

Overlapping prefixes may be counter-intuitive, so you might want to avoid them altogether. After all, somewhat modern devices usually don't mind a few more or less routing entries, and being transparent and avoiding human error may be much more important.