VXLAN Multicast Anycast RP
VXLAN Multicast Anycast RP
In the VXLAN Flood and Learn Multicast Data Plane lesson, we con!gured VXLAN
VXLAN "ood Anycast
Multicast and
RP
learn using multicast. This worked, but we had a single spine switch con!gured as the static
VXLAN MP-BGP EVPN L2 VNI
Rendezvous Point (RP). If you don’t want a single point of failure, you can add a second spine
VXLAN MP-BGP EVPN L3 VNI
switch. This introduces another issue: which spine switch should be the RP?
MP-BGP EVPN VXLAN ARP
Suppression
You can con!gure RP redundancy with protocols like auto-RP or bootstrap. However, failover
VXLAN Underlay OSPF
for these protocols is not very fast.
Another option is anycast RP. This is a technique where multiple devices act as a single RP
using the same IP address. However, this also introduces an issue. Leaf switches have two
uplinks, one to each spine switch. It’s possible that some leaf switches join one spine switch,
and others join the second spine switch. This is not random; we use a hashing algorithm to
decide which uplink to use:
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 1 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
default 1 0x00000001 3 1 1 1
Up
Multipath configuration (1): s-g-hash
Resilient configuration: Disabled
ECMP multicast uses the s-g-hash based on the source and group address. This hashing
algorithm is predictable because it does not use random values.
We need something that can synchronize information between RPs. There are two protocols
we can use for this:
Cisco Nexus switches can use anycast RP without MSDP. PIM messages will be exchanged
between spine switches so all spine switches know about the multicast sources. In this lesson,
I’ll explain how to con!gure anycast RP and we’ll do a packet capture to see it in action.
1. Configuration
This is the topology we’ll use:
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 2 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
We’ll need two spine switches. I’m using Cisco NX-OS 9000v version 9.3(9) on the switches. The
hosts (S1 and S2) are simple Ubuntu containers because they only need to send some ICMP
tra#c between each other.
I use static MAC addresses on all devices so that it’s easier to debug and do a packet capture.
All MAC addresses look like 0050.c253.X00Y, where X is the device number and Y is the
interface number.
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 3 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
Also, since we already con!gured the underlay and overlay in the VXLAN "ood and learn
multicast lesson, I’m focusing only on the con!guration of anycast RP in this lesson. We start
with a pre-con!gured underlay/overlay network.
14:05
Con!gurations
Want to take a look for yourself? Here, you will !nd the startup con!guration of each device.
You can also download the containerlab topology.
LEAF1
hostname LEAF1
feature ospf
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 4 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
feature pim
feature vn-segment-vlan-based
feature nv overlay
vlan 10
vn-segment 10010
interface nve1
no shutdown
source-interface loopback0
member vni 10010
mcast-group 239.1.1.1
interface Ethernet1/1
no switchport
mac-address 0050.c253.3001
ip address 192.168.13.3/24
ip ospf network point-to-point
ip router ospf 1 area 0.0.0.0
ip pim sparse-mode
no shutdown
interface Ethernet1/2
no switchport
mac-address 0050.c253.3002
ip address 192.168.23.3/24
ip ospf network point-to-point
ip router ospf 1 area 0.0.0.0
ip pim sparse-mode
no shutdown
interface Ethernet1/3
no shutdown
switchport access vlan 10
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 5 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
interface loopback0
ip address 3.3.3.3/32
ip router ospf 1 area 0.0.0.0
ip pim sparse-mode
router ospf 1
LEAF2
hostname LEAF2
feature ospf
feature pim
feature vn-segment-vlan-based
feature nv overlay
vlan 10
vn-segment 10010
interface nve1
no shutdown
source-interface loopback0
member vni 10010
mcast-group 239.1.1.1
interface Ethernet1/1
no switchport
mac-address 0050.c253.4001
ip address 192.168.14.4/24
ip ospf network point-to-point
ip router ospf 1 area 0.0.0.0
ip pim sparse-mode
no shutdown
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 6 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
interface Ethernet1/2
no switchport
mac-address 0050.c253.4002
ip address 192.168.24.4/24
ip ospf network point-to-point
ip router ospf 1 area 0.0.0.0
ip pim sparse-mode
no shutdown
interface Ethernet1/3
no shutdown
switchport access vlan 10
interface loopback0
ip address 4.4.4.4/32
ip router ospf 1 area 0.0.0.0
ip pim sparse-mode
router ospf 1
SPINE1
hostname SPINE1
feature ospf
feature pim
interface Ethernet1/1
no switchport
mac-address 0050.c253.1001
ip address 192.168.13.1/24
ip ospf network point-to-point
ip router ospf 1 area 0.0.0.0
ip pim sparse-mode
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 7 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
no shutdown
interface Ethernet1/2
no switchport
mac-address 0050.c253.1002
ip address 192.168.14.1/24
ip ospf network point-to-point
ip router ospf 1 area 0.0.0.0
ip pim sparse-mode
no shutdown
interface loopback0
ip address 1.1.1.1/32
ip router ospf 1 area 0.0.0.0
ip pim sparse-mode
router ospf 1
SPINE2
hostname SPINE2
feature ospf
feature pim
interface Ethernet1/1
no switchport
mac-address 0050.c253.2001
ip address 192.168.23.2/24
ip ospf network point-to-point
ip router ospf 1 area 0.0.0.0
ip pim sparse-mode
no shutdown
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 8 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
interface Ethernet1/2
no switchport
mac-address 0050.c253.2002
ip address 192.168.24.2/24
ip ospf network point-to-point
ip router ospf 1 area 0.0.0.0
ip pim sparse-mode
no shutdown
interface loopback0
ip address 2.2.2.2/32
ip router ospf 1 area 0.0.0.0
ip pim sparse-mode
router ospf 1
The con!guration is almost identical to when we used multicast with a single RP. To con!gure
anycast RP, we need to do this:
Create a new loopback interface on the spine switches with the IP address we want to
use for anycast RP.
Enable OSPF on this loopback.
Enable PIM on this loopback.
Con!gure the spine switches to use the IP address on the new loopback interface as RP.
Con!gure all IP addresses of the spine switches for the anycast RP set.
Con!gure all switches to use the anycast RP address.
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 9 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
We’ll use 12.12.12.12 as the RP address. The spine switches still need a unique IP address on
their loopback 0 interfaces because they use this to communicate with each other.
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 10 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
2. Verification
Let’s make sure we have PIM neighbors:
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 11 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
n/a no
192.168.24.4 Ethernet1/2 1d01h 00:01:43 1 yes
n/a no
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 12 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
SPINE1 and SPINE2 know about the RP address, and they know about each other. This is what
the leaf switches think of it:
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 13 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
The leaf switches use 12.12.12.12 as the RP. Here are the multicast routing tables:
you can see LEAF1 and LEAF2 as a source for 239.1.1.1. Same thing on SPINE2:
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 14 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
Both spine switches have learned that LEAF1 and LEAF2 are sources. Let’s check the leaf
switches:
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 15 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
Everything is looking good. At the moment, the leaf switches don’t know about each other as
NVE peers:
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 16 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
^C
--- 172.16.12.2 ping statistics ---
5 packets transmitted, 2 received, +3 errors, 42.8571% packet loss,
time 6065ms
rtt min/avg/max/mdev = 3.559/4.567/6.978/1.399 ms, pipe 3
Courses
LEAF2# Forum
show Support
nve peers Tools Search …
3. Packet Capture
The big question remains…when one spine switch receives a PIM packet and learns about a
source, how does the other spine switch learn this too? We can answer that by doing a packet
capture.
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 17 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
10:32
Besides the packet capture, enabling debug ip pim data-register and debug
ip pim data-register receive will show you the decisions of the spine
switches when they receive a PIM packet.
I’ll capture both interfaces on the spine switches. To start with a clean slate, we’ll shut the
interfaces that connect to the hosts and the NVE interfaces:
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 18 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
(config-if)# shutdown
This will cause LEAF1 to register itself with one of the two spine switches.
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 19 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
Unicast: 192.168.23.2
Reserved byte(s): 00
Num Groups: 1
Holdtime: 210
Group 0
Group 0: 239.1.1.1/32
Address Family: IPv4 (1)
Encoding Type: Native (0)
Flags: 0x00
Masklen: 32
Group: 239.1.1.1
Num Joins: 1
IP address: 12.12.12.12/32 (SWR)
Address Family: IPv4 (1)
Encoding Type: Native (0)
Flags: 0x07, Sparse, WildCard, Rendezvous Point
Tree
Masklen: 32
Source: 12.12.12.12
Num Prunes: 1
IP address: 3.3.3.3/32 (SR)
Address Family: IPv4 (1)
Encoding Type: Native (0)
Flags: 0x05, Sparse, Rendezvous Point Tree
Masklen: 32
Source: 3.3.3.3
This PIM join is sent to SPINE2 because of the hashing algorithm. You can see this by looking
at the Upstream-neighbor !eld, which shows 192.168.23.2. This is how LEAF1 joins the RPT.
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 20 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 21 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
Flags: 0x40000000
0100 .... = IP Version: IPv4 (4)
Internet Protocol Version 4, Src: 3.3.3.3, Dst: 239.1.1.1
The PIM register is a unicast packet sent to the anycast RP address (12.12.12.12) and, because
of the hashing algorithm, ends up at SPINE1. We can see this because the destination MAC
address is 00:50:c2:53:10:01.
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 22 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
SPINE1 (00:50:c2:53:10:01) will tell LEAF1 to stop sending multicast tra#c to the group. The
source is the anycast RP address, and the destination is LEAF1’s loopback.
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 23 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 24 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
Above, we see the PIM register from SPINE1 to SPINE2 that goes through LEAF2.
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 25 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 26 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
Con!gurations
Want to take a look for yourself? Here, you will !nd the !nal con!guration of each device.
LEAF1
hostname LEAF1
feature ospf
feature pim
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 27 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
feature vn-segment-vlan-based
feature nv overlay
vlan 10
vn-segment 10010
interface nve1
no shutdown
source-interface loopback0
member vni 10010
mcast-group 239.1.1.1
interface Ethernet1/1
no switchport
mac-address 0050.c253.3001
ip address 192.168.13.3/24
ip ospf network point-to-point
ip router ospf 1 area 0.0.0.0
ip pim sparse-mode
no shutdown
interface Ethernet1/2
no switchport
mac-address 0050.c253.3002
ip address 192.168.23.3/24
ip ospf network point-to-point
ip router ospf 1 area 0.0.0.0
ip pim sparse-mode
no shutdown
interface Ethernet1/3
no shutdown
switchport access vlan 10
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 28 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
interface loopback0
ip address 3.3.3.3/32
ip router ospf 1 area 0.0.0.0
ip pim sparse-mode
router ospf 1
LEAF2
hostname LEAF2
feature ospf
feature pim
feature vn-segment-vlan-based
feature nv overlay
vlan 10
vn-segment 10010
interface nve1
no shutdown
source-interface loopback0
member vni 10010
mcast-group 239.1.1.1
interface Ethernet1/1
no switchport
mac-address 0050.c253.4001
ip address 192.168.14.4/24
ip ospf network point-to-point
ip router ospf 1 area 0.0.0.0
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 29 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
ip pim sparse-mode
no shutdown
interface Ethernet1/2
no switchport
mac-address 0050.c253.4002
ip address 192.168.24.4/24
ip ospf network point-to-point
ip router ospf 1 area 0.0.0.0
ip pim sparse-mode
no shutdown
interface Ethernet1/3
no shutdown
switchport access vlan 10
interface loopback0
ip address 4.4.4.4/32
ip router ospf 1 area 0.0.0.0
ip pim sparse-mode
router ospf 1
SPINE1
hostname SPINE1
feature ospf
feature pim
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 30 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
interface Ethernet1/1
no switchport
mac-address 0050.c253.1001
ip address 192.168.13.1/24
ip ospf network point-to-point
ip router ospf 1 area 0.0.0.0
ip pim sparse-mode
no shutdown
interface Ethernet1/2
no switchport
mac-address 0050.c253.1002
ip address 192.168.14.1/24
ip ospf network point-to-point
ip router ospf 1 area 0.0.0.0
ip pim sparse-mode
no shutdown
interface loopback0
ip address 1.1.1.1/32
ip router ospf 1 area 0.0.0.0
ip pim sparse-mode
interface loopback1
ip address 12.12.12.12/32
ip router ospf 1 area 0.0.0.0
ip pim sparse-mode
router ospf 1
SPINE2
hostname SPINE2
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 31 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
feature ospf
feature pim
interface Ethernet1/1
no switchport
mac-address 0050.c253.2001
ip address 192.168.23.2/24
ip ospf network point-to-point
ip router ospf 1 area 0.0.0.0
ip pim sparse-mode
no shutdown
interface Ethernet1/2
no switchport
mac-address 0050.c253.2002
ip address 192.168.24.2/24
ip ospf network point-to-point
ip router ospf 1 area 0.0.0.0
ip pim sparse-mode
no shutdown
interface loopback0
ip address 2.2.2.2/32
ip router ospf 1 area 0.0.0.0
ip pim sparse-mode
interface loopback1
ip address 12.12.12.12/32
ip router ospf 1 area 0.0.0.0
ip pim sparse-mode
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 32 of 33
VXLAN Multicast Anycast RP 07/02/25, 6:38 PM
router ospf 1
4. Conclusion
That’s it. You have now learned how to con!gure Anycast RP for VXLAN:
Spine switches require an additional loopback with the IP address you want to use for
anycast RP.
You need to enable PIM and OSPF on this interface.
Spine switches still require a unique IP address on a separate loopback because they’ll
use this to communicate with each other.
Spine switches forward PIM messages to each other (all switches in the RP set) so that
they all know about the di%erent multicast sources.
I hope you enjoyed this lesson. If you have any questions, please leave a comment. If you want
to learn more details about Anycast RP using PIM only, take a look at RFC 4610.
« Previous Lesson
VXLAN Flood and Learn
Multicast Data Plane
Next Lesson
VXLAN MP-BGP EVPN L2 VNI »
https://networklessons.com/vxlan/vxlan-multicast-anycast-rp Page 33 of 33