Description

This Article describes why configuring overlapping of subnets in the same routing instance causes wrong route in the forwarding table and solution to overcome this issue .

Symptoms

The customer reported the wrong  route in the forwarding table entry as below example 
labroot@QFX1# show route forwarding-table destination 5.223.48.38
Enabled protocols: Bridging, 
Destination    Type RtRef Next hop          Type Index  NhRef Netif
5.223.48.38/32   dest   2 5.223.48.38       hold   2122   3 irb.606
5.223.48.38/32   dest   1 f4:bf:a8:14:64:a5 ucst   2119   2 xe-0/0/85.606

The above Forwarding table hold entry is seen because of the overlapping of subnets across multiple ifls in the same routing instance.

The below example demonstrates the issue:
 
Topology used: QFX1 Device (xe-0/0/85:606)----------- (xe-0/0/21:606 )QFX2 Device

In the example below, we can see Both the Physical and IRB interfaces are configured with the same subnet range for QFX 1.
 
labroot@QFX1> show configuration interfaces irb.606 
family inet {

address 5.223.48.5/20 {
vrrp-group 60 {
 virtual-address 5.223.48.1;
preempt;
accept-data;
 }
 }
 
labroot@QFX1> show configuration interfaces xe-0/0/85.606 
vlan-id 606;

family inet {
 address 5.223.48.39/31;
}
 
labroot@QFX2> show configuration interfaces xe-0/0/21.606 
vlan-id 606;
family inet {
address 5.223.48.38/31
}

 
labroot@QFX2> show configuration interfaces irb.606 
unit 606 {
 family inet {
address 5.223.0.3/20 {
vrrp-group 60 {
virtual-address 5.223.0.1;
preempt;
accept-data;
  }
 }
  • Here 5.223.48.39/31 is supernet of  5.223.48.5/20 hence overlapping is seen in the above examples. By design, Subnets should not overlap .​​​​​​
  • Due to the above overlapping of subnet configuration, though the routing table has a single next-hop, the forwarding table has two entries and one of them [here irb.606] is stuck in a hold state which should not happen.
  • The hold state of a route in the forwarding table indicates the next hop is being resolved, so it is an intermediate state but here the entry is stuck with the hold state because of the overlapping subnet. This is making the directly connected IP address not reachable.


Routing table output:
 
labroot@QFX1#  show route 5.223.48.38           
inet.0: 6 destinations, 9 routes (6 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
5.223.48.38/31   *[Direct/0] 00:00:06
> via xe-0/0/85.606      >>>>>>>>>>>>>entry exists 

Forwarding table output:
 
labroot@QFX1# show route forwarding-table destination 5.223.48.38 
Enabled protocols: Bridging, 
Destination    Type RtRef Next hop      Type Index  NhRef  Netif
5.223.48.38 /32   dest   2 5.223.48.38    hold   2122   3  irb.606
5.223.48.38 /32   dest   1 f4:bf:a8:14:64:a5 ucst   2119   2 xe-0/0/85.606

Also During the lab testing after reboot, we saw the issue was resolved because the /31 gets installed before the /20 (due to the timing of the xe- port coming up).

Outputs collected from the lab after reboot :
 
labroot@QFX1#  show route 5.223.48.38           
inet.0: 6 destinations, 9 routes (6 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
5.223.48.38/31   *[Direct/0] 00:00:06
 > via xe-0/0/85.606 


labroot@QFX1# show route forwarding-table destination 5.223.48.38 
Enabled protocols: Bridging, 
Destination    Type RtRef Next hop      Type Index  NhRef Netif
5.223.48.38 /32   dest   1 f4:bf:a8:14:64:a5 ucst   2119   2 xe-0/0/85.606
  • Traffic will hit this direct next hop and trigger ARP over the /31 segment.​​​​​​
  • If the interface flaps and the /31 next-hop is reinstalled, it will be placed below the /20.
  • The lookup will hit the /20 subnet and trigger ARP over that VLAN, which doesn’t get resolved because the IP lives in a different segment. No further processing is done because the destination IP falls within a directly connected subnet.
  • The software can’t check for overlapping subnets. Comparing each IP against the others configured in all interfaces would be an exponential task and the commit times would increase too much

Solution

  • By design, subnets should not overlap. That is, the range of addresses in one subnet should be unique compared to all other subnets.
  • In real networks, if two subnets overlap, when a router needs to send a packet to an IP address inside that range of overlapped addresses, the router may forward the packet to the wrong subnet.
  • Avoiding overlapping subnets falls under general network designing guidelines and also network admin needs to take care that IPs don’t overlap.

For example, we can use different subnets as below to overcome the subnet issue:

labroot@QFX2> show configuration interfaces xe-0/0/21.606 

vlan-id 606;
 family inet {
 address 5.223.48.38/31 <<<<<

}

labroot@QFX2> show configuration interfaces irb.606 
unit 606 {
  family inet {
address 5.223.0.3/20 {
 vrrp-group 60 {
virtual-address 5.223.0.1 <<<<<<<
preempt;
accept-data;
 }

 

    

Modification History

Initial version: 10-May-2023