Cisco IOS-XE Postmortem: Fixing a 30-Hop PBR & VRF Hairpin Routing Loop

Incident Symptom: FCIX Peering Traffic Hairpinning Through Hurricane Electric

Incident Trigger: A peer reported that traffic entering via our FCIX (Fremont Cabal Internet Exchange) peering port toward our internal IP was inexplicably hairpinning out through our Hurricane Electric (AS 6939) port and back in via our transit interface, degrading latency and throughput. The customer included this traceroute:

#Greetings,

#I happened to do a traceroute to [ our destination IP ], and saw some rather odd behavior... Just thought you might want to look into why you're correctly advertising a prefix into FCIX, but your peering router seems to be hairpinning the traffic through Hurricane's port back to your transit port?

kenneth@shell:~$ traceroute [ our destination IP ]
traceroute to [ our destination IP ], 30 hops max, 60 byte packets
 1  [ Client GW ] 0.425 ms  0.455 ms  0.507 ms
 2  [ our IXP IP ]  0.140 ms  0.125 ms  0.151 ms
 3  AS6939.ixp.fcix.net (206.80.238.9)  0.268 ms  0.193 ms  0.193 ms
 4  [ our Transit IP ]  0.180 ms  0.183 ms  0.181 ms
 5  [ our Internal Port ]  0.787 ms  0.780 ms  0.787 ms
 6  [ our destination IP ]  0.220 ms  0.198 ms  0.183 ms

Root Cause Summary: This outage was a two-layer human configuration error: (1) an unintended Policy-Based Routing (PBR) route-map had been applied to the FCIX peering interface, overriding normal RIB/CEF lookups and steering traffic toward HE; and (2) removing the PBR exposed a missing connected /32 route inside VRF ixp-fcix, which held only a BGP aggregate pointing to Null0.

Troubleshooting Walkthrough: VRF RIB, 30-Hop MTR Loop & CEF

First, checking the ixp-fcix VRF routing table showed only a BGP aggregate /24 pointing to Null0 without an internal IGP or connected host route. While suspicious, a Null0 aggregate alone would drop packets rather than hairpinning them to HE—so we noted it and kept digging:

#show ip route vrf ixp-fcix [ our /32 ip ]

Routing Table: ixp-fcix
Routing entry for [ our subnet /24 ]
  Known via "bgp xxxxx", distance 20, metric 0 (connected), type external
  Routing Descriptor Blocks:
  * directly connected, via Null0
      Route metric is 0, traffic share count is 1
      AS Hops 0
      MPLS label: none

Running mtr from our FCIX test host (pve-fcix1) toward our router’s FCIX interface immediately reproduced a full 30-hop loop on as6939.ixp.fcix.net:

Terminal screenshot of MTR v0.92 from pve-fcix1 showing a 30-hop routing loop across as6939.ixp.fcix.net
Figure 1: MTR v0.92 capture from pve-fcix1 demonstrating the 30-hop forwarding loop at as6939.ixp.fcix.net.

Suspecting a forwarding-plane mismatch, we checked the Cisco CEF table for both our FCIX port IP and destination prefix (transcribed below from the original console captures):

#show ip cef vrf ixp-fcix [ our fcix port ip ]
[ our fcix port ip ]/32
  attached to TenGigabitEthernet1/1/0

(config)#do show ip cef vrf ixp-fcix [ our dst ip address ]
[ our dst subnet ]/24
  nexthop         TenGigabitEthernet0/2/0.100

Neither CEF entry explained why packets were going out toward AS 6939.

The Smoking Gun: Stale PBR Bypassing Both RIB & CEF

Whenever both the RIB and CEF look innocent yet forwarding still misbehaves, check the layer evaluated before standard FIB lookup: Policy-Based Routing (PBR). Sure enough, show ip policy revealed an active route-map on Te1/1/0:

#show ip policy
Interface      Route map
Te1/1/0    [ our routing policy ]

Inspecting that route-map confirmed it belonged to a customer policy forcing traffic toward Hurricane Electric, accidentally attached to the FCIX peering interface Te1/1/0. After verifying impact, we removed the PBR binding immediately.

Root-cause and resolution diagram showing stale PBR on Te1/1/0 hairpinning traffic to AS6939 and missing connected route in VRF ixp-fcix, followed by PBR removal and ip vrf receive ixp-fcix fix
Figure 2: Before-and-after packet flow showing how stale PBR bypassed RIB/CEF and how ip vrf receive ixp-fcix restored direct 1-hop delivery.

Layer 2 of the Outage: Importing the Connected Interface into VRF

Once the rogue PBR was removed, the 30-hop loop vanished—but pings immediately changed to Destination Host Unreachable, confirming the second bug we spotted earlier (the missing connected route inside ixp-fcix):

root@fcix1 ~ # ping [ our destination IP ]
PING [ our destination IP ] ([ our destination IP ]) 56(84) bytes of data.
From [ our destination IP ] icmp_seq=1 Destination Host Unreachable
From [ our destination IP ] icmp_seq=2 Destination Host Unreachable
From [ our destination IP ] icmp_seq=3 Destination Host Unreachable
From [ our destination IP ] icmp_seq=6 Destination Host Unreachable
^C
--- [ our destination IP ] ping statistics ---
7 packets transmitted, 0 received, +4 errors, 100% packet loss, time 123ms

Using ip vrf select source and ip vrf receive ixp-fcix on subinterface TenGigabitEthernet0/2/0.100 imported the directly connected interface route cleanly into the VRF, verified in both the VRF RIB and CEF table:

interface TenGigabitEthernet0/2/0.100
 encapsulation dot1Q 100
 ip vrf select source
 ip vrf receive ixp-fcix

#show ip route vrf ixp-fcix [ our destination IP ] 

Routing Table: ixp-fcix
Routing entry for [ our destination IP ]/32
  Known via "connected", distance 0, metric 0 (connected)
  Routing Descriptor Blocks:
  * directly connected, via TenGigabitEthernet0/2/0.100
      Route metric is 0, traffic share count is 1

#show ip cef vrf ixp-fcix [ our destination IP ]  
[ our destination IP ]/32
  receive for TenGigabitEthernet0/2/0.100

Final Verification & Lessons Learned

Re-running mtr and ping from fcix-test confirmed direct 1-hop reachability with 0% loss and 0.146 ms average RTT:

root@fcix-test ~ # mtr -4 [ our destination IP ] --report
Start: 2020-03-08T08:55:18-0700
HOST: fcix-test                   Loss%   Snt   Last   Avg  Best  Wrst StDev
  1.|-- [ our destination IP ]               0.0%    10    0.2   0.2   0.1   0.3   0.1

root@fcix-test ~ # ping -4 [ our destination IP ] -c 3
PING [ our destination IP ] ([ our destination IP ]) 56(84) bytes of data.
64 bytes from [ our destination IP ]: icmp_seq=1 ttl=255 time=0.124 ms
64 bytes from [ our destination IP ]: icmp_seq=2 ttl=255 time=0.160 ms
64 bytes from [ our destination IP ]: icmp_seq=3 ttl=255 time=0.155 ms

--- [ our destination IP ] ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 36ms
rtt min/avg/max/mdev = 0.124/0.146/0.160/0.018 ms

Operational Takeaways

  • Audit PBR strictly on edge interfaces: Never leave customer PBR policies on IXP or core peering interfaces—PBR preempts RIB/CEF and masks standard routing diagnostics;
  • Never rely solely on Null0 BGP aggregates inside a VRF: When importing prefixes across VRFs or filtering via prefix-lists, ensure underlying connected or specific IGP routes (or ip vrf receive) are present so traffic is never blackholed.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.