Example for Configuring Multicast on a BGP/MPLS IP VPN network
Networking Requirements
As shown in Figure 7-18, users in vpna site2 want to receive multicast data from 225.1.1.1 in vpna site1. A Generic Routing Encapsulation (GRE) tunnel can be established between PE1 and PE2 so that multicast packets from the private network are encapsulated over the GRE tunnel and then transmitted on the public network.
Configuration Roadmap
The configuration roadmap is as follows:
Configure a GRE tunnel.
Configure multicast functions, including Protocol Independent Multicast (PIM) and Internet Group Management Protocol (IGMP).
The GRE tunnel interface and the PE interface connected to the CE must use the same PIM configuration. Protocol Independent Multicast Sparse Mode (PIM-SM) is used in this example.
Procedure
- Configure a public routing protocol so that there is a reachable route between the PE and the P.
The configurations of the P and PE2 are similar to the configuration on PE1. The configuration of PE1 is used as an example.
# Configure PE1.
<Huawei> system-view [Huawei] sysname PE1 [PE1] interface gigabitethernet 2/0/0 [PE1-GigabitEthernet2/0/0] ip address 172.1.1.1 24 [PE1-GigabitEthernet2/0/0] quit [PE1] interface loopback 0 [PE1-LoopBack0] ip address 10.10.1.1 32 [PE1-LoopBack0] quit [PE1] ospf 1 [PE1-ospf-1] area 0 [PE1-ospf-1-area-0.0.0.0] network 172.1.1.0 0.0.0.255 [PE1-ospf-1-area-0.0.0.0] network 10.10.1.1 0.0.0.0 [PE1-ospf-1-area-0.0.0.0] quit [PE1-ospf-1] quit
After the configuration is complete, OSPF neighbor relationships can be set up between PE1 and P, and between P and PE2. Run the display ospf peer command. You can see that the neighbor status is Full. Run the display ip routing-table command on the PEs. You can see that the PEs can learn the routes on LoopBack0 of each other.
- Configure basic MPLS functions and LDP, and set up LDP LSPs.
The configurations of P and PE2 are similar to the configuration on PE1. The configuration of PE1 is used as an example.
# Configure PE1.
[PE1] mpls lsr-id 10.10.1.1 [PE1] mpls [PE1-mpls] quit [PE1] mpls ldp [PE1-mpls-ldp] quit [PE1] interface gigabitethernet 2/0/0 [PE1-GigabitEthernet2/0/0] mpls [PE1-GigabitEthernet2/0/0] mpls ldp [PE1-GigabitEthernet2/0/0] quit
After the configuration is complete, LDP sessions can be set up between PE1 and the P and between the P and PE2. Run the display mpls ldp session command. You can view that the Status field is Operational.
- Set up an MP-IBGP peer relationship between PEs.
# Configure PE1.
[PE1] bgp 100 [PE1-bgp] peer 10.10.1.2 as-number 100 [PE1-bgp] peer 10.10.1.2 connect-interface loopback 0 [PE1-bgp] ipv4-family vpnv4 [PE1-bgp-af-vpnv4] peer 10.10.1.2 enable [PE1-bgp-af-vpnv4] quit [PE1-bgp] quit
# Configure PE2.
[PE2] bgp 100 [PE2-bgp] peer 10.10.1.1 as-number 100 [PE2-bgp] peer 10.10.1.1 connect-interface loopback 0 [PE2-bgp] ipv4-family vpnv4 [PE2-bgp-af-vpnv4] peer 10.10.1.1 enable [PE2-bgp-af-vpnv4] quit [PE2-bgp] quit
After the configuration is complete, run the display bgp peer or display bgp vpnv4 all peer command on PEs. You can see that the BGP peer relationships have been established between the PEs.
- Configure VPN instances on the PEs and connect the CEs to the PEs.
# Configure PE1.
[PE1] ip vpn-instance vpna [PE1-vpn-instance-vpna] ipv4-family [PE1-vpn-instance-vpna-af-ipv4] route-distinguisher 100:1 [PE1-vpn-instance-vpna-af-ipv4] vpn-target 111:1 both [PE1-vpn-instance-vpna-af-ipv4] quit [PE1-vpn-instance-vpna] quit [PE1] interface serial 1/0/0 [PE1-Serial1/0/0] ip binding vpn-instance vpna [PE1-Serial1/0/0] ip address 10.1.1.1 24 [PE1-Serial1/0/0] quit
# Configure PE2.
[PE2] ip vpn-instance vpna [PE2-vpn-instance-vpna] ipv4-family [PE2-vpn-instance-vpna-af-ipv4] route-distinguisher 100:1 [PE2-vpn-instance-vpna-af-ipv4] vpn-target 111:1 both [PE2-vpn-instance-vpna-af-ipv4] quit [PE2-vpn-instance-vpna] quit [PE2] interface serial 1/0/0 [PE2-Serial1/0/0] ip binding vpn-instance vpna [PE2-Serial1/0/0] ip address 10.1.2.1 24 [PE2-Serial1/0/0] quit
- Configure a GRE tunnel.
Use IP addresses of local and remote loopback interfaces as the source address and destination address of the GRE tunnel respectively.
# Configure PE1.
[PE1] interface loopback 1 [PE1-LoopBack1] ip binding vpn-instance vpna [PE1-LoopBack1] ip address 10.10.1.3 32 [PE1-LoopBack1] quit [PE1] interface tunnel 0/0/1 [PE1-Tunnel0/0/1] ip binding vpn-instance vpna [PE1-Tunnel0/0/1] tunnel-protocol gre [PE1-Tunnel0/0/1] ip address 10.10.10.1 24 [PE1-Tunnel0/0/1] source 10.10.1.3 [PE1-Tunnel0/0/1] destination vpn-instance vpna 10.10.1.4 [PE2-Tunnel0/0/1] quit
# Configure PE2.
[PE2] interface loopback 1 [PE2-LoopBack1] ip binding vpn-instance vpna [PE2-LoopBack1] ip address 10.10.1.4 32 [PE2-LoopBack1] quit [PE2] interface tunnel 0/0/1 [PE2-Tunnel0/0/1] ip binding vpn-instance vpna [PE2-Tunnel0/0/1] tunnel-protocol gre [PE2-Tunnel0/0/1] ip address 10.10.10.2 24 [PE2-Tunnel0/0/1] source 10.10.1.4 [PE2-Tunnel0/0/1] destination vpn-instance vpna 10.10.1.3 [PE2-Tunnel0/0/1] quit
- Configure a route between the PE and the CE, with the next hop as the tunnel interface.
The private routing process on the PE needs to advertise IP addresses of all private network segments including the IP address of the network segment where the tunnel interface is located.
Private network traffic sent by the CE to the PE is processed by the tunnel interface. The source address of the tunnel interface is the address of the private network loopback interface on the PE, so the local PE needs to advertise the loopback interface IP address to the remote PE.
# Configure PE1.
[PE1] ospf 2 vpn-instance vpna [PE1-ospf-2] area 0 [PE1-ospf-2-area-0.0.0.0] network 10.10.10.0 0.0.0.255 [PE1-ospf-2-area-0.0.0.0] network 10.1.1.0 0.0.0.255 [PE1-ospf-2-area-0.0.0.0] quit [PE1-ospf-2] quit [PE1] bgp 100 [PE1-bgp] ipv4-family vpn-instance vpna [PE1-bgp-vpna] network 10.10.1.3 255.255.255.255 [PE1-bgp-vpna] quit [PE1-bgp] quit
# Configure CE1.
[CE1] interface gigabitethernet 2/0/0 [CE1-GigabitEthernet2/0/0] ip address 10.138.1.2 24 [CE1-GigabitEthernet2/0/0] quit [CE1] interface serial 1/0/0 [CE1-Serial1/0/0] ip address 10.1.1.2 24 [CE1-Serial1/0/0] quit [CE1] ospf 1 [CE1-ospf-1] area 0 [CE1-ospf-1-area-0.0.0.0] network 10.138.1.0 0.0.0.255 [CE1-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255 [CE1-ospf-1-area-0.0.0.0] quit [CE1-ospf-1] quit
# Configure PE2.
[PE2] ospf 2 vpn-instance vpna [PE2-ospf-2] area 0 [PE2-ospf-2-area-0.0.0.0] network 10.10.10.0 0.0.0.255 [PE2-ospf-2-area-0.0.0.0] network 10.1.2.0 0.0.0.255 [PE2-ospf-2-area-0.0.0.0] quit [PE2-ospf-2] quit [PE2] bgp 100 [PE2-bgp] ipv4-family vpn-instance vpna [PE2-bgp-vpna] network 10.10.1.4 255.255.255.255 [PE2-bgp-vpna] quit [PE2-bgp] quit
# Configure CE2.
[CE2] interface gigabitethernet 2/0/0 [CE2-GigabitEthernet2/0/0] ip address 10.138.2.2 24 [CE2-GigabitEthernet2/0/0] quit [CE2] interface serial 1/0/0 [CE2-Serial1/0/0] ip address 10.1.2.2 24 [CE2-Serial1/0/0] quit [CE2] ospf 1 [CE2-ospf-1] area 0 [CE2-ospf-1-area-0.0.0.0] network 10.138.2.0 0.0.0.255 [CE2-ospf-1-area-0.0.0.0] network 10.1.2.0 0.0.0.255 [CE2-ospf-1-area-0.0.0.0] quit [CE2-ospf-1] quit
After the configuration is complete, run the display ip routing-table vpn-instance vpna command on the PE. You can see the route to the remote CE, with the next hop as the tunnel interface.
- Configure multicast functions on the private network.
Enable multicast functions and configure PIM on the PE and CE, and configure IGMP on GE2/0/0 of CE2 connected to receivers.
On PEs, configure PIM on the physical interface bound to the VPN instance and tunnel interface.
# Configure CE1.
[CE1] multicast routing-enable [CE1] interface gigabitethernet 2/0/0 [CE1-GigabitEthernet2/0/0] pim sm [CE1-GigabitEthernet2/0/0] quit [CE1] interface serial 1/0/0 [CE1-Serial1/0/0] pim sm [CE1-Serial1/0/0] quit
# Configure CE2.
[CE2] multicast routing-enable [CE2] interface gigabitethernet 2/0/0 [CE2-GigabitEthernet2/0/0] pim sm [CE2-GigabitEthernet2/0/0] igmp enable [CE2-GigabitEthernet2/0/0] quit [CE2] interface serial 1/0/0 [CE2-Serial1/0/0] pim sm [CE2-Serial1/0/0] quit
# Configure PE1.
[PE1] ip vpn-instance vpna [PE1-vpn-instance-vpna] multicast routing-enable [PE1-vpn-instance-vpna] quit [PE1] interface tunnel 0/0/1 [PE1-Tunnel0/0/1] pim sm [PE1-Tunnel0/0/1] quit [PE1] interface serial 1/0/0 [PE1-Serial1/0/0] pim sm [PE1-Serial1/0/0] quit [PE1] pim vpn-instance vpna [PE1-pim-vpna] c-rp serial 1/0/0 [PE1-pim-vpna] c-bsr serial 1/0/0
# Configure PE2.
[PE2] ip vpn-instance vpna [PE2-vpn-instance-vpna] multicast routing-enable [PE2-vpn-instance-vpna] quit [PE2] interface tunnel 0/0/1 [PE2-Tunnel0/0/1] pim sm [PE2-Tunnel0/0/1] quit [PE2] interface serial 1/0/0 [PE2-Serial1/0/0] pim sm [PE2-Serial1/0/0] quit [PE2] pim vpn-instance vpna [PE2-pim-vpna] c-rp serial 1/0/0 [PE2-pim-vpna] c-bsr serial 1/0/0
- Verify the configuration.
# The multicast source (10.138.1.1/24) sends multicast data to the multicast group 225.1.1.1. Receivers can receive multicast data from the source.
Configuration Files
PE1 configuration file
# sysname PE1 # 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 # mpls lsr-id 10.10.1.1 mpls # mpls ldp # interface Serial1/0/0 link-protocol ppp ip binding vpn-instance vpna ip address 10.1.1.1 255.255.255.0 # interface GigabitEthernet2/0/0 ip address 172.1.1.1 255.255.255.0 mpls mpls ldp # interface LoopBack0 ip address 10.10.1.1 255.255.255.255 # interface LoopBack1 ip binding vpn-instance vpna ip address 10.10.1.3 255.255.255.255 # interface Tunnel0/0/1 ip binding vpn-instance vpna ip address 10.10.10.1 255.255.255.0 tunnel-protocol gre source 10.10.1.3 destination vpn-instance vpna 10.10.1.4 pim sm # bgp 100 peer 10.10.1.2 as-number 100 peer 10.10.1.2 connect-interface LoopBack0 # ipv4-family unicast undo synchronization peer 10.10.1.2 enable # ipv4-family vpnv4 policy vpn-target peer 10.10.1.2 enable # ipv4-family vpn-instance vpna network 10.10.1.3 255.255.255.255 # ospf 1 area 0.0.0.0 network 10.10.1.1 0.0.0.0 network 172.1.1.0 0.0.0.255 # ospf 2 vpn-instance vpna area 0.0.0.0 network 10.1.1.0 0.0.0.255 network 10.10.10.0 0.0.0.255 # pim vpn-instance vpna c-bsr Serial1/0/0 c-rp Serial1/0/0 # return
PE2 configuration file
# sysname PE2 # 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 # mpls lsr-id 10.10.1.2 mpls # mpls ldp # interface Serial1/0/0 link-protocol ppp ip binding vpn-instance vpna ip address 10.1.2.1 255.255.255.0 # interface GigabitEthernet2/0/0 ip address 172.2.1.1 255.255.255.0 mpls mpls ldp # interface LoopBack0 ip address 10.10.1.2 255.255.255.255 # interface LoopBack1 ip binding vpn-instance vpna ip address 10.10.1.4 255.255.255.255 # interface Tunnel0/0/1 ip binding vpn-instance vpna ip address 10.10.10.2 255.255.255.0 tunnel-protocol gre source 10.10.1.4 destination vpn-instance vpna 10.10.1.3 pim sm # bgp 100 peer 10.10.1.1 as-number 100 peer 10.10.1.1 connect-interface LoopBack0 # ipv4-family unicast undo synchronization peer 10.10.1.1 enable # ipv4-family vpnv4 policy vpn-target peer 10.10.1.1 enable # ipv4-family vpn-instance vpna network 10.10.1.4 255.255.255.255 # ospf 1 area 0.0.0.0 network 10.10.1.2 0.0.0.0 network 172.2.1.0 0.0.0.255 # ospf 2 vpn-instance vpna area 0.0.0.0 network 10.1.2.0 0.0.0.255 network 10.10.10.0 0.0.0.255 # return
P configuration file
# sysname P # mpls lsr-id 10.10.2.1 mpls # mpls ldp # interface GigabitEthernet1/0/0 ip address 172.1.1.2 255.255.255.0 mpls mpls ldp # interface GigabitEthernet2/0/0 ip address 172.2.1.2 255.255.255.0 mpls mpls ldp # interface LoopBack0 ip address 10.10.2.1 255.255.255.255 # ospf 1 area 0.0.0.0 network 10.10.2.1 0.0.0.0 network 172.1.1.0 0.0.0.255 network 172.2.1.0 0.0.0.255 # return
CE1 configuration file
# sysname CE1 # multicast routing-enable # interface Serial1/0/0 link-protocol ppp ip address 10.1.1.2 255.255.255.0 pim sm # interface GigabitEthernet2/0/0 ip address 10.138.1.2 255.255.255.0 pim sm # 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 # return
CE2 configuration file
# sysname CE2 # multicast routing-enable # interface Serial1/0/0 link-protocol ppp ip address 10.1.2.2 255.255.255.0 pim sm # interface GigabitEthernet2/0/0 ip address 10.138.2.2 255.255.255.0 pim sm igmp enbale # 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