Options

Question about overlapping routes

gnguyen2gnguyen2 Member Posts: 10 ■□□□□□□□□□
Hello,

I'm currently studying for my CCENT and am confused on the overlapping concept. I'm using the Wendell Odom book and it states for a route with a IP address within two IP ranges then it will use the route with the longer prefix. However, my question is then how does the packet get routed to the correct host if the host resides in the route with the shorter prefix?

Ex.

Router 1 is connected to two separate Routers (R2 and R3). The subnets and IP address ranges for R2 and R3 are:

R2: 172.16.0.0/16 [172.16.0.0 - 172.16.255.255]
R3: 172.16.0.0/22 [172.16.0.0 - 172.16.3.255]

If the host has a IP address 172.16.2.8 /16 then how does it get the packet if R1 forwards any packet destined for 172.16.2.8 to the longer prefix, which in this case is R3 (/22).

Please let me know if my question makes any sense and I greatly appreciate any feedback.

Thanks,

G. Nguyen

Comments

  • Options
    rob42rob42 Member Posts: 423
    Quote...

    "When subnets in different locations overlap there addresses, a router's routing table entries overlap. As a result, hosts in different locations can be assigned the same IP address. Router's clearly cannot route packets correctly in these cases. In short, a design that uses overlapping subnets is considered to be an incorrect design and should not be used."
    – Page 566: ICND1 100-101



    172.16.0.0/16


    IP Address
    172
    16
    0
    0


    Subnet Mask
    255
    255
    0
    0


    Subnet IP
    172
    16
    0
    0


    First Usable IP
    172
    16
    0
    1


    Last Usable IP
    172
    16
    255
    254


    Broadcast IP
    172
    16
    255
    255





    172.16.0.0/22


    IP Address
    172
    16
    0
    0


    Subnet Mask
    255
    255
    252
    0


    Subnet IP
    172
    16
    0
    0


    First Usable IP
    172
    16
    0
    1


    Last Usable IP
    172
    16
    3
    254


    Broadcast IP
    172
    16
    3
    255



    Clearly, you have an overlap with 172.16.2.8 and as such the packet can't be routed correctly.
    No longer an active member
  • Options
    rolando3321rolando3321 Member Posts: 36 ■■□□□□□□□□
    I say this with using STATIC ROUTES only being used. Routers will use the most specific path to route. So when you have a router with a connected route/32 it will forward the packet out of it's own interface because it is the most specific.

    Now lets say that you tell Router1 - 2 different routes to a 10.100.10.0/24 network
    ip route 10.100.10.0 255.255.255.0 fastethernet0/1
    ip route 10.100.0.0 255.255.0.0 fastethernet0/2

    The router would select the most specific route (in this case the 10.100.10.0/24 - over the 10.100.0.0/16)
    The routes do overlap and could cause an issue, but it would depend on the layout of the network.

    This is also why a gateway of last resort that is 0.0.0.0 0.0.0.0 is used as the last route. It is the LEAST specific.

    Once you start getting into routing protocols (OSPF, EIGRP, RIP, ect) some different factors come into play. Administrative Distance (AD)
  • Options
    hurricane1091hurricane1091 Member Posts: 919 ■■■■□□□□□□
    I hope I can explain this correctly and in a way easily understood lol.

    You should only have a subnet exist in one spot, unless you have a situation like multiple Layer 3 switches running HSRP on their SVIs. Both would advertise the same subnet to neighbors, which ends up being fine because if SW1 receives traffic but SW2 is ACTIVE for that VLAN, it will reach SW2 over a trunk. If you had two branch offices though, you would not have the same subnet exist in each as it would not route properly. That kind of stuff can happen though if you acquire a company. You would have to do some trickery like NAT in that case.

    As kind of mentioned, there are scenarios where a summary address may exist, but not used because a more specific route exist. An example would be if you are using BGP, and advertising a summary address (say 192.168.1.0/24), and more specific subnets exist behind that (192.168.1.0/27, 192.168.1.32/28, 192.168.1.48/28 for example) and you are advertising that summary, plus the more specific routes. Now, we are doing "summary-only", so that does not occur in our situation, but if we omitted that line, a receiving router would have those 3 specific routes + the summary, and those overlap and it is okay because they end up taking you to the same place.

    If you did something on your router, like give one interface 192.168.1.1/24, and then try to give another interface 192.168.1.33/27, you'll find that it will not be accepted by the router and some sort of warning message will be shown.
  • Options
    rolando3321rolando3321 Member Posts: 36 ■■□□□□□□□□
    Router 1 is connected to two separate Routers (R2 and R3). The subnets and IP address ranges for R2 and R3 are:

    R2: 172.16.0.0/16 [172.16.0.0 - 172.16.255.255]
    R3: 172.16.0.0/22 [172.16.0.0 - 172.16.3.255]

    If you did have a network with this setup; R1 would route packets in the 172.16.0.0 - 172.16.3.255 range to R3. R2 would not receive packets in this IP range because they would be routed to R3 that has a more specific matching route. If the link between R1 and R3 went down; then R2 would receive the packets in that range.

    Again, you would want to avoid the overlap and create subnets or change your networks to avoid this.
Sign In or Register to comment.