On the network shown in Figure 1, PE1, PE2, and P are backbone devices. CE1 and CE2 are egress devices of two branch networks and belong to VPN instance vpna. MD-based multicast VPN needs to be configured to enable receivers at site2 to receive multicast data traffic of group 225.1.1.1 from site1.
The configuration roadmap is as follows:
# Configure PE1.
[PE1] interface eth-trunk 10
[PE1-Eth-Trunk10] service type multicast-tunnel
[PE1-Eth-Trunk10] trunkport gigabitethernet 0/0/5
[PE1-Eth-Trunk10] quit
[PE1] ip vpn-instance vpna
[PE1-vpn-instance-vpna] multicast routing-enable
[PE1-vpn-instance-vpna] multicast-domain share-group 239.1.1.1 binding mtunnel 0
[PE1-vpn-instance-vpna] ipv4-family
[PE1-vpn-instance-vpna-af-ipv4] multicast-domain source-interface loopback 0
[PE1-vpn-instance-vpna-af-ipv4] quit
[PE1-vpn-instance-vpna] quit
# Configure PE2.
[PE2] interface eth-trunk 10
[PE2-Eth-Trunk10] service type multicast-tunnel
[PE2-Eth-Trunk10] trunkport gigabitethernet 0/0/5
[PE2-Eth-Trunk10] quit
[PE2] ip vpn-instance vpna
[PE2-vpn-instance-vpna] multicast routing-enable
[PE2-vpn-instance-vpna] multicast-domain share-group 239.1.1.1 binding mtunnel 0
[PE2-vpn-instance-vpna] ipv4-family
[PE2-vpn-instance-vpna-af-ipv4] multicast-domain source-interface loopback 0
[PE2-vpn-instance-vpna-af-ipv4] quit
[PE2-vpn-instance-vpna] quit
After the preceding configuration is complete, receivers can receive multicast data from the multicast source.
PE1 configuration file
# sysname PE1 # router id 1.1.1.1 # vlan batch 11 100 # multicast routing-enable # ip vpn-instance vpna ipv4-family route-distinguisher 100:1 vpn-target 111:1 export-extcommunity vpn-target 111:1 import-extcommunity multicast routing-enable multicast-domain source-interface LoopBack0 multicast-domain share-group 239.1.1.1 binding mtunnel 0 # mpls lsr-id 1.1.1.1 mpls # mpls ldp # interface Vlanif11 ip binding vpn-instance vpna ip address 10.1.1.1 255.255.255.0 pim sm # interface Vlanif100 ip address 172.16.1.1 255.255.255.0 pim sm mpls mpls ldp # interface Eth-Trunk10 service type multicast-tunnel # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 11 # interface GigabitEthernet0/0/2 port link-type trunk port trunk allow-pass vlan 100 # interface GigabitEthernet0/0/5 eth-trunk 10 # interface LoopBack0 ip address 1.1.1.1 255.255.255.255 pim sm # interface MTunnel0 ip binding vpn-instance vpna # bgp 100 peer 2.2.2.2 as-number 100 peer 2.2.2.2 connect-interface LoopBack0 # ipv4-family unicast undo synchronization peer 2.2.2.2 enable # ipv4-family vpnv4 policy vpn-target peer 2.2.2.2 enable # ipv4-family vpn-instance vpna import-route ospf 2 # ospf 1 area 0.0.0.0 network 1.1.1.1 0.0.0.0 network 172.16.1.0 0.0.0.255 # ospf 2 vpn-instance vpna import-route bgp area 0.0.0.0 network 10.1.1.0 0.0.0.255 # return
PE2 configuration file
# sysname PE2 # router id 2.2.2.2 # vlan batch 22 200 # multicast routing-enable # ip vpn-instance vpna ipv4-family route-distinguisher 100:1 vpn-target 111:1 export-extcommunity vpn-target 111:1 import-extcommunity multicast routing-enable multicast-domain source-interface LoopBack0 multicast-domain share-group 239.1.1.1 binding mtunnel 0 # mpls lsr-id 2.2.2.2 mpls # mpls ldp # interface Vlanif22 ip binding vpn-instance vpna ip address 10.1.2.1 255.255.255.0 pim sm # interface Vlanif200 ip address 172.17.1.1 255.255.255.0 pim sm mpls mpls ldp # interface Eth-Trunk10 service type multicast-tunnel # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 22 # interface GigabitEthernet0/0/2 port link-type trunk port trunk allow-pass vlan 200 # interface GigabitEthernet0/0/5 eth-trunk 10 # interface LoopBack0 ip address 2.2.2.2 255.255.255.255 pim sm # interface MTunnel0 ip binding vpn-instance vpna # bgp 100 peer 1.1.1.1 as-number 100 peer 1.1.1.1 connect-interface LoopBack0 # ipv4-family unicast undo synchronization peer 1.1.1.1 enable # ipv4-family vpnv4 policy vpn-target peer 1.1.1.1 enable # ipv4-family vpn-instance vpna import-route ospf 2 # ospf 1 area 0.0.0.0 network 2.2.2.2 0.0.0.0 network 172.17.1.0 0.0.0.255 # ospf 2 vpn-instance vpna import-route bgp area 0.0.0.0 network 10.1.2.0 0.0.0.255 # return
P configuration file
# sysname P # router id 3.3.3.3 # vlan batch 100 200 # multicast routing-enable # mpls lsr-id 3.3.3.3 mpls # mpls ldp # interface Vlanif100 ip address 172.16.1.2 255.255.255.0 pim sm mpls mpls ldp # interface Vlanif200 ip address 172.17.1.2 255.255.255.0 pim sm mpls mpls ldp # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 100 # interface GigabitEthernet0/0/2 port link-type trunk port trunk allow-pass vlan 200 # interface LoopBack0 ip address 3.3.3.3 255.255.255.255 pim sm # ospf 1 area 0.0.0.0 network 3.3.3.3 0.0.0.0 network 172.16.1.0 0.0.0.255 network 172.17.1.0 0.0.0.255 # pim c-bsr LoopBack0 c-rp LoopBack0 # return
CE1 configuration file
# sysname CE1 # vlan batch 10 to 11 # multicast routing-enable # interface Vlanif10 ip address 10.138.1.2 255.255.255.0 pim sm # interface Vlanif11 ip address 10.1.1.2 255.255.255.0 pim sm # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 11 # interface GigabitEthernet0/0/2 port link-type hybrid port hybrid pvid vlan 10 port hybrid untagged vlan 10 # ospf 1 area 0.0.0.0 network 10.1.1.0 0.0.0.255 network 10.138.1.0 0.0.0.255 # pim c-bsr Vlanif11 c-rp Vlanif11 # return
CE2 configuration file
# sysname CE2 # vlan batch 20 22 # multicast routing-enable # interface Vlanif20 ip address 10.138.2.2 255.255.255.0 pim sm igmp enable # interface Vlanif22 ip address 10.1.2.2 255.255.255.0 pim sm # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 22 # interface GigabitEthernet0/0/2 port link-type hybrid port hybrid pvid vlan 20 port hybrid untagged vlan 20 # ospf 1 area 0.0.0.0 network 10.1.2.0 0.0.0.255 network 10.138.2.0 0.0.0.255 # return