This section provides an example for configuring basic MBGP functions.
As shown in Figure 1, the receiver and the source reside in different ASs. To enable the receiver to receive VoD information in multicast mode, establish an MBGP peer relationship between routerA and routerB to transmit multicast routing information.
Device |
Interface |
IP Address |
---|---|---|
DeviceA |
GE 0/1/0 |
192.168.1.1/24 |
GigabitEthernet0/1/8 |
10.10.10.1/24 |
|
Loopback0 |
1.1.1.1/32 |
|
DeviceB |
GE 0/1/0 |
192.168.1.2/24 |
GigabitEthernet0/1/8 |
192.168.2.1/24 |
|
GigabitEthernet0/1/16 |
192.168.3.1/24 |
|
Loopback0 |
2.2.2.2/32 |
|
DeviceC |
GE 0/1/0 |
192.168.4.1/24 |
GigabitEthernet0/1/8 |
10.22.22.1/24 |
|
GigabitEthernet0/1/16 |
192.168.3.2/24 |
|
Loopback0 |
3.3.3.3/32 |
|
DeviceD |
GE 0/1/0 |
192.168.4.2/24 |
GigabitEthernet0/1/8 |
192.168.2.2/24 |
|
Loopback0 |
4.4.4.4/32 |
The configuration roadmap is as follows:
Configure an IP address for each router interface.
Establish MBGP peer relationships to exchange inter-AS multicast routes.
Configure MBGP to import routes.
Enable multicast routing on each router.
Configure basic PIM-SM functions in each AS, and enable IGMP on interfaces that connect to user hosts.
Configure BSR boundaries on interfaces directly connecting routerA and routerB.
Establish MSDP peer relationships to transmit inter-AS multicast source information.
Verify the configuration.
To complete the configuration, you need the following data:
AS number of DeviceA: 100
AS numbers of DeviceB, DeviceC, and Device D: 200
Multicast group address: 225.1.1.1; multicast source address: 10.10.10.10/24
# Configure an IP address and a mask for each router interface and configure OSPF in each AS to ensure that DeviceB, DeviceC, DeviceD, and Receiver in AS 200 can communicate at the network layer, learn the routes to each other's loopback interfaces, and the routers dynamically update routes between each other using a unicast routing protocol. OSPF process 1 is used as an example. For configuration details, see Configuration Files in this section.
# On DeviceA, enable BGP and configure the MBGP peer relationship.
[~DeviceA] bgp 100 [*DeviceA-bgp] peer 192.168.1.2 as-number 200 [*DeviceA-bgp] ipv4-family multicast [*DeviceA-bgp-af-multicast] peer 192.168.1.2 enable [*DeviceA-bgp-af-multicast] commit [~DeviceA-bgp-af-multicast] quit [~DeviceA-bgp] quit
# On DeviceB, enable BGP and configure the MBGP peer relationship.
[~DeviceB] bgp 200 [*DeviceB-bgp] peer 192.168.1.1 as-number 100 [*DeviceB-bgp] peer 192.168.3.2 as-number 200 [*DeviceB-bgp] peer 192.168.2.2 as-number 200 [*DeviceB-bgp] ipv4-family multicast [*DeviceB-bgp-af-multicast] peer 192.168.1.1 enable [*DeviceB-bgp-af-multicast] peer 192.168.3.2 enable [*DeviceB-bgp-af-multicast] peer 192.168.2.2 enable [*DeviceB-bgp-af-multicast] commit [~DeviceB-bgp-af-multicast] quit [~DeviceB-bgp] quit
# On DeviceC, enable BGP and configure the MBGP peer relationship.
[~DeviceC] bgp 200 [*DeviceC-bgp] peer 192.168.3.1 as-number 200 [*DeviceC-bgp] peer 192.168.4.2 as-number 200 [*DeviceC-bgp] ipv4-family multicast [*DeviceC-bgp-af-multicast] peer 192.168.3.1 enable [*DeviceC-bgp-af-multicast] peer 192.168.4.2 enable [*DeviceC-bgp-af-multicast] commit [~DeviceC-bgp-af-multicast] quit [~DeviceC-bgp] quit
# On DeviceD, enable BGP and configure the MBGP peer relationship.
[~DeviceD] bgp 200 [*DeviceD-bgp] peer 192.168.2.1 as-number 200 [*DeviceD-bgp] peer 192.168.4.1 as-number 200 [*DeviceD-bgp] ipv4-family multicast [*DeviceD-bgp-af-multicast] peer 192.168.2.1 enable [*DeviceD-bgp-af-multicast] peer 192.168.4.1 enable [*DeviceD-bgp-af-multicast] commit [~DeviceD-bgp-af-multicast] quit [~DeviceD-bgp] quit
# On DeviceA, configure MBGP to import routes.
[~DeviceA] bgp 100 [*DeviceA-bgp] import-route direct [*DeviceA-bgp] ipv4-family multicast [*DeviceA-bgp-af-multicast] network 1.1.1.1 32 [*DeviceA-bgp-af-multicast] commit [~DeviceA-bgp-af-multicast] quit [~DeviceA-bgp] quit
# On DeviceB, configure MBGP to import routes.
[~DeviceB] bgp 200 [*DeviceB-bgp] import-route direct [*DeviceB-bgp] import-route ospf 1 [*DeviceB-bgp] ipv4-family multicast [*DeviceB-bgp-af-multicast] network 2.2.2.2 32 [*DeviceB-bgp-af-multicast] commit [~DeviceB-bgp-af-multicast] quit [~DeviceB-bgp] quit
# Configure DeviceA.
[~DeviceA] multicast routing-enable [*DeviceA] interface GigabitEthernet0/1/0 [*DeviceA-GigabitEthernet0/1/0] pim sm [*DeviceA-GigabitEthernet0/1/0] quit [*DeviceA] interface GigabitEthernet0/1/8 [*DeviceA-GigabitEthernet0/1/8] pim sm [*DeviceA-GigabitEthernet0/1/8] quit [*DeviceA] commit
# Configure DeviceB.
[~DeviceB] multicast routing-enable [*DeviceB] interface GigabitEthernet0/1/0 [*DeviceB-GigabitEthernet0/1/0] pim sm [*DeviceB-GigabitEthernet0/1/0] quit [*DeviceB] interface GigabitEthernet0/1/8 [*DeviceB-GigabitEthernet0/1/8] pim sm [*DeviceB-GigabitEthernet0/1/8] quit [*DeviceB] interface GigabitEthernet0/1/16 [*DeviceB-GigabitEthernet0/1/16] pim sm [*DeviceB-GigabitEthernet0/1/16] quit [*DeviceB] commit
# Configure DeviceC.
[~DeviceC] multicast routing-enable [*DeviceC] interface GigabitEthernet0/1/0 [*DeviceC-GigabitEthernet0/1/0] pim sm [*DeviceC-GigabitEthernet0/1/0] quit [*DeviceC] GigabitEthernet0/1/8 [*DeviceC-GigabitEthernet0/1/8] pim sm [*DeviceC-GigabitEthernet0/1/8] igmp enable [*DeviceC-GigabitEthernet0/1/8] quit [*DeviceC] interface GigabitEthernet0/1/16 [*DeviceC-GigabitEthernet0/1/16] pim sm [*DeviceC-GigabitEthernet0/1/16] quit [*DeviceC] commit
# Configure DeviceD.
[~DeviceD] multicast routing-enable [*DeviceD] interface GigabitEthernet0/1/0 [*DeviceD-GigabitEthernet0/1/0] pim sm [*DeviceD-GigabitEthernet0/1/0] quit [*DeviceD] interface GigabitEthernet0/1/8 [*DeviceD-GigabitEthernet0/1/8] pim sm [*DeviceD-GigabitEthernet0/1/8] quit [*DeviceD] commit
# Configure DeviceA.
[~DeviceA] interface loopback 0 [*DeviceA-LoopBack0] ip address 1.1.1.1 255.255.255.255 [*DeviceA-LoopBack0] pim sm [*DeviceA-LoopBack0] quit [*DeviceA] pim [*DeviceA-pim] c-bsr loopback 0 [*DeviceA-pim] c-rp loopback 0 [*DeviceA-pim] quit [*DeviceA] commit
# Configure DeviceB.
[~DeviceB] interface loopback 0 [*DeviceB-LoopBack0] ip address 2.2.2.2 255.255.255.255 [*DeviceB-LoopBack0] pim sm [*DeviceB-LoopBack0] quit [*DeviceB] pim [*DeviceB-pim] c-bsr loopback 0 [*DeviceB-pim] c-rp loopback 0 [*DeviceB] quit [*DeviceB] commit
# Configure DeviceA.
[~DeviceA] interface GigabitEthernet0/1/0 [~DeviceA-GigabitEthernet0/1/0] pim bsr-boundary [*DeviceA-GigabitEthernet0/1/0] commit [~DeviceA-GigabitEthernet0/1/0] quit
# Configure DeviceB.
[~DeviceB] interface GigabitEthernet0/1/0 [~DeviceB-GigabitEthernet0/1/0] pim bsr-boundary [*DeviceB-GigabitEthernet0/1/0] commit [~DeviceB-GigabitEthernet0/1/0] quit
# Configure DeviceA.
[~DeviceA] msdp [*DeviceA-msdp] peer 192.168.1.2 connect-interface GigabitEthernet 0/1/0 [*DeviceA-msdp] commit [~DeviceA-msdp] quit
# Configure DeviceB.
[~DeviceB] msdp [*DeviceB-msdp] peer 192.168.1.1 connect-interface GigabitEthernet 0/1/0 [*DeviceB-msdp] commit [~DeviceB-msdp] quit
# Run the display bgp multicast peer command to check the MBGP peer relationships between routers. The following example uses the command output on DeviceA.
[~DeviceA] display bgp multicast peer BGP local router ID : 1.1.1.1 Local AS number : 100 Total number of peers : 1 Peers in established state : 1 Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 192.168.1.2 4 200 82 75 0 00:30:29 Established 17
# Run the display msdp brief command to check the MSDP peer relationships between routers. The following example uses the command output on DeviceB.
[~DeviceB] display msdp brief MSDP Peer Brief Information of VPN-Instance: public net Configured Up Listen Connect Shutdown Down 1 1 0 0 0 0 Peer's Address State Up/Down time AS SA Count Reset Count 192.168.1.1 Up 00:07:17 100 1 0
DeviceA configuration file
# sysname DeviceA # multicast routing-enable # interface GigabitEthernet0/1/0 undo shutdown ip address 192.168.1.1 255.255.255.0 pim bsr-boundary pim sm # interface GigabitEthernet0/1/8 undo shutdown ip address 10.10.10.1 255.255.255.0 pim sm # interface loopback 0 ip address 1.1.1.1 255.255.255.255 pim sm # bgp 100 peer 192.168.1.2 as-number 200 # ipv4-family unicast undo synchronization import-route direct peer 192.168.1.2 enable # ipv4-family multicast undo synchronization network 1.1.1.1 32 peer 192.168.1.2 enable # pim c-bsr loopback 0 c-rp loopback 0 # msdp peer 192.168.1.2 connect-interface GigabitEthernet 0/1/0 # return
DeviceB configuration file
# sysname DeviceB # multicast routing-enable # interface GigabitEthernet 0/1/0 undo shutdown ip address 192.168.1.2 255.255.255.0 pim bsr-boundary pim sm # interface GigabitEthernet 0/1/8 undo shutdown ip address 192.168.2.1 255.255.255.0 pim sm # interface GigabitEthernet 0/1/16 undo shutdown ip address 192.168.3.1 255.255.255.0 pim sm # interface loopback 0 ip address 2.2.2.2 255.255.255.255 pim sm # bgp 200 peer 192.168.1.1 as-number 100 peer 192.168.3.2 as-number 200 peer 192.168.2.2 as-number 200 # ipv4-family unicast undo synchronization import-route direct import-route ospf 1 peer 192.168.1.1 enable peer 192.168.3.2 enable peer 192.168.2.2 enable # ipv4-family multicast undo synchronization network 2.2.2.2 32 peer 192.168.1.1 enable peer 192.168.3.2 enable peer 192.168.2.2 enable # ospf 1 area 0.0.0.0 network 192.168.3.0 0.0.0.255 network 192.168.2.0 0.0.0.255 network 2.2.2.2 0.0.0.0 # pim c-bsr loopback 0 c-rp loopback 0 # msdp peer 192.168.1.1 connect-interface GigabitEthernet 0/1/0 # return
DeviceC configuration file
# sysname DeviceC # multicast routing-enable # interface GigabitEthernet0/1/0 undo shutdown ip address 192.168.4.1 255.255.255.0 pim sm # interface GigabitEthernet0/1/8 undo shutdown ip address 10.22.22.1 255.255.255.0 pim sm igmp enable # interface GigabitEthernet 0/1/16 undo shutdown ip address 192.168.3.2 255.255.255.0 pim sm # interface loopback 0 ip address 3.3.3.3 255.255.255.255 pim sm # bgp 200 peer 192.168.3.1 as-number 200 peer 192.168.4.2 as-number 200 # ipv4-family unicast undo synchronization peer 192.168.3.1 enable peer 192.168.4.2 enable # ipv4-family multicast undo synchronization peer 192.168.3.1 enable peer 192.168.4.2 enable # ospf 1 area 0.0.0.0 network 192.168.3.0 0.0.0.255 network 192.168.4.0 0.0.0.255 network 10.22.22.0 0.0.0.255 network 3.3.3.3 0.0.0.0 # return
DeviceD configuration file
# sysname DeviceD # multicast routing-enable # interface GigabitEthernet0/1/0 undo shutdown ip address 192.168.4.2 255.255.255.0 pim sm # interface GigabitEthernet0/1/8 undo shutdown ip address 192.168.2.2 255.255.255.0 pim sm # interface loopback 0 ip address 4.4.4.4 255.255.255.255 pim sm # bgp 200 peer 192.168.2.1 as-number 200 peer 192.168.4.1 as-number 200 # ipv4-family unicast undo synchronization peer 192.168.2.1 enable peer 192.168.4.1 enable # ipv4-family multicast undo synchronization peer 192.168.2.1 enable peer 192.168.4.1 enable # ospf 1 area 0.0.0.0 network 192.168.2.0 0.0.0.255 network 192.168.4.0 0.0.0.255 network 4.4.4.4 0.0.0.0 # return