Example for Configuring Basic IGMP Functions
Networking Requirements
In Figure 2-18, users are located on network segments N1 and N2. On the Protocol Independent Multicast (PIM) network, RouterA connects to network segment N1, whereas RouterB and RouterC connect to network segment N2. The PIM network uses multicast addresses 225.1.1.1 through 225.1.1.5 to transmit video streams.
HostA on N1 and HostC on N2 want to receive video streams in multicast mode. HostA only subscribes to programs of multicast group 225.1.1.1, and HostC subscribes programs of all multicast groups. Appropriate configurations need to be performed on the routers to allow HostA to receive only video streams of multicast group 225.1.1.1 and allow HostC to receive video streams of all multicast groups.
Configuration Roadmap
To meet the preceding requirements, configure basic IGMP functions on the routers, and configure a group policy on RouterA to limit the multicast group range on the interface connected to network segment N1. The configuration roadmap is as follows:
- To ensure that data sent from multicast sources can be correctly forwarded to the user network segments, configure a unicast routing protocol on the network to implement IP interworking. Multicast routing protocols are dependent on unicast routing protocols.
- To enable the routers to forward video streams to the hosts in multicast mode, configure basic multicast functions on the routers.
- To allow HostA to receive only multicast data sent to multicast group 225.1.1.1, configure a group policy on RouterA's interface connected to N1 to filter multicast data sent to this network segment.
Procedure
- Configure IP addresses for interfaces and configure a unicast routing protocol on each Router.
# Configure IP addresses and masks for router interfaces according to Figure 2-18. Configure Open Shortest Path First (OSPF) on the routers to implement IP interworking and dynamic route update. The configurations of RouterB, RouterC, and RouterD are similar to the configuration of RouterA, and are not mentioned here. See Configuration Files.
<Huawei> system-view [Huawei] sysname RouterA [RouterA] interface gigabitethernet 1/0/0 [RouterA-GigabitEthernet1/0/0] ip address 10.110.1.1 24 [RouterA-GigabitEthernet1/0/0] quit [RouterA] interface gigabitethernet 2/0/0 [RouterA-GigabitEthernet2/0/0] ip address 192.168.1.1 24 [RouterA-GigabitEthernet2/0/0] quit [RouterA] ospf [RouterA-ospf-1] area 0 [RouterA-ospf-1-area-0.0.0.0] network 10.110.1.0 0.0.0.255 [RouterA-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255 [RouterA-ospf-1-area-0.0.0.0] quit [RouterA-ospf-1] quit
- Enable IP multicast routing on all the routers and enable Protocol Independent Multicast Sparse Mode (PIM-SM) on all interfaces.
# Enable IP multicast routing on RouterA and enable PIM-SM on all its interfaces. The configurations of RouterB, RouterC, and RouterD are similar to the configuration of RouterA, and are not mentioned here. See Configuration Files.
[RouterA] multicast routing-enable [RouterA] interface gigabitethernet 1/0/0 [RouterA-GigabitEthernet1/0/0] pim sm [RouterA-GigabitEthernet1/0/0] quit [RouterA] interface gigabitethernet 2/0/0 [RouterA-GigabitEthernet2/0/0] pim sm [RouterA-GigabitEthernet2/0/0] quit
- Configure a static rendezvous point (RP).
# Configure GE1/0/0 of RouterD as a static RP. The configurations of RouterB, RouterC, and RouterD are similar to the configuration of RouterA, and are not mentioned here. See Configuration Files.
[RouterA] pim [RouterA-pim] static-rp 192.168.4.2 [RouterA-pim] quit
- On RouterA, RouterB, and RouterC, enable IGMP on the interfaces connected to the user network segments.
# Enable IGMP on GE1/0/0 of RouterA. The configurations of RouterB and RouterC are similar to the configuration of RouterA, and are not mentioned here. See Configuration Files.
[RouterA] interface gigabitethernet 1/0/0 [RouterA-GigabitEthernet1/0/0] igmp enable [RouterA-GigabitEthernet1/0/0] quit
- Allow GE1/0/0 of RouterA to join only multicast group 225.1.1.1.
# On RouterA, create an ACL, configure a rule that only permits packets of the multicast group 225.1.1.1, and apply the ACL rule to GE1/0/0.
[RouterA] acl number 2001 [RouterA-acl-basic-2001] rule permit source 225.1.1.1 0 [RouterA-acl-basic-2001] quit [RouterA] interface gigabitethernet 1/0/0 [RouterA-GigabitEthernet1/0/0] igmp group-policy 2001 [RouterA-GigabitEthernet1/0/0] quit
- Verify the configuration.
# Run the display igmp interface command to check the IGMP configuration and running status on each interface.
# The IGMP command output on GE1/0/0 of RouterA is as follows:
<RouterA> display igmp interface gigabitethernet 1/0/0 Interface information of VPN-Instance: public net Gigabitethernet1/0/0(10.110.1.1): IGMP is enabled Current IGMP version is 2 IGMP state: up IGMP group policy: 2001 IGMP limit: - Value of query interval for IGMP (negotiated): - Value of query interval for IGMP (configured): 60 s Value of other querier timeout for IGMP: 0 s Value of maximum query response time for IGMP: 10 s Querier for IGMP: 10.110.1.1 (this router) Total 1 IGMP Group reported
# The command output shows that IGMP is enabled on GE1/0/0 of RouterA, and a group policy referencing ACL 2001 has been applied to this interface. In addition, GE1/0/0 has received a Report message of a multicast group.
# The IGMP command output on GE1/0/0 of RouterB is as follows:
<RouterB> display igmp interface gigabitethernet 1/0/0 Interface information of VPN-Instance: public net Gigabitethernet1/0/0(10.110.2.1): IGMP is enabled Current IGMP version is 2 IGMP state: up IGMP group policy: none IGMP limit: - Value of query interval for IGMP (negotiated): - Value of query interval for IGMP (configured): 60 s Value of other querier timeout for IGMP: 0 s Value of maximum query response time for IGMP: 10 s Querier for IGMP: 10.110.2.1 (this router) Total 2 IGMP Groups reported
# The command output shows that RouterB is a querier. This is because the IP address of GE1/0/0 on RouterB is the smallest on the network segment. In addition, GE1/0/0 has received Report messages of two multicast groups.
# Run the display pim routing-table command to check the PIM-SM multicast routing table on each router.
# On the shared network segment where RouterB and RouterC are located, RouterB is elected as the multicast data forwarder. The PIM-SM multicast routing table on RouterB is as follows:
<RouterB> display pim routing-table VPN-Instance: public net Total 2 (*, G) entries; 2 (S, G) entries (*, 225.1.1.1) RP: 192.168.4.2 Protocol: pim-sm, Flag: WC UpTime: 00:21:35 Upstream interface: GigabitEthernet2/0/0 Upstream neighbor: 192.168.2.2 RPF prime neighbor: 192.168.2.2 Downstream interface(s) information: Total number of downstreams: 1 1: GigabitEthernet1/0/0 Protocol: igmp, UpTime: 00:21:35, Expires: - (193.3.5.2, 225.1.1.1) RP: 192.168.4.2 Protocol: pim-sm, Flag: SPT ACT UpTime: 00:42:46 Upstream interface: GigabitEthernet2/0/0 Upstream neighbor: 192.168.2.2 RPF prime neighbor: 192.168.2.2 Downstream interface(s) information: Total number of downstreams: 1 1: GigabitEthernet1/0/0 Protocol: pim-sm, UpTime: 00:21:35, Expires: - (*, 225.1.1.2) RP: 192.168.4.2 Protocol: pim-sm, Flag: WC UpTime: 00:06:02 Upstream interface: GigabitEthernet2/0/0 Upstream neighbor: 192.168.2.2 RPF prime neighbor: 192.168.2.2 Downstream interface(s) information: Total number of downstreams: 1 1: GigabitEthernet1/0/0 Protocol: igmp, UpTime: 00:06:02, Expires: - (193.3.5.2, 225.1.1.2) RP: 192.168.4.2 Protocol: pim-sm, Flag: SPT ACT UpTime: 00:15:12 Upstream interface: GigabitEthernet2/0/0 Upstream neighbor: 192.168.2.2 RPF prime neighbor: 192.168.2.2 Downstream interface(s) information: Total number of downstreams: 1 1: GigabitEthernet1/0/0 Protocol: pim-sm, UpTime: 00:06:04, Expires: -
# The command output shows that (*, 225.1.1.1), (193.3.5.2, 225.1.1.1), (*, 225.1.1.2), and (193.3.5.2, 225.1.1.2) entries exist on RouterB. This indicates that GE1/0/0 has joined multicast groups 225.1.1.1 and 225.1.1.2 and can receive multicast data from multicast source 193.3.5.2.
# The PIM-SM multicast routing table on RouterA is as follows:
<RouterA> display pim routing-table VPN-Instance: public net Total 1 (*, G) entry; 1 (S, G) entry (*, 225.1.1.1) RP: 192.168.4.2 Protocol: pim-sm, Flag: WC UpTime: 00:21:35 Upstream interface: GigabitEthernet2/0/0 Upstream neighbor: 192.168.1.2 RPF prime neighbor: 192.168.1.2 Downstream interface(s) information: Total number of downstreams: 1 1: GigabitEthernet1/0/0 Protocol: igmp, UpTime: 00:21:35, Expires: - (193.3.5.2, 225.1.1.1) RP: 192.168.4.2 Protocol: pim-sm, Flag: SPT ACT UpTime: 00:42:46 Upstream interface: GigabitEthernet2/0/0 Upstream neighbor: 192.168.1.2 RPF prime neighbor: 192.168.1.2 Downstream interface(s) information: Total number of downstreams: 1 1: GigabitEthernet1/0/0 Protocol: pim-sm, UpTime: 00:21:35, Expires: -
# The command output shows that (*, 225.1.1.1) and (193.3.5.2, 225.1.1.1) entries exist on RouterA. This is because a group policy is configured on GE1/0/0 of RouterA.
Configuration Files
RouterA configuration file
# sysname RouterA # multicast routing-enable # acl number 2001 rule 5 permit source 225.1.1.1 0 # interface GigabitEthernet1/0/0 ip address 10.110.1.1 255.255.255.0 pim sm igmp enable igmp group-policy 2001 # interface GigabitEthernet2/0/0 ip address 192.168.1.1 255.255.255.0 pim sm # ospf 1 area 0.0.0.0 network 10.110.1.0 0.0.0.255 network 192.168.1.0 0.0.0.255 # pim static-rp 192.168.4.2 # return
RouterB configuration file
# sysname RouterB # multicast routing-enable # interface GigabitEthernet1/0/0 ip address 10.110.2.1 255.255.255.0 pim sm igmp enable # interface GigabitEthernet2/0/0 ip address 192.168.2.1 255.255.255.0 pim sm # ospf 1 area 0.0.0.0 network 10.110.2.0 0.0.0.255 network 192.168.2.0 0.0.0.255 # pim static-rp 192.168.4.2 # return
RouterC configuration file
# sysname RouterC # multicast routing-enable # interface GigabitEthernet1/0/0 ip address 10.110.2.2 255.255.255.0 pim sm igmp enable # interface GigabitEthernet2/0/0 ip address 192.168.3.1 255.255.255.0 pim sm # ospf 1 area 0.0.0.0 network 10.110.2.0 0.0.0.255 network 192.168.3.0 0.0.0.255 # pim static-rp 192.168.4.2 # return
RouterD configuration file
# sysname RouterD # multicast routing-enable # interface GigabitEthernet1/0/0 ip address 192.168.4.2 255.255.255.0 pim sm # interface GigabitEthernet2/0/0 ip address 192.168.1.2 255.255.255.0 pim sm # interface GigabitEthernet3/0/0 ip address 192.168.2.2 255.255.255.0 pim sm # interface GigabitEthernet4/0/0 ip address 192.168.3.2 255.255.255.0 pim sm # ospf 1 area 0.0.0.0 network 192.168.1.0 0.0.0.255 network 192.168.2.0 0.0.0.255 network 192.168.3.0 0.0.0.255 network 192.168.4.0 0.0.0.255 # pim static-rp 192.168.4.2 # return