Commit fedcf1eaa1 for frr

commit fedcf1eaa1789d93222da255d77835c9cf80c390
Author: Carmine Scarpitta <cscarpit@cisco.com>
Date:   Sun Jun 28 11:02:06 2026 +0200

    tests: Add SRv6 L3 EVPN RT-5 topotest

    Add a topology with two PEs, two VRFs, and attached CEs. Verify IPv4 and
    IPv6 VPN RIBs, EVPN Type-5 routes, VRF route installation with SRv6
    forwarding, and CE reachability within the correct VRF.

    Also verify that removing and restoring the SRv6 locator withdraws and
    re-advertises the affected Type-5 routes.

    Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>

diff --git a/tests/topotests/bgp_srv6_evpn_rt5/ce1/frr.conf b/tests/topotests/bgp_srv6_evpn_rt5/ce1/frr.conf
new file mode 100644
index 0000000000..14a48fbf79
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/ce1/frr.conf
@@ -0,0 +1,14 @@
+frr defaults traditional
+!
+interface eth0
+ ip address 192.168.1.2/24
+ ipv6 address 2001:db8:101::2/64
+!
+ip forwarding
+ipv6 forwarding
+!
+ip route 0.0.0.0/0 192.168.1.1
+ipv6 route ::/0 2001:db8:101::1
+!
+line vty
+!
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/ce1/ip_rib.json b/tests/topotests/bgp_srv6_evpn_rt5/ce1/ip_rib.json
new file mode 100644
index 0000000000..7989ee320c
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/ce1/ip_rib.json
@@ -0,0 +1,58 @@
+{
+	"0.0.0.0/0": [
+		{
+			"prefix": "0.0.0.0/0",
+			"protocol": "static",
+			"vrfId": 0,
+			"vrfName": "default",
+			"selected": true,
+			"destSelected": true,
+			"distance": 1,
+			"metric": 0,
+			"installed": true,
+			"table": 254,
+			"internalStatus": 16,
+			"internalFlags": 73,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"ip": "192.168.1.1",
+					"afi": "ipv4",
+					"interfaceName": "eth0",
+					"active": true,
+					"weight": 1
+				}
+			]
+		}
+	],
+	"192.168.1.0/24": [
+		{
+			"prefix": "192.168.1.0/24",
+			"protocol": "connected",
+			"vrfId": 0,
+			"vrfName": "default",
+			"selected": true,
+			"destSelected": true,
+			"distance": 0,
+			"metric": 0,
+			"installed": true,
+			"table": 254,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"directlyConnected": true,
+					"interfaceName": "eth0",
+					"active": true
+				}
+			]
+		}
+	]
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/ce1/ipv6_rib.json b/tests/topotests/bgp_srv6_evpn_rt5/ce1/ipv6_rib.json
new file mode 100644
index 0000000000..1eeef14a1e
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/ce1/ipv6_rib.json
@@ -0,0 +1,58 @@
+{
+	"::/0": [
+		{
+			"prefix": "::/0",
+			"protocol": "static",
+			"vrfId": 0,
+			"vrfName": "default",
+			"selected": true,
+			"destSelected": true,
+			"distance": 1,
+			"metric": 0,
+			"installed": true,
+			"table": 254,
+			"internalStatus": 16,
+			"internalFlags": 73,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"ip": "2001:db8:101::1",
+					"afi": "ipv6",
+					"interfaceName": "eth0",
+					"active": true,
+					"weight": 1
+				}
+			]
+		}
+	],
+	"2001:db8:101::/64": [
+		{
+			"prefix": "2001:db8:101::/64",
+			"protocol": "connected",
+			"vrfId": 0,
+			"vrfName": "default",
+			"selected": true,
+			"destSelected": true,
+			"distance": 0,
+			"metric": 0,
+			"installed": true,
+			"table": 254,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"directlyConnected": true,
+					"interfaceName": "eth0",
+					"active": true
+				}
+			]
+		}
+	]
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/ce2/frr.conf b/tests/topotests/bgp_srv6_evpn_rt5/ce2/frr.conf
new file mode 100644
index 0000000000..c6f1c7be49
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/ce2/frr.conf
@@ -0,0 +1,14 @@
+frr defaults traditional
+!
+interface eth0
+ ip address 192.168.2.2/24
+ ipv6 address 2001:db8:102::2/64
+!
+ip forwarding
+ipv6 forwarding
+!
+ip route 0.0.0.0/0 192.168.2.1
+ipv6 route ::/0 2001:db8:102::1
+!
+line vty
+!
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/ce2/ip_rib.json b/tests/topotests/bgp_srv6_evpn_rt5/ce2/ip_rib.json
new file mode 100644
index 0000000000..e6de47d9eb
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/ce2/ip_rib.json
@@ -0,0 +1,58 @@
+{
+	"0.0.0.0/0": [
+		{
+			"prefix": "0.0.0.0/0",
+			"protocol": "static",
+			"vrfId": 0,
+			"vrfName": "default",
+			"selected": true,
+			"destSelected": true,
+			"distance": 1,
+			"metric": 0,
+			"installed": true,
+			"table": 254,
+			"internalStatus": 16,
+			"internalFlags": 73,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"ip": "192.168.2.1",
+					"afi": "ipv4",
+					"interfaceName": "eth0",
+					"active": true,
+					"weight": 1
+				}
+			]
+		}
+	],
+	"192.168.2.0/24": [
+		{
+			"prefix": "192.168.2.0/24",
+			"protocol": "connected",
+			"vrfId": 0,
+			"vrfName": "default",
+			"selected": true,
+			"destSelected": true,
+			"distance": 0,
+			"metric": 0,
+			"installed": true,
+			"table": 254,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"directlyConnected": true,
+					"interfaceName": "eth0",
+					"active": true
+				}
+			]
+		}
+	]
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/ce2/ipv6_rib.json b/tests/topotests/bgp_srv6_evpn_rt5/ce2/ipv6_rib.json
new file mode 100644
index 0000000000..57ff4855ab
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/ce2/ipv6_rib.json
@@ -0,0 +1,58 @@
+{
+	"::/0": [
+		{
+			"prefix": "::/0",
+			"protocol": "static",
+			"vrfId": 0,
+			"vrfName": "default",
+			"selected": true,
+			"destSelected": true,
+			"distance": 1,
+			"metric": 0,
+			"installed": true,
+			"table": 254,
+			"internalStatus": 16,
+			"internalFlags": 73,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"ip": "2001:db8:102::1",
+					"afi": "ipv6",
+					"interfaceName": "eth0",
+					"active": true,
+					"weight": 1
+				}
+			]
+		}
+	],
+	"2001:db8:102::/64": [
+		{
+			"prefix": "2001:db8:102::/64",
+			"protocol": "connected",
+			"vrfId": 0,
+			"vrfName": "default",
+			"selected": true,
+			"destSelected": true,
+			"distance": 0,
+			"metric": 0,
+			"installed": true,
+			"table": 254,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"directlyConnected": true,
+					"interfaceName": "eth0",
+					"active": true
+				}
+			]
+		}
+	]
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/ce3/frr.conf b/tests/topotests/bgp_srv6_evpn_rt5/ce3/frr.conf
new file mode 100644
index 0000000000..0ffabf944c
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/ce3/frr.conf
@@ -0,0 +1,14 @@
+frr defaults traditional
+!
+interface eth0
+ ip address 192.168.3.2/24
+ ipv6 address 2001:db8:103::2/64
+!
+ip forwarding
+ipv6 forwarding
+!
+ip route 0.0.0.0/0 192.168.3.1
+ipv6 route ::/0 2001:db8:103::1
+!
+line vty
+!
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/ce3/ip_rib.json b/tests/topotests/bgp_srv6_evpn_rt5/ce3/ip_rib.json
new file mode 100644
index 0000000000..358bcac4e5
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/ce3/ip_rib.json
@@ -0,0 +1,58 @@
+{
+	"0.0.0.0/0": [
+		{
+			"prefix": "0.0.0.0/0",
+			"protocol": "static",
+			"vrfId": 0,
+			"vrfName": "default",
+			"selected": true,
+			"destSelected": true,
+			"distance": 1,
+			"metric": 0,
+			"installed": true,
+			"table": 254,
+			"internalStatus": 16,
+			"internalFlags": 73,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"ip": "192.168.3.1",
+					"afi": "ipv4",
+					"interfaceName": "eth0",
+					"active": true,
+					"weight": 1
+				}
+			]
+		}
+	],
+	"192.168.3.0/24": [
+		{
+			"prefix": "192.168.3.0/24",
+			"protocol": "connected",
+			"vrfId": 0,
+			"vrfName": "default",
+			"selected": true,
+			"destSelected": true,
+			"distance": 0,
+			"metric": 0,
+			"installed": true,
+			"table": 254,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"directlyConnected": true,
+					"interfaceName": "eth0",
+					"active": true
+				}
+			]
+		}
+	]
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/ce3/ipv6_rib.json b/tests/topotests/bgp_srv6_evpn_rt5/ce3/ipv6_rib.json
new file mode 100644
index 0000000000..b617dde093
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/ce3/ipv6_rib.json
@@ -0,0 +1,58 @@
+{
+	"::/0": [
+		{
+			"prefix": "::/0",
+			"protocol": "static",
+			"vrfId": 0,
+			"vrfName": "default",
+			"selected": true,
+			"destSelected": true,
+			"distance": 1,
+			"metric": 0,
+			"installed": true,
+			"table": 254,
+			"internalStatus": 16,
+			"internalFlags": 73,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"ip": "2001:db8:103::1",
+					"afi": "ipv6",
+					"interfaceName": "eth0",
+					"active": true,
+					"weight": 1
+				}
+			]
+		}
+	],
+	"2001:db8:103::/64": [
+		{
+			"prefix": "2001:db8:103::/64",
+			"protocol": "connected",
+			"vrfId": 0,
+			"vrfName": "default",
+			"selected": true,
+			"destSelected": true,
+			"distance": 0,
+			"metric": 0,
+			"installed": true,
+			"table": 254,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"directlyConnected": true,
+					"interfaceName": "eth0",
+					"active": true
+				}
+			]
+		}
+	]
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/ce4/frr.conf b/tests/topotests/bgp_srv6_evpn_rt5/ce4/frr.conf
new file mode 100644
index 0000000000..1bab1c139c
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/ce4/frr.conf
@@ -0,0 +1,14 @@
+frr defaults traditional
+!
+interface eth0
+ ip address 192.168.4.2/24
+ ipv6 address 2001:db8:104::2/64
+!
+ip forwarding
+ipv6 forwarding
+!
+ip route 0.0.0.0/0 192.168.4.1
+ipv6 route ::/0 2001:db8:104::1
+!
+line vty
+!
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/ce4/ip_rib.json b/tests/topotests/bgp_srv6_evpn_rt5/ce4/ip_rib.json
new file mode 100644
index 0000000000..964ee5acf2
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/ce4/ip_rib.json
@@ -0,0 +1,58 @@
+{
+	"0.0.0.0/0": [
+		{
+			"prefix": "0.0.0.0/0",
+			"protocol": "static",
+			"vrfId": 0,
+			"vrfName": "default",
+			"selected": true,
+			"destSelected": true,
+			"distance": 1,
+			"metric": 0,
+			"installed": true,
+			"table": 254,
+			"internalStatus": 16,
+			"internalFlags": 73,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"ip": "192.168.4.1",
+					"afi": "ipv4",
+					"interfaceName": "eth0",
+					"active": true,
+					"weight": 1
+				}
+			]
+		}
+	],
+	"192.168.4.0/24": [
+		{
+			"prefix": "192.168.4.0/24",
+			"protocol": "connected",
+			"vrfId": 0,
+			"vrfName": "default",
+			"selected": true,
+			"destSelected": true,
+			"distance": 0,
+			"metric": 0,
+			"installed": true,
+			"table": 254,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"directlyConnected": true,
+					"interfaceName": "eth0",
+					"active": true
+				}
+			]
+		}
+	]
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/ce4/ipv6_rib.json b/tests/topotests/bgp_srv6_evpn_rt5/ce4/ipv6_rib.json
new file mode 100644
index 0000000000..b4981d55da
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/ce4/ipv6_rib.json
@@ -0,0 +1,58 @@
+{
+	"::/0": [
+		{
+			"prefix": "::/0",
+			"protocol": "static",
+			"vrfId": 0,
+			"vrfName": "default",
+			"selected": true,
+			"destSelected": true,
+			"distance": 1,
+			"metric": 0,
+			"installed": true,
+			"table": 254,
+			"internalStatus": 16,
+			"internalFlags": 73,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"ip": "2001:db8:104::1",
+					"afi": "ipv6",
+					"interfaceName": "eth0",
+					"active": true,
+					"weight": 1
+				}
+			]
+		}
+	],
+	"2001:db8:104::/64": [
+		{
+			"prefix": "2001:db8:104::/64",
+			"protocol": "connected",
+			"vrfId": 0,
+			"vrfName": "default",
+			"selected": true,
+			"destSelected": true,
+			"distance": 0,
+			"metric": 0,
+			"installed": true,
+			"table": 254,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"directlyConnected": true,
+					"interfaceName": "eth0",
+					"active": true
+				}
+			]
+		}
+	]
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/ce5/frr.conf b/tests/topotests/bgp_srv6_evpn_rt5/ce5/frr.conf
new file mode 100644
index 0000000000..8064bea651
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/ce5/frr.conf
@@ -0,0 +1,18 @@
+frr defaults traditional
+!
+log file zebra.log
+!
+hostname ce5
+!
+interface eth0
+ ip address 192.168.5.2/24
+ ipv6 address 2001:db8:105::2/64
+!
+ip forwarding
+ipv6 forwarding
+!
+ip route 0.0.0.0/0 192.168.5.1
+ipv6 route ::/0 2001:db8:105::1
+!
+line vty
+!
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/ce5/ip_rib.json b/tests/topotests/bgp_srv6_evpn_rt5/ce5/ip_rib.json
new file mode 100644
index 0000000000..4c76fd3c39
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/ce5/ip_rib.json
@@ -0,0 +1,58 @@
+{
+	"0.0.0.0/0": [
+		{
+			"prefix": "0.0.0.0/0",
+			"protocol": "static",
+			"vrfId": 0,
+			"vrfName": "default",
+			"selected": true,
+			"destSelected": true,
+			"distance": 1,
+			"metric": 0,
+			"installed": true,
+			"table": 254,
+			"internalStatus": 16,
+			"internalFlags": 73,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"ip": "192.168.5.1",
+					"afi": "ipv4",
+					"interfaceName": "eth0",
+					"active": true,
+					"weight": 1
+				}
+			]
+		}
+	],
+	"192.168.5.0/24": [
+		{
+			"prefix": "192.168.5.0/24",
+			"protocol": "connected",
+			"vrfId": 0,
+			"vrfName": "default",
+			"selected": true,
+			"destSelected": true,
+			"distance": 0,
+			"metric": 0,
+			"installed": true,
+			"table": 254,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"directlyConnected": true,
+					"interfaceName": "eth0",
+					"active": true
+				}
+			]
+		}
+	]
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/ce5/ipv6_rib.json b/tests/topotests/bgp_srv6_evpn_rt5/ce5/ipv6_rib.json
new file mode 100644
index 0000000000..b30407f479
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/ce5/ipv6_rib.json
@@ -0,0 +1,58 @@
+{
+	"::/0": [
+		{
+			"prefix": "::/0",
+			"protocol": "static",
+			"vrfId": 0,
+			"vrfName": "default",
+			"selected": true,
+			"destSelected": true,
+			"distance": 1,
+			"metric": 0,
+			"installed": true,
+			"table": 254,
+			"internalStatus": 16,
+			"internalFlags": 73,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"ip": "2001:db8:105::1",
+					"afi": "ipv6",
+					"interfaceName": "eth0",
+					"active": true,
+					"weight": 1
+				}
+			]
+		}
+	],
+	"2001:db8:105::/64": [
+		{
+			"prefix": "2001:db8:105::/64",
+			"protocol": "connected",
+			"vrfId": 0,
+			"vrfName": "default",
+			"selected": true,
+			"destSelected": true,
+			"distance": 0,
+			"metric": 0,
+			"installed": true,
+			"table": 254,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"directlyConnected": true,
+					"interfaceName": "eth0",
+					"active": true
+				}
+			]
+		}
+	]
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/ce6/frr.conf b/tests/topotests/bgp_srv6_evpn_rt5/ce6/frr.conf
new file mode 100644
index 0000000000..5049269513
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/ce6/frr.conf
@@ -0,0 +1,14 @@
+frr defaults traditional
+!
+interface eth0
+ ip address 192.168.6.2/24
+ ipv6 address 2001:db8:106::2/64
+!
+ip forwarding
+ipv6 forwarding
+!
+ip route 0.0.0.0/0 192.168.6.1
+ipv6 route ::/0 2001:db8:106::1
+!
+line vty
+!
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/ce6/ip_rib.json b/tests/topotests/bgp_srv6_evpn_rt5/ce6/ip_rib.json
new file mode 100644
index 0000000000..bcbefdb14f
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/ce6/ip_rib.json
@@ -0,0 +1,58 @@
+{
+	"0.0.0.0/0": [
+		{
+			"prefix": "0.0.0.0/0",
+			"protocol": "static",
+			"vrfId": 0,
+			"vrfName": "default",
+			"selected": true,
+			"destSelected": true,
+			"distance": 1,
+			"metric": 0,
+			"installed": true,
+			"table": 254,
+			"internalStatus": 16,
+			"internalFlags": 73,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"ip": "192.168.6.1",
+					"afi": "ipv4",
+					"interfaceName": "eth0",
+					"active": true,
+					"weight": 1
+				}
+			]
+		}
+	],
+	"192.168.6.0/24": [
+		{
+			"prefix": "192.168.6.0/24",
+			"protocol": "connected",
+			"vrfId": 0,
+			"vrfName": "default",
+			"selected": true,
+			"destSelected": true,
+			"distance": 0,
+			"metric": 0,
+			"installed": true,
+			"table": 254,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"directlyConnected": true,
+					"interfaceName": "eth0",
+					"active": true
+				}
+			]
+		}
+	]
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/ce6/ipv6_rib.json b/tests/topotests/bgp_srv6_evpn_rt5/ce6/ipv6_rib.json
new file mode 100644
index 0000000000..d81c03ef04
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/ce6/ipv6_rib.json
@@ -0,0 +1,58 @@
+{
+	"::/0": [
+		{
+			"prefix": "::/0",
+			"protocol": "static",
+			"vrfId": 0,
+			"vrfName": "default",
+			"selected": true,
+			"destSelected": true,
+			"distance": 1,
+			"metric": 0,
+			"installed": true,
+			"table": 254,
+			"internalStatus": 16,
+			"internalFlags": 73,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"ip": "2001:db8:106::1",
+					"afi": "ipv6",
+					"interfaceName": "eth0",
+					"active": true,
+					"weight": 1
+				}
+			]
+		}
+	],
+	"2001:db8:106::/64": [
+		{
+			"prefix": "2001:db8:106::/64",
+			"protocol": "connected",
+			"vrfId": 0,
+			"vrfName": "default",
+			"selected": true,
+			"destSelected": true,
+			"distance": 0,
+			"metric": 0,
+			"installed": true,
+			"table": 254,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"directlyConnected": true,
+					"interfaceName": "eth0",
+					"active": true
+				}
+			]
+		}
+	]
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/r1/evpn_rib.json b/tests/topotests/bgp_srv6_evpn_rt5/r1/evpn_rib.json
new file mode 100644
index 0000000000..054b555140
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/r1/evpn_rib.json
@@ -0,0 +1,170 @@
+{
+	"65001:10": {
+		"rd": "65001:10",
+		"[5]:[0]:[24]:[192.168.1.0]": {
+			"prefix": "[5]:[0]:[24]:[192.168.1.0]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 24,
+					"ip": "192.168.1.0"
+				}
+			]
+		},
+		"[5]:[0]:[24]:[192.168.3.0]": {
+			"prefix": "[5]:[0]:[24]:[192.168.3.0]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 24,
+					"ip": "192.168.3.0"
+				}
+			]
+		},
+		"[5]:[0]:[64]:[2001:db8:101::]": {
+			"prefix": "[5]:[0]:[64]:[2001:db8:101::]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 64,
+					"ip": "2001:db8:101::"
+				}
+			]
+		},
+		"[5]:[0]:[64]:[2001:db8:103::]": {
+			"prefix": "[5]:[0]:[64]:[2001:db8:103::]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 64,
+					"ip": "2001:db8:103::"
+				}
+			]
+		}
+	},
+	"65001:20": {
+		"rd": "65001:20",
+		"[5]:[0]:[24]:[192.168.5.0]": {
+			"prefix": "[5]:[0]:[24]:[192.168.5.0]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 24,
+					"ip": "192.168.5.0"
+				}
+			]
+		},
+		"[5]:[0]:[64]:[2001:db8:105::]": {
+			"prefix": "[5]:[0]:[64]:[2001:db8:105::]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 64,
+					"ip": "2001:db8:105::"
+				}
+			]
+		}
+	},
+	"65002:10": {
+		"rd": "65002:10",
+		"[5]:[0]:[24]:[192.168.2.0]": {
+			"prefix": "[5]:[0]:[24]:[192.168.2.0]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 24,
+					"ip": "192.168.2.0"
+				}
+			]
+		},
+		"[5]:[0]:[64]:[2001:db8:102::]": {
+			"prefix": "[5]:[0]:[64]:[2001:db8:102::]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 64,
+					"ip": "2001:db8:102::"
+				}
+			]
+		}
+	},
+	"65002:20": {
+		"rd": "65002:20",
+		"[5]:[0]:[24]:[192.168.4.0]": {
+			"prefix": "[5]:[0]:[24]:[192.168.4.0]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 24,
+					"ip": "192.168.4.0"
+				}
+			]
+		},
+		"[5]:[0]:[24]:[192.168.6.0]": {
+			"prefix": "[5]:[0]:[24]:[192.168.6.0]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 24,
+					"ip": "192.168.6.0"
+				}
+			]
+		},
+		"[5]:[0]:[64]:[2001:db8:104::]": {
+			"prefix": "[5]:[0]:[64]:[2001:db8:104::]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 64,
+					"ip": "2001:db8:104::"
+				}
+			]
+		},
+		"[5]:[0]:[64]:[2001:db8:106::]": {
+			"prefix": "[5]:[0]:[64]:[2001:db8:106::]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 64,
+					"ip": "2001:db8:106::"
+				}
+			]
+		}
+	}
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/r1/evpn_rib_locator_recreated.json b/tests/topotests/bgp_srv6_evpn_rt5/r1/evpn_rib_locator_recreated.json
new file mode 100644
index 0000000000..054b555140
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/r1/evpn_rib_locator_recreated.json
@@ -0,0 +1,170 @@
+{
+	"65001:10": {
+		"rd": "65001:10",
+		"[5]:[0]:[24]:[192.168.1.0]": {
+			"prefix": "[5]:[0]:[24]:[192.168.1.0]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 24,
+					"ip": "192.168.1.0"
+				}
+			]
+		},
+		"[5]:[0]:[24]:[192.168.3.0]": {
+			"prefix": "[5]:[0]:[24]:[192.168.3.0]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 24,
+					"ip": "192.168.3.0"
+				}
+			]
+		},
+		"[5]:[0]:[64]:[2001:db8:101::]": {
+			"prefix": "[5]:[0]:[64]:[2001:db8:101::]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 64,
+					"ip": "2001:db8:101::"
+				}
+			]
+		},
+		"[5]:[0]:[64]:[2001:db8:103::]": {
+			"prefix": "[5]:[0]:[64]:[2001:db8:103::]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 64,
+					"ip": "2001:db8:103::"
+				}
+			]
+		}
+	},
+	"65001:20": {
+		"rd": "65001:20",
+		"[5]:[0]:[24]:[192.168.5.0]": {
+			"prefix": "[5]:[0]:[24]:[192.168.5.0]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 24,
+					"ip": "192.168.5.0"
+				}
+			]
+		},
+		"[5]:[0]:[64]:[2001:db8:105::]": {
+			"prefix": "[5]:[0]:[64]:[2001:db8:105::]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 64,
+					"ip": "2001:db8:105::"
+				}
+			]
+		}
+	},
+	"65002:10": {
+		"rd": "65002:10",
+		"[5]:[0]:[24]:[192.168.2.0]": {
+			"prefix": "[5]:[0]:[24]:[192.168.2.0]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 24,
+					"ip": "192.168.2.0"
+				}
+			]
+		},
+		"[5]:[0]:[64]:[2001:db8:102::]": {
+			"prefix": "[5]:[0]:[64]:[2001:db8:102::]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 64,
+					"ip": "2001:db8:102::"
+				}
+			]
+		}
+	},
+	"65002:20": {
+		"rd": "65002:20",
+		"[5]:[0]:[24]:[192.168.4.0]": {
+			"prefix": "[5]:[0]:[24]:[192.168.4.0]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 24,
+					"ip": "192.168.4.0"
+				}
+			]
+		},
+		"[5]:[0]:[24]:[192.168.6.0]": {
+			"prefix": "[5]:[0]:[24]:[192.168.6.0]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 24,
+					"ip": "192.168.6.0"
+				}
+			]
+		},
+		"[5]:[0]:[64]:[2001:db8:104::]": {
+			"prefix": "[5]:[0]:[64]:[2001:db8:104::]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 64,
+					"ip": "2001:db8:104::"
+				}
+			]
+		},
+		"[5]:[0]:[64]:[2001:db8:106::]": {
+			"prefix": "[5]:[0]:[64]:[2001:db8:106::]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 64,
+					"ip": "2001:db8:106::"
+				}
+			]
+		}
+	}
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/r1/evpn_rib_locator_zebra_deleted.json b/tests/topotests/bgp_srv6_evpn_rt5/r1/evpn_rib_locator_zebra_deleted.json
new file mode 100644
index 0000000000..b6fa71af58
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/r1/evpn_rib_locator_zebra_deleted.json
@@ -0,0 +1,32 @@
+{
+	"65002:10": {
+		"rd": "65002:10",
+		"[5]:[0]:[24]:[192.168.2.0]": {
+			"prefix": "[5]:[0]:[24]:[192.168.2.0]",
+			"paths": [
+				{
+					"valid": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 24,
+					"ip": "192.168.2.0"
+				}
+			]
+		}
+	},
+	"65002:20": {
+		"rd": "65002:20",
+		"[5]:[0]:[24]:[192.168.4.0]": {
+			"prefix": "[5]:[0]:[24]:[192.168.4.0]",
+			"paths": [
+				{
+					"valid": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 24,
+					"ip": "192.168.4.0"
+				}
+			]
+		}
+	}
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/r1/frr.conf b/tests/topotests/bgp_srv6_evpn_rt5/r1/frr.conf
new file mode 100644
index 0000000000..1286abc694
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/r1/frr.conf
@@ -0,0 +1,111 @@
+frr defaults traditional
+!bgp send-extra-data zebra
+!debug bgp neighbor-events
+!debug bgp zebra
+!debug bgp vnc verbose
+!debug bgp update-groups
+!debug bgp updates in
+!debug bgp updates out
+!debug bgp vpn label
+!debug bgp vpn leak-from-vrf
+!debug bgp vpn leak-to-vrf
+!debug bgp vpn rmap-event
+!debug zebra packet
+!debug zebra dplane
+!debug zebra kernel
+!
+interface eth0
+ ipv6 address 2001:db8:ff::1/64
+!
+interface eth1 vrf vrf10
+ ip address 192.168.1.1/24
+ ipv6 address 2001:db8:101::1/64
+!
+interface eth2 vrf vrf10
+ ip address 192.168.3.1/24
+ ipv6 address 2001:db8:103::1/64
+!
+interface eth3 vrf vrf20
+ ip address 192.168.5.1/24
+ ipv6 address 2001:db8:105::1/64
+!
+segment-routing
+ srv6
+  locators
+   locator MAIN
+    prefix fcbb:bbbb:1::/48
+    format usid-f3216
+  !
+ !
+!
+ip forwarding
+ipv6 forwarding
+!
+ipv6 route fcbb:bbbb:2::/48 2001:db8:ff::2
+!
+router bgp 65001
+ bgp router-id 192.0.2.1
+ no bgp ebgp-requires-policy
+ !no bgp default ipv4-unicast
+ neighbor 2001:db8:ff::2 remote-as 65002
+ neighbor 2001:db8:ff::2 timers 3 10
+ neighbor 2001:db8:ff::2 timers connect 1
+ neighbor 2001:db8:ff::2 capability extended-nexthop
+ !
+ address-family l2vpn evpn
+  neighbor 2001:db8:ff::2 activate
+  advertise ipv4 vpn
+  advertise ipv6 vpn
+ exit-address-family
+ !
+ segment-routing srv6
+  locator MAIN
+  encap-behavior H_Encaps_Red
+ !
+!
+router bgp 65001 vrf vrf10
+ bgp router-id 192.0.2.1
+ no bgp ebgp-requires-policy
+ sid vpn per-vrf export explicit fcbb:bbbb:1:fe10::
+ !
+ address-family ipv4 unicast
+  nexthop vpn export 2001:db8:ff::1
+  rd vpn export 65001:10
+  rt vpn both 99:99
+  import vpn
+  export vpn
+  redistribute connected
+ exit-address-family
+ !
+ address-family ipv6 unicast
+  rd vpn export 65001:10
+  rt vpn both 99:99
+  import vpn
+  export vpn
+  redistribute connected
+ exit-address-family
+!
+router bgp 65001 vrf vrf20
+ bgp router-id 192.0.2.1
+ no bgp ebgp-requires-policy
+ sid vpn per-vrf export explicit fcbb:bbbb:1:fe20::
+ !
+ address-family ipv4 unicast
+  nexthop vpn export 2001:db8:ff::1
+  rd vpn export 65001:20
+  rt vpn both 88:88
+  import vpn
+  export vpn
+  redistribute connected
+ exit-address-family
+ !
+ address-family ipv6 unicast
+  rd vpn export 65001:20
+  rt vpn both 88:88
+  import vpn
+  export vpn
+  redistribute connected
+ exit-address-family
+!
+line vty
+!
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/r1/vpnv4_rib.json b/tests/topotests/bgp_srv6_evpn_rt5/r1/vpnv4_rib.json
new file mode 100644
index 0000000000..ca366970e7
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/r1/vpnv4_rib.json
@@ -0,0 +1,166 @@
+{
+	"vrfId": 0,
+	"vrfName": "default",
+	"routerId": "192.0.2.1",
+	"defaultLocPrf": 100,
+	"localAS": 65001,
+	"routes": {
+		"routeDistinguishers": {
+			"65001:10": {
+				"192.168.1.0/24": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "192.168.1.0",
+						"prefixLen": 24,
+						"network": "192.168.1.0/24",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"nhVrfName": "vrf10",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::1",
+								"hostname": "r1",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				],
+				"192.168.3.0/24": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "192.168.3.0",
+						"prefixLen": 24,
+						"network": "192.168.3.0/24",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"nhVrfName": "vrf10",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::1",
+								"hostname": "r1",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65001:20": {
+				"192.168.5.0/24": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "192.168.5.0",
+						"prefixLen": 24,
+						"network": "192.168.5.0/24",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"nhVrfName": "vrf20",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::1",
+								"hostname": "r1",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65002:10": {
+				"192.168.2.0/24": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "192.168.2.0",
+						"prefixLen": 24,
+						"network": "192.168.2.0/24",
+						"metric": 0,
+						"weight": 0,
+						"peerId": "2001:db8:ff::2",
+						"path": "65002",
+						"origin": "incomplete",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::2",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65002:20": {
+				"192.168.4.0/24": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "192.168.4.0",
+						"prefixLen": 24,
+						"network": "192.168.4.0/24",
+						"metric": 0,
+						"weight": 0,
+						"peerId": "2001:db8:ff::2",
+						"path": "65002",
+						"origin": "incomplete",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::2",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				],
+				"192.168.6.0/24": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "192.168.6.0",
+						"prefixLen": 24,
+						"network": "192.168.6.0/24",
+						"metric": 0,
+						"weight": 0,
+						"peerId": "2001:db8:ff::2",
+						"path": "65002",
+						"origin": "incomplete",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::2",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			}
+		}
+	}
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/r1/vpnv4_rib_locator_recreated.json b/tests/topotests/bgp_srv6_evpn_rt5/r1/vpnv4_rib_locator_recreated.json
new file mode 100644
index 0000000000..ca366970e7
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/r1/vpnv4_rib_locator_recreated.json
@@ -0,0 +1,166 @@
+{
+	"vrfId": 0,
+	"vrfName": "default",
+	"routerId": "192.0.2.1",
+	"defaultLocPrf": 100,
+	"localAS": 65001,
+	"routes": {
+		"routeDistinguishers": {
+			"65001:10": {
+				"192.168.1.0/24": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "192.168.1.0",
+						"prefixLen": 24,
+						"network": "192.168.1.0/24",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"nhVrfName": "vrf10",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::1",
+								"hostname": "r1",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				],
+				"192.168.3.0/24": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "192.168.3.0",
+						"prefixLen": 24,
+						"network": "192.168.3.0/24",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"nhVrfName": "vrf10",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::1",
+								"hostname": "r1",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65001:20": {
+				"192.168.5.0/24": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "192.168.5.0",
+						"prefixLen": 24,
+						"network": "192.168.5.0/24",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"nhVrfName": "vrf20",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::1",
+								"hostname": "r1",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65002:10": {
+				"192.168.2.0/24": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "192.168.2.0",
+						"prefixLen": 24,
+						"network": "192.168.2.0/24",
+						"metric": 0,
+						"weight": 0,
+						"peerId": "2001:db8:ff::2",
+						"path": "65002",
+						"origin": "incomplete",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::2",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65002:20": {
+				"192.168.4.0/24": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "192.168.4.0",
+						"prefixLen": 24,
+						"network": "192.168.4.0/24",
+						"metric": 0,
+						"weight": 0,
+						"peerId": "2001:db8:ff::2",
+						"path": "65002",
+						"origin": "incomplete",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::2",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				],
+				"192.168.6.0/24": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "192.168.6.0",
+						"prefixLen": 24,
+						"network": "192.168.6.0/24",
+						"metric": 0,
+						"weight": 0,
+						"peerId": "2001:db8:ff::2",
+						"path": "65002",
+						"origin": "incomplete",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::2",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			}
+		}
+	}
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/r1/vpnv4_rib_locator_zebra_deleted.json b/tests/topotests/bgp_srv6_evpn_rt5/r1/vpnv4_rib_locator_zebra_deleted.json
new file mode 100644
index 0000000000..8567a48e7e
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/r1/vpnv4_rib_locator_zebra_deleted.json
@@ -0,0 +1,157 @@
+{
+	"vrfId": 0,
+	"vrfName": "default",
+	"routerId": "192.0.2.1",
+	"defaultLocPrf": 100,
+	"localAS": 65001,
+	"routes": {
+		"routeDistinguishers": {
+			"65001:10": {
+				"192.168.1.0/24": [
+					{
+						"pathFrom": "external",
+						"prefix": "192.168.1.0",
+						"prefixLen": 24,
+						"network": "192.168.1.0/24",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"nhVrfName": "vrf10",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::1",
+								"hostname": "r1",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				],
+				"192.168.3.0/24": [
+					{
+						"pathFrom": "external",
+						"prefix": "192.168.3.0",
+						"prefixLen": 24,
+						"network": "192.168.3.0/24",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"nhVrfName": "vrf10",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::1",
+								"hostname": "r1",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65001:20": {
+				"192.168.5.0/24": [
+					{
+						"pathFrom": "external",
+						"prefix": "192.168.5.0",
+						"prefixLen": 24,
+						"network": "192.168.5.0/24",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"nhVrfName": "vrf20",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::1",
+								"hostname": "r1",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65002:10": {
+				"192.168.2.0/24": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "192.168.2.0",
+						"prefixLen": 24,
+						"network": "192.168.2.0/24",
+						"metric": 0,
+						"weight": 0,
+						"peerId": "2001:db8:ff::2",
+						"path": "65002",
+						"origin": "incomplete",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::2",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65002:20": {
+				"192.168.4.0/24": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "192.168.4.0",
+						"prefixLen": 24,
+						"network": "192.168.4.0/24",
+						"metric": 0,
+						"weight": 0,
+						"peerId": "2001:db8:ff::2",
+						"path": "65002",
+						"origin": "incomplete",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::2",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				],
+				"192.168.6.0/24": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "192.168.6.0",
+						"prefixLen": 24,
+						"network": "192.168.6.0/24",
+						"metric": 0,
+						"weight": 0,
+						"peerId": "2001:db8:ff::2",
+						"path": "65002",
+						"origin": "incomplete",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::2",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			}
+		}
+	}
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/r1/vpnv6_rib.json b/tests/topotests/bgp_srv6_evpn_rt5/r1/vpnv6_rib.json
new file mode 100644
index 0000000000..7f90765999
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/r1/vpnv6_rib.json
@@ -0,0 +1,169 @@
+{
+	"vrfId": 0,
+	"vrfName": "default",
+	"routerId": "192.0.2.1",
+	"defaultLocPrf": 100,
+	"localAS": 65001,
+	"routes": {
+		"routeDistinguishers": {
+			"65001:10": {
+				"2001:db8:101::/64": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "2001:db8:101::",
+						"prefixLen": 64,
+						"network": "2001:db8:101::/64",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"announceNexthopSelf": true,
+						"nhVrfName": "vrf10",
+						"nexthops": [
+							{
+								"ip": "::",
+								"hostname": "r1",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				],
+				"2001:db8:103::/64": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "2001:db8:103::",
+						"prefixLen": 64,
+						"network": "2001:db8:103::/64",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"announceNexthopSelf": true,
+						"nhVrfName": "vrf10",
+						"nexthops": [
+							{
+								"ip": "::",
+								"hostname": "r1",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65001:20": {
+				"2001:db8:105::/64": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "2001:db8:105::",
+						"prefixLen": 64,
+						"network": "2001:db8:105::/64",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"announceNexthopSelf": true,
+						"nhVrfName": "vrf20",
+						"nexthops": [
+							{
+								"ip": "::",
+								"hostname": "r1",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65002:10": {
+				"2001:db8:102::/64": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "2001:db8:102::",
+						"prefixLen": 64,
+						"network": "2001:db8:102::/64",
+						"metric": 0,
+						"weight": 0,
+						"peerId": "2001:db8:ff::2",
+						"path": "65002",
+						"origin": "incomplete",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::2",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65002:20": {
+				"2001:db8:104::/64": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "2001:db8:104::",
+						"prefixLen": 64,
+						"network": "2001:db8:104::/64",
+						"metric": 0,
+						"weight": 0,
+						"peerId": "2001:db8:ff::2",
+						"path": "65002",
+						"origin": "incomplete",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::2",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				],
+				"2001:db8:106::/64": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "2001:db8:106::",
+						"prefixLen": 64,
+						"network": "2001:db8:106::/64",
+						"metric": 0,
+						"weight": 0,
+						"peerId": "2001:db8:ff::2",
+						"path": "65002",
+						"origin": "incomplete",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::2",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			}
+		}
+	}
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/r1/vpnv6_rib_locator_recreated.json b/tests/topotests/bgp_srv6_evpn_rt5/r1/vpnv6_rib_locator_recreated.json
new file mode 100644
index 0000000000..7f90765999
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/r1/vpnv6_rib_locator_recreated.json
@@ -0,0 +1,169 @@
+{
+	"vrfId": 0,
+	"vrfName": "default",
+	"routerId": "192.0.2.1",
+	"defaultLocPrf": 100,
+	"localAS": 65001,
+	"routes": {
+		"routeDistinguishers": {
+			"65001:10": {
+				"2001:db8:101::/64": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "2001:db8:101::",
+						"prefixLen": 64,
+						"network": "2001:db8:101::/64",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"announceNexthopSelf": true,
+						"nhVrfName": "vrf10",
+						"nexthops": [
+							{
+								"ip": "::",
+								"hostname": "r1",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				],
+				"2001:db8:103::/64": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "2001:db8:103::",
+						"prefixLen": 64,
+						"network": "2001:db8:103::/64",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"announceNexthopSelf": true,
+						"nhVrfName": "vrf10",
+						"nexthops": [
+							{
+								"ip": "::",
+								"hostname": "r1",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65001:20": {
+				"2001:db8:105::/64": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "2001:db8:105::",
+						"prefixLen": 64,
+						"network": "2001:db8:105::/64",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"announceNexthopSelf": true,
+						"nhVrfName": "vrf20",
+						"nexthops": [
+							{
+								"ip": "::",
+								"hostname": "r1",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65002:10": {
+				"2001:db8:102::/64": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "2001:db8:102::",
+						"prefixLen": 64,
+						"network": "2001:db8:102::/64",
+						"metric": 0,
+						"weight": 0,
+						"peerId": "2001:db8:ff::2",
+						"path": "65002",
+						"origin": "incomplete",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::2",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65002:20": {
+				"2001:db8:104::/64": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "2001:db8:104::",
+						"prefixLen": 64,
+						"network": "2001:db8:104::/64",
+						"metric": 0,
+						"weight": 0,
+						"peerId": "2001:db8:ff::2",
+						"path": "65002",
+						"origin": "incomplete",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::2",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				],
+				"2001:db8:106::/64": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "2001:db8:106::",
+						"prefixLen": 64,
+						"network": "2001:db8:106::/64",
+						"metric": 0,
+						"weight": 0,
+						"peerId": "2001:db8:ff::2",
+						"path": "65002",
+						"origin": "incomplete",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::2",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			}
+		}
+	}
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/r1/vpnv6_rib_locator_zebra_deleted.json b/tests/topotests/bgp_srv6_evpn_rt5/r1/vpnv6_rib_locator_zebra_deleted.json
new file mode 100644
index 0000000000..82fb5948af
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/r1/vpnv6_rib_locator_zebra_deleted.json
@@ -0,0 +1,160 @@
+{
+	"vrfId": 0,
+	"vrfName": "default",
+	"routerId": "192.0.2.1",
+	"defaultLocPrf": 100,
+	"localAS": 65001,
+	"routes": {
+		"routeDistinguishers": {
+			"65001:10": {
+				"2001:db8:101::/64": [
+					{
+						"pathFrom": "external",
+						"prefix": "2001:db8:101::",
+						"prefixLen": 64,
+						"network": "2001:db8:101::/64",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"announceNexthopSelf": true,
+						"nhVrfName": "vrf10",
+						"nexthops": [
+							{
+								"ip": "::",
+								"hostname": "r1",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				],
+				"2001:db8:103::/64": [
+					{
+						"pathFrom": "external",
+						"prefix": "2001:db8:103::",
+						"prefixLen": 64,
+						"network": "2001:db8:103::/64",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"announceNexthopSelf": true,
+						"nhVrfName": "vrf10",
+						"nexthops": [
+							{
+								"ip": "::",
+								"hostname": "r1",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65001:20": {
+				"2001:db8:105::/64": [
+					{
+						"pathFrom": "external",
+						"prefix": "2001:db8:105::",
+						"prefixLen": 64,
+						"network": "2001:db8:105::/64",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"announceNexthopSelf": true,
+						"nhVrfName": "vrf20",
+						"nexthops": [
+							{
+								"ip": "::",
+								"hostname": "r1",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65002:10": {
+				"2001:db8:102::/64": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "2001:db8:102::",
+						"prefixLen": 64,
+						"network": "2001:db8:102::/64",
+						"metric": 0,
+						"weight": 0,
+						"peerId": "2001:db8:ff::2",
+						"path": "65002",
+						"origin": "incomplete",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::2",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65002:20": {
+				"2001:db8:104::/64": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "2001:db8:104::",
+						"prefixLen": 64,
+						"network": "2001:db8:104::/64",
+						"metric": 0,
+						"weight": 0,
+						"peerId": "2001:db8:ff::2",
+						"path": "65002",
+						"origin": "incomplete",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::2",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				],
+				"2001:db8:106::/64": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "2001:db8:106::",
+						"prefixLen": 64,
+						"network": "2001:db8:106::/64",
+						"metric": 0,
+						"weight": 0,
+						"peerId": "2001:db8:ff::2",
+						"path": "65002",
+						"origin": "incomplete",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::2",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			}
+		}
+	}
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/r1/vrf10v4_rib.json b/tests/topotests/bgp_srv6_evpn_rt5/r1/vrf10v4_rib.json
new file mode 100644
index 0000000000..a77cc4eb6a
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/r1/vrf10v4_rib.json
@@ -0,0 +1,86 @@
+{
+	"192.168.1.0/24": [
+		{
+			"prefix": "192.168.1.0/24",
+			"protocol": "connected",
+			"vrfName": "vrf10",
+			"selected": true,
+			"destSelected": true,
+			"distance": 0,
+			"metric": 0,
+			"installed": true,
+			"table": 10,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"directlyConnected": true,
+					"interfaceName": "eth1",
+					"active": true
+				}
+			]
+		}
+	],
+	"192.168.2.0/24": [
+		{
+			"prefix": "192.168.2.0/24",
+			"protocol": "bgp",
+			"vrfName": "vrf10",
+			"selected": true,
+			"destSelected": true,
+			"distance": 20,
+			"metric": 0,
+			"installed": true,
+			"table": 10,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"afi": "ipv6",
+					"interfaceName": "eth0",
+					"vrf": "default",
+					"active": true,
+					"weight": 1,
+					"seg6": {
+						"segs": "fcbb:bbbb:2:fe10::"
+					},
+					"srv6EncapBehavior": "H.Encaps.Red"
+				}
+			]
+		}
+	],
+	"192.168.3.0/24": [
+		{
+			"prefix": "192.168.3.0/24",
+			"protocol": "connected",
+			"vrfName": "vrf10",
+			"selected": true,
+			"destSelected": true,
+			"distance": 0,
+			"metric": 0,
+			"installed": true,
+			"table": 10,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"directlyConnected": true,
+					"interfaceName": "eth2",
+					"active": true
+				}
+			]
+		}
+	]
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/r1/vrf10v6_rib.json b/tests/topotests/bgp_srv6_evpn_rt5/r1/vrf10v6_rib.json
new file mode 100644
index 0000000000..9a037a1c0f
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/r1/vrf10v6_rib.json
@@ -0,0 +1,86 @@
+{
+	"2001:db8:101::/64": [
+		{
+			"prefix": "2001:db8:101::/64",
+			"protocol": "connected",
+			"vrfName": "vrf10",
+			"selected": true,
+			"destSelected": true,
+			"distance": 0,
+			"metric": 0,
+			"installed": true,
+			"table": 10,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"directlyConnected": true,
+					"interfaceName": "eth1",
+					"active": true
+				}
+			]
+		}
+	],
+	"2001:db8:102::/64": [
+		{
+			"prefix": "2001:db8:102::/64",
+			"protocol": "bgp",
+			"vrfName": "vrf10",
+			"selected": true,
+			"destSelected": true,
+			"distance": 20,
+			"metric": 0,
+			"installed": true,
+			"table": 10,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"afi": "ipv6",
+					"interfaceName": "eth0",
+					"vrf": "default",
+					"active": true,
+					"weight": 1,
+					"seg6": {
+						"segs": "fcbb:bbbb:2:fe10::"
+					},
+					"srv6EncapBehavior": "H.Encaps.Red"
+				}
+			]
+		}
+	],
+	"2001:db8:103::/64": [
+		{
+			"prefix": "2001:db8:103::/64",
+			"protocol": "connected",
+			"vrfName": "vrf10",
+			"selected": true,
+			"destSelected": true,
+			"distance": 0,
+			"metric": 0,
+			"installed": true,
+			"table": 10,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"directlyConnected": true,
+					"interfaceName": "eth2",
+					"active": true
+				}
+			]
+		}
+	]
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/r1/vrf20v4_rib.json b/tests/topotests/bgp_srv6_evpn_rt5/r1/vrf20v4_rib.json
new file mode 100644
index 0000000000..18fad644e3
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/r1/vrf20v4_rib.json
@@ -0,0 +1,92 @@
+{
+	"192.168.4.0/24": [
+		{
+			"prefix": "192.168.4.0/24",
+			"protocol": "bgp",
+			"vrfName": "vrf20",
+			"selected": true,
+			"destSelected": true,
+			"distance": 20,
+			"metric": 0,
+			"installed": true,
+			"table": 20,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"afi": "ipv6",
+					"interfaceName": "eth0",
+					"vrf": "default",
+					"active": true,
+					"weight": 1,
+					"seg6": {
+						"segs": "fcbb:bbbb:2:fe20::"
+					},
+					"srv6EncapBehavior": "H.Encaps.Red"
+				}
+			]
+		}
+	],
+	"192.168.5.0/24": [
+		{
+			"prefix": "192.168.5.0/24",
+			"protocol": "connected",
+			"vrfName": "vrf20",
+			"selected": true,
+			"destSelected": true,
+			"distance": 0,
+			"metric": 0,
+			"installed": true,
+			"table": 20,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"directlyConnected": true,
+					"interfaceName": "eth3",
+					"active": true
+				}
+			]
+		}
+	],
+	"192.168.6.0/24": [
+		{
+			"prefix": "192.168.6.0/24",
+			"protocol": "bgp",
+			"vrfName": "vrf20",
+			"selected": true,
+			"destSelected": true,
+			"distance": 20,
+			"metric": 0,
+			"installed": true,
+			"table": 20,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"afi": "ipv6",
+					"interfaceName": "eth0",
+					"vrf": "default",
+					"active": true,
+					"weight": 1,
+					"seg6": {
+						"segs": "fcbb:bbbb:2:fe20::"
+					},
+					"srv6EncapBehavior": "H.Encaps.Red"
+				}
+			]
+		}
+	]
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/r1/vrf20v6_rib.json b/tests/topotests/bgp_srv6_evpn_rt5/r1/vrf20v6_rib.json
new file mode 100644
index 0000000000..1a22ae023b
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/r1/vrf20v6_rib.json
@@ -0,0 +1,92 @@
+{
+	"2001:db8:104::/64": [
+		{
+			"prefix": "2001:db8:104::/64",
+			"protocol": "bgp",
+			"vrfName": "vrf20",
+			"selected": true,
+			"destSelected": true,
+			"distance": 20,
+			"metric": 0,
+			"installed": true,
+			"table": 20,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"afi": "ipv6",
+					"interfaceName": "eth0",
+					"vrf": "default",
+					"active": true,
+					"weight": 1,
+					"seg6": {
+						"segs": "fcbb:bbbb:2:fe20::"
+					},
+					"srv6EncapBehavior": "H.Encaps.Red"
+				}
+			]
+		}
+	],
+	"2001:db8:105::/64": [
+		{
+			"prefix": "2001:db8:105::/64",
+			"protocol": "connected",
+			"vrfName": "vrf20",
+			"selected": true,
+			"destSelected": true,
+			"distance": 0,
+			"metric": 0,
+			"installed": true,
+			"table": 20,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"directlyConnected": true,
+					"interfaceName": "eth3",
+					"active": true
+				}
+			]
+		}
+	],
+	"2001:db8:106::/64": [
+		{
+			"prefix": "2001:db8:106::/64",
+			"protocol": "bgp",
+			"vrfName": "vrf20",
+			"selected": true,
+			"destSelected": true,
+			"distance": 20,
+			"metric": 0,
+			"installed": true,
+			"table": 20,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"afi": "ipv6",
+					"interfaceName": "eth0",
+					"vrf": "default",
+					"active": true,
+					"weight": 1,
+					"seg6": {
+						"segs": "fcbb:bbbb:2:fe20::"
+					},
+					"srv6EncapBehavior": "H.Encaps.Red"
+				}
+			]
+		}
+	]
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/r2/evpn_rib.json b/tests/topotests/bgp_srv6_evpn_rt5/r2/evpn_rib.json
new file mode 100644
index 0000000000..3f5ebadb18
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/r2/evpn_rib.json
@@ -0,0 +1,170 @@
+{
+	"65002:10": {
+		"rd": "65002:10",
+		"[5]:[0]:[24]:[192.168.2.0]": {
+			"prefix": "[5]:[0]:[24]:[192.168.2.0]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 24,
+					"ip": "192.168.2.0"
+				}
+			]
+		},
+		"[5]:[0]:[64]:[2001:db8:102::]": {
+			"prefix": "[5]:[0]:[64]:[2001:db8:102::]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 64,
+					"ip": "2001:db8:102::"
+				}
+			]
+		}
+	},
+	"65002:20": {
+		"rd": "65002:20",
+		"[5]:[0]:[24]:[192.168.4.0]": {
+			"prefix": "[5]:[0]:[24]:[192.168.4.0]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 24,
+					"ip": "192.168.4.0"
+				}
+			]
+		},
+		"[5]:[0]:[24]:[192.168.6.0]": {
+			"prefix": "[5]:[0]:[24]:[192.168.6.0]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 24,
+					"ip": "192.168.6.0"
+				}
+			]
+		},
+		"[5]:[0]:[64]:[2001:db8:104::]": {
+			"prefix": "[5]:[0]:[64]:[2001:db8:104::]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 64,
+					"ip": "2001:db8:104::"
+				}
+			]
+		},
+		"[5]:[0]:[64]:[2001:db8:106::]": {
+			"prefix": "[5]:[0]:[64]:[2001:db8:106::]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 64,
+					"ip": "2001:db8:106::"
+				}
+			]
+		}
+	},
+	"65001:10": {
+		"rd": "65001:10",
+		"[5]:[0]:[24]:[192.168.1.0]": {
+			"prefix": "[5]:[0]:[24]:[192.168.1.0]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 24,
+					"ip": "192.168.1.0"
+				}
+			]
+		},
+		"[5]:[0]:[24]:[192.168.3.0]": {
+			"prefix": "[5]:[0]:[24]:[192.168.3.0]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 24,
+					"ip": "192.168.3.0"
+				}
+			]
+		},
+		"[5]:[0]:[64]:[2001:db8:101::]": {
+			"prefix": "[5]:[0]:[64]:[2001:db8:101::]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 64,
+					"ip": "2001:db8:101::"
+				}
+			]
+		},
+		"[5]:[0]:[64]:[2001:db8:103::]": {
+			"prefix": "[5]:[0]:[64]:[2001:db8:103::]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 64,
+					"ip": "2001:db8:103::"
+				}
+			]
+		}
+	},
+	"65001:20": {
+		"rd": "65001:20",
+		"[5]:[0]:[24]:[192.168.5.0]": {
+			"prefix": "[5]:[0]:[24]:[192.168.5.0]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 24,
+					"ip": "192.168.5.0"
+				}
+			]
+		},
+		"[5]:[0]:[64]:[2001:db8:105::]": {
+			"prefix": "[5]:[0]:[64]:[2001:db8:105::]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 64,
+					"ip": "2001:db8:105::"
+				}
+			]
+		}
+	}
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/r2/evpn_rib_locator_recreated.json b/tests/topotests/bgp_srv6_evpn_rt5/r2/evpn_rib_locator_recreated.json
new file mode 100644
index 0000000000..3f5ebadb18
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/r2/evpn_rib_locator_recreated.json
@@ -0,0 +1,170 @@
+{
+	"65002:10": {
+		"rd": "65002:10",
+		"[5]:[0]:[24]:[192.168.2.0]": {
+			"prefix": "[5]:[0]:[24]:[192.168.2.0]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 24,
+					"ip": "192.168.2.0"
+				}
+			]
+		},
+		"[5]:[0]:[64]:[2001:db8:102::]": {
+			"prefix": "[5]:[0]:[64]:[2001:db8:102::]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 64,
+					"ip": "2001:db8:102::"
+				}
+			]
+		}
+	},
+	"65002:20": {
+		"rd": "65002:20",
+		"[5]:[0]:[24]:[192.168.4.0]": {
+			"prefix": "[5]:[0]:[24]:[192.168.4.0]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 24,
+					"ip": "192.168.4.0"
+				}
+			]
+		},
+		"[5]:[0]:[24]:[192.168.6.0]": {
+			"prefix": "[5]:[0]:[24]:[192.168.6.0]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 24,
+					"ip": "192.168.6.0"
+				}
+			]
+		},
+		"[5]:[0]:[64]:[2001:db8:104::]": {
+			"prefix": "[5]:[0]:[64]:[2001:db8:104::]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 64,
+					"ip": "2001:db8:104::"
+				}
+			]
+		},
+		"[5]:[0]:[64]:[2001:db8:106::]": {
+			"prefix": "[5]:[0]:[64]:[2001:db8:106::]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 64,
+					"ip": "2001:db8:106::"
+				}
+			]
+		}
+	},
+	"65001:10": {
+		"rd": "65001:10",
+		"[5]:[0]:[24]:[192.168.1.0]": {
+			"prefix": "[5]:[0]:[24]:[192.168.1.0]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 24,
+					"ip": "192.168.1.0"
+				}
+			]
+		},
+		"[5]:[0]:[24]:[192.168.3.0]": {
+			"prefix": "[5]:[0]:[24]:[192.168.3.0]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 24,
+					"ip": "192.168.3.0"
+				}
+			]
+		},
+		"[5]:[0]:[64]:[2001:db8:101::]": {
+			"prefix": "[5]:[0]:[64]:[2001:db8:101::]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 64,
+					"ip": "2001:db8:101::"
+				}
+			]
+		},
+		"[5]:[0]:[64]:[2001:db8:103::]": {
+			"prefix": "[5]:[0]:[64]:[2001:db8:103::]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 64,
+					"ip": "2001:db8:103::"
+				}
+			]
+		}
+	},
+	"65001:20": {
+		"rd": "65001:20",
+		"[5]:[0]:[24]:[192.168.5.0]": {
+			"prefix": "[5]:[0]:[24]:[192.168.5.0]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 24,
+					"ip": "192.168.5.0"
+				}
+			]
+		},
+		"[5]:[0]:[64]:[2001:db8:105::]": {
+			"prefix": "[5]:[0]:[64]:[2001:db8:105::]",
+			"paths": [
+				{
+					"valid": true,
+					"bestpath": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 64,
+					"ip": "2001:db8:105::"
+				}
+			]
+		}
+	}
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/r2/evpn_rib_locator_zebra_deleted.json b/tests/topotests/bgp_srv6_evpn_rt5/r2/evpn_rib_locator_zebra_deleted.json
new file mode 100644
index 0000000000..b6fa71af58
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/r2/evpn_rib_locator_zebra_deleted.json
@@ -0,0 +1,32 @@
+{
+	"65002:10": {
+		"rd": "65002:10",
+		"[5]:[0]:[24]:[192.168.2.0]": {
+			"prefix": "[5]:[0]:[24]:[192.168.2.0]",
+			"paths": [
+				{
+					"valid": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 24,
+					"ip": "192.168.2.0"
+				}
+			]
+		}
+	},
+	"65002:20": {
+		"rd": "65002:20",
+		"[5]:[0]:[24]:[192.168.4.0]": {
+			"prefix": "[5]:[0]:[24]:[192.168.4.0]",
+			"paths": [
+				{
+					"valid": true,
+					"routeType": 5,
+					"ethTag": 0,
+					"ipLen": 24,
+					"ip": "192.168.4.0"
+				}
+			]
+		}
+	}
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/r2/frr.conf b/tests/topotests/bgp_srv6_evpn_rt5/r2/frr.conf
new file mode 100644
index 0000000000..723b069ebd
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/r2/frr.conf
@@ -0,0 +1,112 @@
+frr defaults traditional
+!bgp send-extra-data zebra
+!debug bgp neighbor-events
+!debug bgp zebra
+!debug bgp vnc verbose
+!debug bgp update-groups
+!debug bgp updates in
+!debug bgp updates out
+!debug bgp updates
+!debug bgp vpn label
+!debug bgp vpn leak-from-vrf
+!debug bgp vpn leak-to-vrf
+!debug bgp vpn rmap-event
+!debug zebra packet
+!debug zebra dplane
+!debug zebra kernel
+!
+interface eth0
+ ipv6 address 2001:db8:ff::2/64
+!
+interface eth1 vrf vrf10
+ ip address 192.168.2.1/24
+ ipv6 address 2001:db8:102::1/64
+!
+interface eth2 vrf vrf20
+ ip address 192.168.4.1/24
+ ipv6 address 2001:db8:104::1/64
+!
+interface eth3 vrf vrf20
+ ip address 192.168.6.1/24
+ ipv6 address 2001:db8:106::1/64
+!
+segment-routing
+ srv6
+  locators
+   locator MAIN
+    prefix fcbb:bbbb:2::/48
+    format usid-f3216
+  !
+ !
+!
+ip forwarding
+ipv6 forwarding
+!
+ipv6 route fcbb:bbbb:1::/48 2001:db8:ff::1
+!
+router bgp 65002
+ bgp router-id 192.0.2.2
+ no bgp ebgp-requires-policy
+ !no bgp default ipv4-unicast
+ neighbor 2001:db8:ff::1 remote-as 65001
+ neighbor 2001:db8:ff::1 timers 3 10
+ neighbor 2001:db8:ff::1 timers connect 1
+ neighbor 2001:db8:ff::1 capability extended-nexthop
+ !
+ address-family l2vpn evpn
+  neighbor 2001:db8:ff::1 activate
+  advertise ipv4 vpn
+  advertise ipv6 vpn
+ exit-address-family
+ !
+ segment-routing srv6
+  locator MAIN
+  encap-behavior H_Encaps_Red
+ !
+!
+router bgp 65002 vrf vrf10
+ bgp router-id 192.0.2.2
+ no bgp ebgp-requires-policy
+ sid vpn per-vrf export explicit fcbb:bbbb:2:fe10::
+ !
+ address-family ipv4 unicast
+  nexthop vpn export 2001:db8:ff::2
+  rd vpn export 65002:10
+  rt vpn both 99:99
+  import vpn
+  export vpn
+  redistribute connected
+ exit-address-family
+ !
+ address-family ipv6 unicast
+  rd vpn export 65002:10
+  rt vpn both 99:99
+  import vpn
+  export vpn
+  redistribute connected
+ exit-address-family
+!
+router bgp 65002 vrf vrf20
+ bgp router-id 192.0.2.2
+ no bgp ebgp-requires-policy
+ sid vpn per-vrf export explicit fcbb:bbbb:2:fe20::
+ !
+ address-family ipv4 unicast
+  nexthop vpn export 2001:db8:ff::2
+  rd vpn export 65002:20
+  rt vpn both 88:88
+  import vpn
+  export vpn
+  redistribute connected
+ exit-address-family
+ !
+ address-family ipv6 unicast
+  rd vpn export 65002:20
+  rt vpn both 88:88
+  import vpn
+  export vpn
+  redistribute connected
+ exit-address-family
+!
+line vty
+!
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/r2/vpnv4_rib.json b/tests/topotests/bgp_srv6_evpn_rt5/r2/vpnv4_rib.json
new file mode 100644
index 0000000000..8e744b7748
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/r2/vpnv4_rib.json
@@ -0,0 +1,166 @@
+{
+	"vrfId": 0,
+	"vrfName": "default",
+	"routerId": "192.0.2.2",
+	"defaultLocPrf": 100,
+	"localAS": 65002,
+	"routes": {
+		"routeDistinguishers": {
+			"65001:10": {
+				"192.168.1.0/24": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "192.168.1.0",
+						"prefixLen": 24,
+						"network": "192.168.1.0/24",
+						"metric": 0,
+						"weight": 0,
+						"peerId": "2001:db8:ff::1",
+						"path": "65001",
+						"origin": "incomplete",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::1",
+								"hostname": "r1",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				],
+				"192.168.3.0/24": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "192.168.3.0",
+						"prefixLen": 24,
+						"network": "192.168.3.0/24",
+						"metric": 0,
+						"weight": 0,
+						"peerId": "2001:db8:ff::1",
+						"path": "65001",
+						"origin": "incomplete",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::1",
+								"hostname": "r1",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65001:20": {
+				"192.168.5.0/24": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "192.168.5.0",
+						"prefixLen": 24,
+						"network": "192.168.5.0/24",
+						"metric": 0,
+						"weight": 0,
+						"peerId": "2001:db8:ff::1",
+						"path": "65001",
+						"origin": "incomplete",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::1",
+								"hostname": "r1",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65002:10": {
+				"192.168.2.0/24": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "192.168.2.0",
+						"prefixLen": 24,
+						"network": "192.168.2.0/24",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"nhVrfName": "vrf10",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::2",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65002:20": {
+				"192.168.4.0/24": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "192.168.4.0",
+						"prefixLen": 24,
+						"network": "192.168.4.0/24",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"nhVrfName": "vrf20",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::2",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				],
+				"192.168.6.0/24": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "192.168.6.0",
+						"prefixLen": 24,
+						"network": "192.168.6.0/24",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"nhVrfName": "vrf20",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::2",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			}
+		}
+	}
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/r2/vpnv4_rib_locator_recreated.json b/tests/topotests/bgp_srv6_evpn_rt5/r2/vpnv4_rib_locator_recreated.json
new file mode 100644
index 0000000000..8e744b7748
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/r2/vpnv4_rib_locator_recreated.json
@@ -0,0 +1,166 @@
+{
+	"vrfId": 0,
+	"vrfName": "default",
+	"routerId": "192.0.2.2",
+	"defaultLocPrf": 100,
+	"localAS": 65002,
+	"routes": {
+		"routeDistinguishers": {
+			"65001:10": {
+				"192.168.1.0/24": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "192.168.1.0",
+						"prefixLen": 24,
+						"network": "192.168.1.0/24",
+						"metric": 0,
+						"weight": 0,
+						"peerId": "2001:db8:ff::1",
+						"path": "65001",
+						"origin": "incomplete",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::1",
+								"hostname": "r1",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				],
+				"192.168.3.0/24": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "192.168.3.0",
+						"prefixLen": 24,
+						"network": "192.168.3.0/24",
+						"metric": 0,
+						"weight": 0,
+						"peerId": "2001:db8:ff::1",
+						"path": "65001",
+						"origin": "incomplete",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::1",
+								"hostname": "r1",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65001:20": {
+				"192.168.5.0/24": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "192.168.5.0",
+						"prefixLen": 24,
+						"network": "192.168.5.0/24",
+						"metric": 0,
+						"weight": 0,
+						"peerId": "2001:db8:ff::1",
+						"path": "65001",
+						"origin": "incomplete",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::1",
+								"hostname": "r1",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65002:10": {
+				"192.168.2.0/24": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "192.168.2.0",
+						"prefixLen": 24,
+						"network": "192.168.2.0/24",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"nhVrfName": "vrf10",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::2",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65002:20": {
+				"192.168.4.0/24": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "192.168.4.0",
+						"prefixLen": 24,
+						"network": "192.168.4.0/24",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"nhVrfName": "vrf20",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::2",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				],
+				"192.168.6.0/24": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "192.168.6.0",
+						"prefixLen": 24,
+						"network": "192.168.6.0/24",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"nhVrfName": "vrf20",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::2",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			}
+		}
+	}
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/r2/vpnv4_rib_locator_zebra_deleted.json b/tests/topotests/bgp_srv6_evpn_rt5/r2/vpnv4_rib_locator_zebra_deleted.json
new file mode 100644
index 0000000000..1c57788ab7
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/r2/vpnv4_rib_locator_zebra_deleted.json
@@ -0,0 +1,90 @@
+{
+	"vrfId": 0,
+	"vrfName": "default",
+	"routerId": "192.0.2.2",
+	"defaultLocPrf": 100,
+	"localAS": 65002,
+	"routes": {
+		"routeDistinguishers": {
+			"65002:10": {
+				"192.168.2.0/24": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "192.168.2.0",
+						"prefixLen": 24,
+						"network": "192.168.2.0/24",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"nhVrfName": "vrf10",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::2",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65002:20": {
+				"192.168.4.0/24": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "192.168.4.0",
+						"prefixLen": 24,
+						"network": "192.168.4.0/24",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"nhVrfName": "vrf20",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::2",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				],
+				"192.168.6.0/24": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "192.168.6.0",
+						"prefixLen": 24,
+						"network": "192.168.6.0/24",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"nhVrfName": "vrf20",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::2",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			}
+		}
+	}
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/r2/vpnv6_rib.json b/tests/topotests/bgp_srv6_evpn_rt5/r2/vpnv6_rib.json
new file mode 100644
index 0000000000..bd8e755f15
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/r2/vpnv6_rib.json
@@ -0,0 +1,169 @@
+{
+	"vrfId": 0,
+	"vrfName": "default",
+	"routerId": "192.0.2.2",
+	"defaultLocPrf": 100,
+	"localAS": 65002,
+	"routes": {
+		"routeDistinguishers": {
+			"65001:10": {
+				"2001:db8:101::/64": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "2001:db8:101::",
+						"prefixLen": 64,
+						"network": "2001:db8:101::/64",
+						"metric": 0,
+						"weight": 0,
+						"peerId": "2001:db8:ff::1",
+						"path": "65001",
+						"origin": "incomplete",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::1",
+								"hostname": "r1",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				],
+				"2001:db8:103::/64": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "2001:db8:103::",
+						"prefixLen": 64,
+						"network": "2001:db8:103::/64",
+						"metric": 0,
+						"weight": 0,
+						"peerId": "2001:db8:ff::1",
+						"path": "65001",
+						"origin": "incomplete",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::1",
+								"hostname": "r1",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65001:20": {
+				"2001:db8:105::/64": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "2001:db8:105::",
+						"prefixLen": 64,
+						"network": "2001:db8:105::/64",
+						"metric": 0,
+						"weight": 0,
+						"peerId": "2001:db8:ff::1",
+						"path": "65001",
+						"origin": "incomplete",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::1",
+								"hostname": "r1",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65002:10": {
+				"2001:db8:102::/64": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "2001:db8:102::",
+						"prefixLen": 64,
+						"network": "2001:db8:102::/64",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"announceNexthopSelf": true,
+						"nhVrfName": "vrf10",
+						"nexthops": [
+							{
+								"ip": "::",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65002:20": {
+				"2001:db8:104::/64": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "2001:db8:104::",
+						"prefixLen": 64,
+						"network": "2001:db8:104::/64",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"announceNexthopSelf": true,
+						"nhVrfName": "vrf20",
+						"nexthops": [
+							{
+								"ip": "::",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				],
+				"2001:db8:106::/64": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "2001:db8:106::",
+						"prefixLen": 64,
+						"network": "2001:db8:106::/64",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"announceNexthopSelf": true,
+						"nhVrfName": "vrf20",
+						"nexthops": [
+							{
+								"ip": "::",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			}
+		}
+	}
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/r2/vpnv6_rib_locator_recreated.json b/tests/topotests/bgp_srv6_evpn_rt5/r2/vpnv6_rib_locator_recreated.json
new file mode 100644
index 0000000000..bd8e755f15
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/r2/vpnv6_rib_locator_recreated.json
@@ -0,0 +1,169 @@
+{
+	"vrfId": 0,
+	"vrfName": "default",
+	"routerId": "192.0.2.2",
+	"defaultLocPrf": 100,
+	"localAS": 65002,
+	"routes": {
+		"routeDistinguishers": {
+			"65001:10": {
+				"2001:db8:101::/64": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "2001:db8:101::",
+						"prefixLen": 64,
+						"network": "2001:db8:101::/64",
+						"metric": 0,
+						"weight": 0,
+						"peerId": "2001:db8:ff::1",
+						"path": "65001",
+						"origin": "incomplete",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::1",
+								"hostname": "r1",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				],
+				"2001:db8:103::/64": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "2001:db8:103::",
+						"prefixLen": 64,
+						"network": "2001:db8:103::/64",
+						"metric": 0,
+						"weight": 0,
+						"peerId": "2001:db8:ff::1",
+						"path": "65001",
+						"origin": "incomplete",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::1",
+								"hostname": "r1",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65001:20": {
+				"2001:db8:105::/64": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "2001:db8:105::",
+						"prefixLen": 64,
+						"network": "2001:db8:105::/64",
+						"metric": 0,
+						"weight": 0,
+						"peerId": "2001:db8:ff::1",
+						"path": "65001",
+						"origin": "incomplete",
+						"nexthops": [
+							{
+								"ip": "2001:db8:ff::1",
+								"hostname": "r1",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65002:10": {
+				"2001:db8:102::/64": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "2001:db8:102::",
+						"prefixLen": 64,
+						"network": "2001:db8:102::/64",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"announceNexthopSelf": true,
+						"nhVrfName": "vrf10",
+						"nexthops": [
+							{
+								"ip": "::",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65002:20": {
+				"2001:db8:104::/64": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "2001:db8:104::",
+						"prefixLen": 64,
+						"network": "2001:db8:104::/64",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"announceNexthopSelf": true,
+						"nhVrfName": "vrf20",
+						"nexthops": [
+							{
+								"ip": "::",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				],
+				"2001:db8:106::/64": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "2001:db8:106::",
+						"prefixLen": 64,
+						"network": "2001:db8:106::/64",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"announceNexthopSelf": true,
+						"nhVrfName": "vrf20",
+						"nexthops": [
+							{
+								"ip": "::",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			}
+		}
+	}
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/r2/vpnv6_rib_locator_zebra_deleted.json b/tests/topotests/bgp_srv6_evpn_rt5/r2/vpnv6_rib_locator_zebra_deleted.json
new file mode 100644
index 0000000000..b183133df8
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/r2/vpnv6_rib_locator_zebra_deleted.json
@@ -0,0 +1,93 @@
+{
+	"vrfId": 0,
+	"vrfName": "default",
+	"routerId": "192.0.2.2",
+	"defaultLocPrf": 100,
+	"localAS": 65002,
+	"routes": {
+		"routeDistinguishers": {
+			"65002:10": {
+				"2001:db8:102::/64": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "2001:db8:102::",
+						"prefixLen": 64,
+						"network": "2001:db8:102::/64",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"announceNexthopSelf": true,
+						"nhVrfName": "vrf10",
+						"nexthops": [
+							{
+								"ip": "::",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			},
+			"65002:20": {
+				"2001:db8:104::/64": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "2001:db8:104::",
+						"prefixLen": 64,
+						"network": "2001:db8:104::/64",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"announceNexthopSelf": true,
+						"nhVrfName": "vrf20",
+						"nexthops": [
+							{
+								"ip": "::",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				],
+				"2001:db8:106::/64": [
+					{
+						"valid": true,
+						"bestpath": true,
+						"selectionReason": "First path received",
+						"pathFrom": "external",
+						"prefix": "2001:db8:106::",
+						"prefixLen": 64,
+						"network": "2001:db8:106::/64",
+						"metric": 0,
+						"weight": 32768,
+						"peerId": "(unspec)",
+						"path": "",
+						"origin": "incomplete",
+						"announceNexthopSelf": true,
+						"nhVrfName": "vrf20",
+						"nexthops": [
+							{
+								"ip": "::",
+								"hostname": "r2",
+								"afi": "ipv6",
+								"used": true
+							}
+						]
+					}
+				]
+			}
+		}
+	}
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/r2/vrf10v4_rib.json b/tests/topotests/bgp_srv6_evpn_rt5/r2/vrf10v4_rib.json
new file mode 100644
index 0000000000..8ae804c09a
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/r2/vrf10v4_rib.json
@@ -0,0 +1,92 @@
+{
+	"192.168.1.0/24": [
+		{
+			"prefix": "192.168.1.0/24",
+			"protocol": "bgp",
+			"vrfName": "vrf10",
+			"selected": true,
+			"destSelected": true,
+			"distance": 20,
+			"metric": 0,
+			"installed": true,
+			"table": 10,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"afi": "ipv6",
+					"interfaceName": "eth0",
+					"vrf": "default",
+					"active": true,
+					"weight": 1,
+					"seg6": {
+						"segs": "fcbb:bbbb:1:fe10::"
+					},
+					"srv6EncapBehavior": "H.Encaps.Red"
+				}
+			]
+		}
+	],
+	"192.168.2.0/24": [
+		{
+			"prefix": "192.168.2.0/24",
+			"protocol": "connected",
+			"vrfName": "vrf10",
+			"selected": true,
+			"destSelected": true,
+			"distance": 0,
+			"metric": 0,
+			"installed": true,
+			"table": 10,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"directlyConnected": true,
+					"interfaceName": "eth1",
+					"active": true
+				}
+			]
+		}
+	],
+	"192.168.3.0/24": [
+		{
+			"prefix": "192.168.3.0/24",
+			"protocol": "bgp",
+			"vrfName": "vrf10",
+			"selected": true,
+			"destSelected": true,
+			"distance": 20,
+			"metric": 0,
+			"installed": true,
+			"table": 10,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"afi": "ipv6",
+					"interfaceName": "eth0",
+					"vrf": "default",
+					"active": true,
+					"weight": 1,
+					"seg6": {
+						"segs": "fcbb:bbbb:1:fe10::"
+					},
+					"srv6EncapBehavior": "H.Encaps.Red"
+				}
+			]
+		}
+	]
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/r2/vrf10v6_rib.json b/tests/topotests/bgp_srv6_evpn_rt5/r2/vrf10v6_rib.json
new file mode 100644
index 0000000000..1a69f560c8
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/r2/vrf10v6_rib.json
@@ -0,0 +1,92 @@
+{
+	"2001:db8:101::/64": [
+		{
+			"prefix": "2001:db8:101::/64",
+			"protocol": "bgp",
+			"vrfName": "vrf10",
+			"selected": true,
+			"destSelected": true,
+			"distance": 20,
+			"metric": 0,
+			"installed": true,
+			"table": 10,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"afi": "ipv6",
+					"interfaceName": "eth0",
+					"vrf": "default",
+					"active": true,
+					"weight": 1,
+					"seg6": {
+						"segs": "fcbb:bbbb:1:fe10::"
+					},
+					"srv6EncapBehavior": "H.Encaps.Red"
+				}
+			]
+		}
+	],
+	"2001:db8:102::/64": [
+		{
+			"prefix": "2001:db8:102::/64",
+			"protocol": "connected",
+			"vrfName": "vrf10",
+			"selected": true,
+			"destSelected": true,
+			"distance": 0,
+			"metric": 0,
+			"installed": true,
+			"table": 10,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"directlyConnected": true,
+					"interfaceName": "eth1",
+					"active": true
+				}
+			]
+		}
+	],
+	"2001:db8:103::/64": [
+		{
+			"prefix": "2001:db8:103::/64",
+			"protocol": "bgp",
+			"vrfName": "vrf10",
+			"selected": true,
+			"destSelected": true,
+			"distance": 20,
+			"metric": 0,
+			"installed": true,
+			"table": 10,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"afi": "ipv6",
+					"interfaceName": "eth0",
+					"vrf": "default",
+					"active": true,
+					"weight": 1,
+					"seg6": {
+						"segs": "fcbb:bbbb:1:fe10::"
+					},
+					"srv6EncapBehavior": "H.Encaps.Red"
+				}
+			]
+		}
+	]
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/r2/vrf20v4_rib.json b/tests/topotests/bgp_srv6_evpn_rt5/r2/vrf20v4_rib.json
new file mode 100644
index 0000000000..046af4105a
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/r2/vrf20v4_rib.json
@@ -0,0 +1,86 @@
+{
+	"192.168.4.0/24": [
+		{
+			"prefix": "192.168.4.0/24",
+			"protocol": "connected",
+			"vrfName": "vrf20",
+			"selected": true,
+			"destSelected": true,
+			"distance": 0,
+			"metric": 0,
+			"installed": true,
+			"table": 20,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"directlyConnected": true,
+					"interfaceName": "eth2",
+					"active": true
+				}
+			]
+		}
+	],
+	"192.168.5.0/24": [
+		{
+			"prefix": "192.168.5.0/24",
+			"protocol": "bgp",
+			"vrfName": "vrf20",
+			"selected": true,
+			"destSelected": true,
+			"distance": 20,
+			"metric": 0,
+			"installed": true,
+			"table": 20,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"afi": "ipv6",
+					"interfaceName": "eth0",
+					"vrf": "default",
+					"active": true,
+					"weight": 1,
+					"seg6": {
+						"segs": "fcbb:bbbb:1:fe20::"
+					},
+					"srv6EncapBehavior": "H.Encaps.Red"
+				}
+			]
+		}
+	],
+	"192.168.6.0/24": [
+		{
+			"prefix": "192.168.6.0/24",
+			"protocol": "connected",
+			"vrfName": "vrf20",
+			"selected": true,
+			"destSelected": true,
+			"distance": 0,
+			"metric": 0,
+			"installed": true,
+			"table": 20,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"directlyConnected": true,
+					"interfaceName": "eth3",
+					"active": true
+				}
+			]
+		}
+	]
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/r2/vrf20v6_rib.json b/tests/topotests/bgp_srv6_evpn_rt5/r2/vrf20v6_rib.json
new file mode 100644
index 0000000000..d671a11a16
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/r2/vrf20v6_rib.json
@@ -0,0 +1,86 @@
+{
+	"2001:db8:104::/64": [
+		{
+			"prefix": "2001:db8:104::/64",
+			"protocol": "connected",
+			"vrfName": "vrf20",
+			"selected": true,
+			"destSelected": true,
+			"distance": 0,
+			"metric": 0,
+			"installed": true,
+			"table": 20,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"directlyConnected": true,
+					"interfaceName": "eth2",
+					"active": true
+				}
+			]
+		}
+	],
+	"2001:db8:105::/64": [
+		{
+			"prefix": "2001:db8:105::/64",
+			"protocol": "bgp",
+			"vrfName": "vrf20",
+			"selected": true,
+			"destSelected": true,
+			"distance": 20,
+			"metric": 0,
+			"installed": true,
+			"table": 20,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"afi": "ipv6",
+					"interfaceName": "eth0",
+					"vrf": "default",
+					"active": true,
+					"weight": 1,
+					"seg6": {
+						"segs": "fcbb:bbbb:1:fe20::"
+					},
+					"srv6EncapBehavior": "H.Encaps.Red"
+				}
+			]
+		}
+	],
+	"2001:db8:106::/64": [
+		{
+			"prefix": "2001:db8:106::/64",
+			"protocol": "connected",
+			"vrfName": "vrf20",
+			"selected": true,
+			"destSelected": true,
+			"distance": 0,
+			"metric": 0,
+			"installed": true,
+			"table": 20,
+			"internalStatus": 16,
+			"internalFlags": 8,
+			"internalNextHopNum": 1,
+			"internalNextHopActiveNum": 1,
+			"nexthops": [
+				{
+					"flags": 3,
+					"fib": true,
+					"directlyConnected": true,
+					"interfaceName": "eth3",
+					"active": true
+				}
+			]
+		}
+	]
+}
diff --git a/tests/topotests/bgp_srv6_evpn_rt5/test_bgp_srv6_evpn_rt5.py b/tests/topotests/bgp_srv6_evpn_rt5/test_bgp_srv6_evpn_rt5.py
new file mode 100644
index 0000000000..b18fafdcd2
--- /dev/null
+++ b/tests/topotests/bgp_srv6_evpn_rt5/test_bgp_srv6_evpn_rt5.py
@@ -0,0 +1,280 @@
+#!/usr/bin/env python
+# SPDX-License-Identifier: ISC
+
+# Copyright (c) 2026 by Carmine Scarpitta
+#
+# Test SRv6 L3 EVPN Type-5 (RT-5) route advertisement and forwarding.
+#
+# Two PE routers (r1, r2) run eBGP over IPv6 with l2vpn evpn address-family.
+# Each PE has two VRFs (vrf10, vrf20) with SRv6 locators.  CE routers attach
+# to the VRFs, and PE BGP instances redistribute the connected prefixes.
+#
+# The test verifies:
+#   - IPv4/IPv6 VPN RIBs contain the routes used for EVPN RT-5 advertisement
+#   - EVPN RT-5 routes appear in the l2vpn evpn table on both PEs
+#   - VRF routes are properly imported from EVPN
+#   - CE-to-CE reachability within the same VRF works end-to-end
+#   - CE-to-CE reachability across different VRFs is blocked
+#   - Deleting/re-creating the SRv6 locator via zebra withdraws/restores routes
+
+import os
+import sys
+import json
+import functools
+import pytest
+
+CWD = os.path.dirname(os.path.realpath(__file__))
+sys.path.append(os.path.join(CWD, "../"))
+
+# pylint: disable=C0413
+# Import topogen and topotest helpers
+from lib import topotest
+from lib.bgp import bgp_vpn_router_json_cmp_exact_filter
+from lib.topogen import Topogen, get_topogen
+from lib.topolog import logger
+from lib.common_config import required_linux_kernel_version
+from lib.checkping import check_ping
+
+pytestmark = [pytest.mark.bgpd]
+
+
+def build_topo(tgen):
+    tgen.add_router("r1")
+    tgen.add_router("r2")
+    tgen.add_router("ce1")
+    tgen.add_router("ce2")
+    tgen.add_router("ce3")
+    tgen.add_router("ce4")
+    tgen.add_router("ce5")
+    tgen.add_router("ce6")
+
+    tgen.add_link(tgen.gears["r1"], tgen.gears["r2"], "eth0", "eth0")
+    tgen.add_link(tgen.gears["ce1"], tgen.gears["r1"], "eth0", "eth1")
+    tgen.add_link(tgen.gears["ce2"], tgen.gears["r2"], "eth0", "eth1")
+    tgen.add_link(tgen.gears["ce3"], tgen.gears["r1"], "eth0", "eth2")
+    tgen.add_link(tgen.gears["ce4"], tgen.gears["r2"], "eth0", "eth2")
+    tgen.add_link(tgen.gears["ce5"], tgen.gears["r1"], "eth0", "eth3")
+    tgen.add_link(tgen.gears["ce6"], tgen.gears["r2"], "eth0", "eth3")
+
+
+def setup_module(mod):
+    result = required_linux_kernel_version("6.1")
+    if result is not True:
+        pytest.skip("Kernel requirements are not met")
+
+    # This topotest sets net.vrf.strict_mode during setup. That sysctl is
+    # available only after the VRF module is loaded; if the module is not loaded,
+    # the strict_mode command may fail and the test can fail later.
+    # Ensure the VRF module is present and loaded before setting strict_mode.
+    if not topotest.module_present("vrf"):
+        pytest.skip("VRF kernel module is not available")
+
+    tgen = Topogen(build_topo, mod.__name__)
+    tgen.start_topology()
+    for rname, router in tgen.routers().items():
+        if os.path.exists("{}/{}/setup.sh".format(CWD, rname)):
+            router.run("/bin/bash {}/{}/setup.sh".format(CWD, rname))
+        router.load_frr_config(os.path.join(CWD, "{}/frr.conf".format(rname)))
+
+    tgen.gears["r1"].run("sysctl net.vrf.strict_mode=1")
+    tgen.gears["r1"].run("ip link add vrf10 type vrf table 10")
+    tgen.gears["r1"].run("ip link set vrf10 up")
+    tgen.gears["r1"].run("ip link add vrf20 type vrf table 20")
+    tgen.gears["r1"].run("ip link set vrf20 up")
+    tgen.gears["r1"].run("ip link set eth1 master vrf10")
+    tgen.gears["r1"].run("ip link set eth2 master vrf10")
+    tgen.gears["r1"].run("ip link set eth3 master vrf20")
+
+    tgen.gears["r2"].run("sysctl net.vrf.strict_mode=1")
+    tgen.gears["r2"].run("ip link add vrf10 type vrf table 10")
+    tgen.gears["r2"].run("ip link set vrf10 up")
+    tgen.gears["r2"].run("ip link add vrf20 type vrf table 20")
+    tgen.gears["r2"].run("ip link set vrf20 up")
+    tgen.gears["r2"].run("ip link set eth1 master vrf10")
+    tgen.gears["r2"].run("ip link set eth2 master vrf20")
+    tgen.gears["r2"].run("ip link set eth3 master vrf20")
+    tgen.start_router()
+
+
+def teardown_module(mod):
+    tgen = get_topogen()
+    tgen.stop_topology()
+
+
+def open_json_file(filename):
+    try:
+        with open(filename, "r") as f:
+            return json.load(f)
+    except IOError:
+        assert False, "Could not read file {}".format(filename)
+
+
+def check_rib(name, cmd, expected_file, count=20, wait=3):
+    def _check(router, cmd, expected):
+        logger.info("polling")
+        output = json.loads(router.vtysh_cmd(cmd))
+        return topotest.json_cmp(output, expected)
+
+    logger.info('[+] check {} "{}" {}'.format(name, cmd, expected_file))
+    tgen = get_topogen()
+    router = tgen.gears[name]
+    expected = open_json_file("{}/{}".format(CWD, expected_file))
+    if "show bgp ipv4 vpn" in cmd or "show bgp ipv6 vpn" in cmd:
+        func = functools.partial(
+            bgp_vpn_router_json_cmp_exact_filter, router, cmd, expected
+        )
+    else:
+        func = functools.partial(_check, router, cmd, expected)
+    _, result = topotest.run_and_expect(func, None, count, wait)
+    assert result is None, "Failed"
+
+
+def check_vpn_ribs(expected_suffix=""):
+    suffix = "_{}".format(expected_suffix) if expected_suffix else ""
+    check_rib(
+        "r1", "show bgp ipv4 vpn json", "r1/vpnv4_rib{}.json".format(suffix)
+    )
+    check_rib(
+        "r2", "show bgp ipv4 vpn json", "r2/vpnv4_rib{}.json".format(suffix)
+    )
+    check_rib(
+        "r1", "show bgp ipv6 vpn json", "r1/vpnv6_rib{}.json".format(suffix)
+    )
+    check_rib(
+        "r2", "show bgp ipv6 vpn json", "r2/vpnv6_rib{}.json".format(suffix)
+    )
+
+
+def test_rib():
+    """Verify EVPN RT-5 routes and VRF route tables on both PEs."""
+    tgen = get_topogen()
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    check_rib("r1", "show bgp l2vpn evpn json", "r1/evpn_rib.json")
+    check_rib("r2", "show bgp l2vpn evpn json", "r2/evpn_rib.json")
+
+    check_vpn_ribs()
+
+    check_rib("r1", "show ip route vrf vrf10 json", "r1/vrf10v4_rib.json")
+    check_rib("r1", "show ip route vrf vrf20 json", "r1/vrf20v4_rib.json")
+    check_rib("r2", "show ip route vrf vrf10 json", "r2/vrf10v4_rib.json")
+    check_rib("r2", "show ip route vrf vrf20 json", "r2/vrf20v4_rib.json")
+
+    check_rib("r1", "show ipv6 route vrf vrf10 json", "r1/vrf10v6_rib.json")
+    check_rib("r1", "show ipv6 route vrf vrf20 json", "r1/vrf20v6_rib.json")
+    check_rib("r2", "show ipv6 route vrf vrf10 json", "r2/vrf10v6_rib.json")
+    check_rib("r2", "show ipv6 route vrf vrf20 json", "r2/vrf20v6_rib.json")
+
+    check_rib("ce1", "show ip route json", "ce1/ip_rib.json")
+    check_rib("ce2", "show ip route json", "ce2/ip_rib.json")
+    check_rib("ce3", "show ip route json", "ce3/ip_rib.json")
+    check_rib("ce4", "show ip route json", "ce4/ip_rib.json")
+    check_rib("ce5", "show ip route json", "ce5/ip_rib.json")
+    check_rib("ce6", "show ip route json", "ce6/ip_rib.json")
+
+    check_rib("ce1", "show ipv6 route json", "ce1/ipv6_rib.json")
+    check_rib("ce2", "show ipv6 route json", "ce2/ipv6_rib.json")
+    check_rib("ce3", "show ipv6 route json", "ce3/ipv6_rib.json")
+    check_rib("ce4", "show ipv6 route json", "ce4/ipv6_rib.json")
+    check_rib("ce5", "show ipv6 route json", "ce5/ipv6_rib.json")
+    check_rib("ce6", "show ipv6 route json", "ce6/ipv6_rib.json")
+
+
+def test_ping():
+    """Verify CE-to-CE reachability within the same VRF (and isolation across VRFs)."""
+    tgen = get_topogen()
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    # ce1 (r1/vrf10) reaches ce2 (r2/vrf10) and ce3 (r1/vrf10)
+    check_ping("ce1", "192.168.2.2", True, 20, 3)
+    check_ping("ce1", "192.168.3.2", True, 20, 3)
+    # ce1 cannot reach vrf20 CEs
+    check_ping("ce1", "192.168.4.2", False, 20, 3)
+    check_ping("ce1", "192.168.5.2", False, 20, 3)
+    check_ping("ce1", "192.168.6.2", False, 20, 3)
+
+    # ce4 (r2/vrf20) reaches ce5 (r1/vrf20) and ce6 (r2/vrf20)
+    check_ping("ce4", "192.168.5.2", True, 20, 3)
+    check_ping("ce4", "192.168.6.2", True, 20, 3)
+    # ce4 cannot reach vrf10 CEs
+    check_ping("ce4", "192.168.1.2", False, 20, 3)
+    check_ping("ce4", "192.168.2.2", False, 20, 3)
+    check_ping("ce4", "192.168.3.2", False, 20, 3)
+
+    # IPv6
+    check_ping("ce1", "2001:db8:102::2", True, 20, 3)
+    check_ping("ce1", "2001:db8:103::2", True, 20, 3)
+    check_ping("ce1", "2001:db8:104::2", False, 20, 3)
+    check_ping("ce1", "2001:db8:105::2", False, 20, 3)
+    check_ping("ce1", "2001:db8:106::2", False, 20, 3)
+
+    check_ping("ce4", "2001:db8:105::2", True, 20, 3)
+    check_ping("ce4", "2001:db8:106::2", True, 20, 3)
+    check_ping("ce4", "2001:db8:101::2", False, 20, 3)
+    check_ping("ce4", "2001:db8:102::2", False, 20, 3)
+    check_ping("ce4", "2001:db8:103::2", False, 20, 3)
+
+
+def test_locator_delete():
+    """Deleting the SRv6 locator in zebra should withdraw EVPN RT-5 routes."""
+    tgen = get_topogen()
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    check_ping("ce1", "192.168.2.2", True, 20, 3)
+    check_ping("ce1", "2001:db8:102::2", True, 20, 3)
+    tgen.gears["r1"].vtysh_cmd(
+        """
+        configure terminal
+         segment-routing
+          srv6
+           locators
+            no locator MAIN
+        """
+    )
+    check_vpn_ribs("locator_zebra_deleted")
+    check_rib(
+        "r1", "show bgp l2vpn evpn json", "r1/evpn_rib_locator_zebra_deleted.json"
+    )
+    check_rib(
+        "r2", "show bgp l2vpn evpn json", "r2/evpn_rib_locator_zebra_deleted.json"
+    )
+    check_ping("ce1", "192.168.2.2", False, 20, 3)
+    check_ping("ce1", "2001:db8:102::2", False, 20, 3)
+
+
+def test_locator_recreate():
+    """Re-creating the SRv6 locator should restore EVPN RT-5 routes."""
+    tgen = get_topogen()
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    check_ping("ce1", "192.168.2.2", False, 20, 3)
+    check_ping("ce1", "2001:db8:102::2", False, 20, 3)
+    tgen.gears["r1"].vtysh_cmd(
+        """
+        configure terminal
+         segment-routing
+          srv6
+           locators
+            locator MAIN
+             prefix fcbb:bbbb:1::/48
+             format usid-f3216
+        """
+    )
+    check_vpn_ribs("locator_recreated")
+    check_rib(
+        "r1", "show bgp l2vpn evpn json", "r1/evpn_rib_locator_recreated.json"
+    )
+    check_rib(
+        "r2", "show bgp l2vpn evpn json", "r2/evpn_rib_locator_recreated.json"
+    )
+    check_ping("ce1", "192.168.2.2", True, 20, 3)
+    check_ping("ce1", "2001:db8:102::2", True, 20, 3)
+
+
+if __name__ == "__main__":
+    args = ["-s"] + sys.argv[1:]
+    sys.exit(pytest.main(args))