22-IGMP典型配置举例
本章节下载: 22-IGMP典型配置举例 (298.53 KB)
H3C S12500R产品IGMP典型配置举例
Copyright © 2021 新华三技术有限公司 版权所有,保留一切权利。
非经本公司书面许可,任何单位和个人不得擅自摘抄、复制本文档内容的部分或全部,并不得以任何形式传播。
除新华三技术有限公司的商标外,本手册中出现的其它公司的商标、产品标识及商品名称,由各自权利人拥有。
本文档中的信息可能变动,恕不另行通知。
IGMP(Internet Group Management Protocol,互联网组管理协议)用于在三层设备和其直连网段中的用户主机之间建立和维护组播组成员关系。本文介绍了IGMP的典型配置举例。
本文档中的配置均是在实验室环境下进行的配置和验证,配置前设备的所有参数均采用出厂时的缺省配置。如果您已经对设备进行了配置,为了保证配置效果,请确认现有配置和以下举例中的配置不冲突。
本文档假设您已了解IGMP特性。
如图1所示,网络中运行OSPF和PIM-DM,接收者通过组播方式接收视频点播信息,不同组织的接收者组成末梢网络N1和N2,Host A和Host C分别为N1和N2中的组播信息接收者。Device A与N1之间运行IGMPv2,Device A为IGMP查询器;Device B、Device C与N2之间也分别运行IGMPv2,且由于Device B的接口IP地址较小,因此由其充当IGMP查询器。现要求:
· 网络N1内的接收者所能加入的组播组不做限制。
· 控制网络N2内的接收者只能加入组播组224.1.1.1。
图1 IGMP基本功能配置组网图
· 因共享网段N2内有多台IGMP设备,为实现本组网需求,需要在该共享网段内的所有IGMP设备上都配置相同的IGMP组播组过滤器。
· 为实现IGMP组播组过滤器控制主机加入组播组的范围,需要为其创建基本ACL,并在该ACL规则中指定允许主机加入的组播组范围。
本举例是在R3606版本上进行配置和验证的。
· 由于不同版本IGMP协议的报文结构与种类不同,因此需要为同一网段上的所有三层设备配置相同版本的IGMP,否则IGMP将不能正常运行。
· 缺省情况下,本设备的接口处于ADM(Administratively Down)状态,请根据实际需要在对应接口视图下使用undo shutdown命令开启接口。
(1) 配置PIM-DM域内各设备的IP地址和单播路由协议
# 配置PIM-DM域内设备上各接口的IP地址和子网掩码,具体配置过程略。
# 配置PIM-DM域内的各设备之间采用OSPF协议进行互连,确保PIM-DM域内部在网络层互通,具体配置过程略。
(2) 配置Device A
# 在Device A上使能IP组播路由,在接口HundredGigE1/0/2上使能PIM-DM,并在主机侧接口HundredGigE 1/0/1上使能IGMP。
<DeviceA> system-view
[DeviceA] multicast routing
[DeviceA-mrib] quit
[DeviceA] interface hundredgige 1/0/1
[DeviceA-Hundredgige1/0/1] igmp enable
[DeviceA-Hundredgige1/0/1] quit
[DeviceA] interface hundredgige 1/0/2
[DeviceA-Hundredgige1/0/2] pim dm
[DeviceA-Hundredgige1/0/2] quit
(3) 配置Device B
# 在Device B上使能IP组播路由,在接口HundredGigE1/0/2上使能PIM-DM,并在主机侧接口HundredGigE 1/0/1上使能IGMP及配置组播组过滤器,以在Device B上限制用户网络N2内的主机只能加入组播组224.1.1.1。
<DeviceB> system-view
[DeviceB] acl basic 2001
[DeviceB-acl-ipv4-basic-2001] rule permit source 224.1.1.1 0
[DeviceB-acl-ipv4-basic-2001] quit
[DeviceB] multicast routing
[DeviceB-mrib] quit
[DeviceB] interface 和undredGigE 1/0/1
[DeviceB-HundredGigE1/0/1] igmp enable
[DeviceB-HundredGigE1/0/1] igmp group-policy 2001
[DeviceB-HundredGigE1/0/1] quit
[DeviceB] interface HundredGigE 1/0/2
[DeviceB-HundredGigE1/0/2] pim dm
[DeviceB-HundredGigE1/0/2] quit
(4) 配置Device C
# 在Device C上使能IP组播路由,在接口HundredGigE1/0/2上使能PIM-DM,并在主机侧接口HundredGigE1/0/1上使能IGMP及配置组播组过滤器,以在Device C上限制用户网络N2内的主机只能加入组播组224.1.1.1。
<DeviceC> system-view
[DeviceC] acl basic 2001
[DeviceC-acl-ipv4-basic-2001] rule permit source 224.1.1.1 0
[DeviceC-acl-ipv4-basic-2001] quit
[DeviceC] multicast routing
[DeviceC-mrib] quit
[DeviceC] interface hundredGigE 1/0/1
[DeviceC-HundredGigE1/0/1] igmp enable
[DeviceC-HundredGigE1/0/1] igmp group-policy 2001
[DeviceC-HundredGigE1/0/1] quit
[DeviceC] interface hundredGigE 1/0/2
[DeviceC-HundredGigE1/0/2] pim dm
[DeviceC-HundredGigE1/0/2] quit
(1) 配置完成后,用户网络N1内的组播接收者Host A(地址为10.110.1.10)分别发送组播组地址为224.1.1.1和224.1.1.2的IGMP成员关系报告报文,通过display igmp group命令查看Device A上IGMP组播组信息,验证配置效果。
# 查看Device A上IGMP组播组信息。
[DeviceA] display igmp group
IGMP groups in total: 2
HundredGigE 1/0/1(10.110.1.1):
IGMP groups reported in total: 2
Group address Last reporter Uptime Expires
224.1.1.1 10.110.1.10 00:02:04 00:01:15
224.1.1.2 10.110.1.10 00:02:00 00:01:19
Host A发送了组播组地址为224.1.1.1和224.1.1.2的IGMP成员关系报告报文,因Device A上没有对加入的组播组做限制,用户网络N1内的组播接收者可以加入组播组224.1.1.1和224.1.1.2。
(2) 配置完成后,用户网络N2内的组播接收者Host C(IP地址为10.110.2.10)分别发送组播组地址为224.1.1.1和224.1.1.2的IGMP成员关系报告报文,通过display igmp group命令查看Device B和Device C上IGMP组播组信息,验证配置效果。
# 查看Device B上IGMP组播组信息。
[DeviceB] display igmp group
IGMP groups in total: 1
HundredGigE 1/0/1(10.110.2.1):
IGMP groups reported in total: 1
Group address Last reporter Uptime Expires
224.1.1.1 10.110.2.10 04:36:03 00:01:23
# 查看Device C上IGMP组播组信息。
[DeviceC] display igmp group
IGMP groups in total: 1
HundredGigE 1/0/1(10.110.2.2):
IGMP groups reported in total: 1
Group address Last reporter Uptime Expires
224.1.1.1 10.110.2.10 04:21:03 00:01:13
Host C发送了组播组地址为224.1.1.1和224.1.1.2的IGMP成员关系报告报文,而Device B和Device C上只有组播组224.1.1.1的IGMP组播组信息,由此可见在Device B和Device C上配置的IGMP组播组过滤器已生效,用户网络N2内的组播接收者只能加入组播组224.1.1.1。
· Device A:
#
interface HundredGigE1/0/1
ip address 10.110.1.1 255.255.255.0
igmp enable
#
interface HundredGigE1/0/2
ip address 10.111.1.1 255.255.255.0
pim dm
#
multicast routing
#
· Device B:
#
acl basic 2001
rule 0 permit source 224.1.1.1 0
#
interface HundredGigE1/0/1
ip address 10.110.2.1 255.255.255.0
igmp enable
igmp group-policy 2001
#
interface HundredGigE1/0/2
ip address 10.111.2.1 255.255.255.0
pim dm
#
multicast routing
#
· Device C:
#
acl basic 2001
rule 0 permit source 224.1.1.1 0
#
interface HundredGigE1/0/1
ip address 10.110.2.2 255.255.255.0
igmp enable
igmp group-policy 2001
#
interface HundredGigE1/0/2
ip address 10.111.3.1 255.255.255.0
pim dm
#
multicast routing
#
如图2所示,网络中运行OSPF和PIM-DM,接收者通过组播方式接收视频点播信息,不同组织的接收者组成末梢网络N1和N2,Host A和Host C分别为N1和N2中的组播信息接收者。Device A与N1之间运行IGMPv2,Device A为IGMP查询器;Device B、Device C与N2之间也分别运行IGMPv2,且由于Device B的接口IP地址较小,因此由其充当IGMP查询器。现要求:
· 对网络N1内的接收者所能加入的组播组没有限制,但Host A希望长期稳定地接收组播组224.1.1.2的数据;
· 控制网络N2内的接收者只能加入组播组224.1.1.1。
图2 IGMP静态加入组播组配置组网图
· 为使Host A可以稳定的接收224.1.1.2的数据,可以通过在连接Host A的Device A接口上配置静态加入组播组来实现该需求。
· 为实现IGMP组播组过滤器控制主机加入组播组的范围,需要为其创建基本ACL,并在该ACL规则中指定允许主机加入的组播组范围。
· 因共享网段N2内有多台IGMP设备,为实现本组网需求,需要在该共享网段内的所有IGMP设备上都配置相同的IGMP组播组过滤器。
本举例是在R3606版本上进行配置和验证的。
· 由于不同版本IGMP协议的报文结构与种类不同,因此需要为同一网段上的所有三层设备配置相同版本的IGMP,否则IGMP将不能正常运行。
· 缺省情况下,本设备的接口处于ADM(Administratively Down)状态,请根据实际需要在对应接口视图下使用undo shutdown命令开启接口。
(1) 配置PIM-DM域内各设备的IP地址和单播路由协议
# 配置PIM-DM域内设备上各接口的IP地址和子网掩码,具体配置过程略。
# 配置PIM-DM域内的各设备之间采用OSPF协议进行互连,确保PIM-DM域内部在网络层互通,具体配置过程略。
(2) 配置Device A
# 在Device A上使能IP组播路由,并在接口Hundredgige1/0/1上使能PIM-DM。
<DeviceA> system-view
[DeviceA] multicast routing
[DeviceA-mrib] quit
[DeviceA] interface hundredgige 1/0/2
[DeviceA-HundredGigE1/0/2] pim dm
[DeviceA-HundredGigE1/0/2] quit
# 在主机侧接口Hundredgige 1/0/1上使能IGMP,并配置该接口静态加入组播组224.1.1.2。
[DeviceA] interface hundredgige 1/0/1
[DeviceA-HundredGigE1/0/1] igmp enable
[DeviceA-HundredGigE1/0/1] igmp static-group 224.1.1.2
[DeviceA-HundredGigE1/0/1] quit
(3) 配置Device B
# 在Device B上使能IP组播路由,并在接口Hundredgige1/0/2上使能PIM-DM。
<DeviceB> system-view
[DeviceB] multicast routing
[DeviceB-mrib] quit
[DeviceB] interface hundredgige 1/0/2
[DeviceB-Hundredgige1/0/2] pim dm
[DeviceB-Hundredgige1/0/2] quit
# 配置ACL 2001用于组播过滤器。
[DeviceB] acl basic 2001
[DeviceB-acl-ipv4-basic-2001] rule permit source 224.1.1.1 0
[DeviceB-acl-ipv4-basic-2001] quit
# 在主机侧接口Hundredgige1/0/1上使能IGMP及配置组播组过滤器,以在Device B上限制用户网络N2内的主机只能加入组播组224.1.1.1
[DeviceB] interface hundredgige 1/0/1
[DeviceB-Hundredgige1/0/1] igmp enable
[DeviceB-Hundredgige1/0/1] igmp group-policy 2001
[DeviceB-Hundredgige1/0/1] quit
(4) 配置Device C
# 在Device C上使能IP组播路由,并在接口Hundredgige1/0/2上使能PIM-DM。
<DeviceC> system-view
[DeviceC] multicast routing
[DeviceC-mrib] quit
[DeviceC] interface hundredgige 1/0/2
[DeviceC-Hundredgige1/0/2] pim dm
[DeviceC-Hundredgige1/0/2] quit
# 配置ACL 2001用于组播过滤器。
[DeviceC] acl basic 2001
[DeviceC-acl-ipv4-basic-2001] rule permit source 224.1.1.1 0
[DeviceC-acl-ipv4-basic-2001] quit
# 在主机侧接口Hundredgige1/0/1上使能IGMP及配置组播组过滤器,以在Device C上限制用户网络N2内的主机只能加入组播组224.1.1.1
[DeviceC] interface hundredgige1/0/1
[DeviceC-Hundredgige1/0/1] igmp enable
[DeviceC-Hundredgige1/0/1] igmp group-policy 2001
[DeviceC-Hundredgige1/0/1] quit
(1) 配置完成后,用户网络N1内的组播接收者Host A(地址为10.110.1.10)分别发送组播组地址为224.1.1.1和224.1.1.2的IGMP成员关系报告报文,通过display igmp group命令查看Device A上IGMP组播组信息,验证配置效果。
# 查看Device A上动态加入的IGMP组播组信息。
[DeviceA] display igmp group
IGMP groups in total: 2.
Hundredgige1/0/1(10.110.1.1):
IGMP groups reported in total: 2
Group address Last reporter Uptime Expires
224.1.1.1 10.110.1.10 00:02:04 00:01:15
224.1.1.2 10.110.1.10 00:02:00 00:01:19
# 显示Device A上静态加入的IGMP组播组信息。
[DeviceA] display igmp group static
Entries in total: 1
Group address Source address Interface Expires
224.1.1.2 0.0.0.0 HGE1/0/1 Never
Host A发送了组播组地址为224.1.1.1和224.1.1.2的IGMP成员关系报告报文,因Device A上没有对加入的组播组做限制,用户网络N1内的组播接收者可以加入组播组224.1.1.1和224.1.1.2,且N1内的组播接收者可以长期稳定的接收组播组224.1.1.2的数据。
(2) 配置完成后,用户网络N2内的组播接收者Host C(IP地址为10.110.2.10)分别发送组播组地址为224.1.1.1和224.1.1.2的IGMP成员关系报告报文,通过display igmp group命令查看Device B和Device C上IGMP组播组信息,验证配置效果。
# 查看Device B上动态加入的IGMP组播组信息。
[DeviceB] display igmp group
IGMP groups in total: 1
Hundredgige1/0/1(10.110.2.1):
IGMP groups reported in total: 1
Group address Last reporter Uptime Expires
224.1.1.1 10.110.2.10 04:36:03 00:01:23
# 查看Device C上动态加入的IGMP组播组信息。
[DeviceC] display igmp group
IGMP groups in total: 1
Hundredgige1/0/1(10.110.2.2):
IGMP groups reported in total: 1
Group address Last reporter Uptime Expires
224.1.1.1 10.110.2.10 04:21:03 00:01:13
Host C发送了组播组地址为224.1.1.1和224.1.1.2的IGMP成员关系报告报文,而Device B和Device C上只有组播组224.1.1.1的IGMP组播组信息,由此可见在Device B和Device C上配置的IGMP组播组过滤器已生效,用户网络N2内的组播接收者只能加入组播组224.1.1.1。
· Device A:
#
interface HundredGigE1/0/1
ip address 10.111.1.1 255.255.255.0
pim dm
#
interface HundredGigE1/0/2
ip address 10.110.1.1 255.255.255.0
igmp enable
igmp static-group 224.1.1.2
#
multicast routing
#
· Device B:
#
acl basic 2001
rule 0 permit source 224.1.1.1 0
#
interface HundredGigE1/0/1
ip address 10.111.2.1 255.255.255.0
pim dm
#
interface HundredGigE1/0/2
ip address 10.110.2.1 255.255.255.0
igmp enable
igmp group-policy 2001
#
multicast routing
#
· Device C:
#
acl basic 2001
rule 0 permit source 224.1.1.1 0
#
interface HundredGigE1/0/1
ip address 10.111.3.1 255.255.255.0
pim dm
#
interface HundredGigE1/0/2
ip address 10.110.2.2 255.255.255.0
igmp enable
igmp group-policy 2001
#
multicast routing
#
如图3所示,PIM-SSM网络所服务的SSM组播组范围为232.1.1.0/24,PIM-SSM网络内连接用户网络N1和N2的设备上均运行IGMPv3,而用户网络N1、N2内的主机Host A和Host C上只能运行IGMPv1或IGMPv2,且不能升级至IGMPv3;其他主机运行IGMPv3。现要求:
· 通过在IGMP设备上配置IGMP SSM Mapping功能,使PIM-SSM网络能够为用户网络N1内的接收者提供SSM组播服务,实现用户网络N1中的接收者只接收来自Source 1的组播报文。
· 实现用户网络N2中的接收者只接收来自Source 2的组播报文。
图3 IGMP SSM Mapping功能配置组网图
本举例是在R3606版本上进行配置和验证的。
缺省情况下,本设备的接口处于ADM(Administratively Down)状态,请根据实际需要在对应接口视图下使用undo shutdown命令开启接口。
(1) 配置IP地址和单播路由协议
# 请按照5.1 图3配置各接口的IP地址和子网掩码,具体配置过程略。
# 配置PIM-SSM网络内的各设备之间采用OSPF协议进行互连,具体配置过程略。
(2) 使能IP组播路由,并使能PIM-SM
# 在Device A上使能IP组播路由,在接口上使能PIM-SM。
<DeviceA> system-view
[DeviceA] multicast routing
[DeviceA-mrib] quit
[DeviceA] interface hundredgige1/0/1
[DeviceA-HundredGigE1/0/1] pim sm
[DeviceA-HundredGigE1/0/1] quit
Device B的配置与Device A相似,配置过程略。
# 在Device C上使能IP组播路由,在各接口上使能PIM-SM。
<DeviceC> system-view
[DeviceC] multicast routing
[DeviceC-mrib] quit
[DeviceC] interface hundredgige1/0/1
[DeviceC-Hundredgige1/0/1] pim sm
[DeviceC-Hundredgige1/0/1] quit
[DeviceC] interface hundredgige1/0/2
[DeviceC-Hundredgige1/0/2] pim sm
[DeviceC-Hundredgige1/0/2] quit
[DeviceC] interface hundredgige1/0/3
[DeviceC-Hundredgige1/0/3] pim sm
[DeviceC-Hundredgige1/0/3] quit
(3) 配置C-BSR和C-RP
# 在Device C上配置C-BSR和C-RP的位置。
[DeviceC-pim] c-bsr 192.168.1.1
[DeviceC-pim] c-rp 192.168.1.1
[DeviceC-pim] quit
(4) 在连接网络N1和N2的接口上使能IGMPv3功能
# 在Device A的接口HundredGigE1/0/2上使能IGMPv3。
[DeviceA] interface hundredgige 1/0/2
[DeviceA-Hundredgige1/0/2] igmp enable
[DeviceA-Hundredgige1/0/2] igmp version 3
[DeviceA-Hundredgige1/0/2] quit
Device B的配置与Device A相似,配置过程略。
(5) 配置SSM组播组的地址范围
# 在Device A上配置SSM组播组地址范围为232.1.1.0/24。
[DeviceA] acl basic 2000
[DeviceA-acl-ipv4-basic-2000] rule permit source 232.1.1.0 0.0.0.255
[DeviceA-acl-ipv4-basic-2000] quit
[DeviceA] pim
[DeviceA-pim] ssm-policy 2000
[DeviceA-pim] quit
Device B和Device C的配置与Device A相同,配置过程略。
(6) 使能IGMP SSM Mapping功能,并配置IGMP SSM Mapping规则
# 在Device A上配置IGMP SSM Mapping规则,满足N1网络内组播报文接收者只接收来自组播源Source 1的组播数据的要求。
[DeviceA] igmp
[DeviceA-igmp] ssm-mapping 10.110.5.100 2000
[DeviceA-igmp] quit
# 在Device B上配置IGMP SSM Mapping规则,满足N2网络内组播报文接收者只接收来自组播源Source 2的组播数据的要求。
[DeviceB] igmp
[DeviceB-igmp] ssm-mapping 10.110.5.101 2000
[DeviceB-igmp] quit
配置完成后,Host A和Host C都发送组播组地址为232.1.1.1的IGMPv2加入报文,在Device A和Device B上通过相关命令查看配置效果。
(1) Device A上的显示信息
# 查看Device A上组播组232.1.1.1的IGMP SSM Mapping规则。
[DeviceA] display igmp ssm-mapping 232.1.1.1
Group: 232.1.1.1
Source list:
10.110.5.100
# 查看Device A上的PIM路由表信息。
[DeviceA] display pim routing-table
Total 0 (*, G) entries; 1 (S, G) entries
(10.110.5.100, 232.1.1.1)
Protocol: pim-ssm, Flag:
UpTime: 00:13:25
Upstream interface: HundredGigE1/0/1
Upstream neighbor: 192.168.1.1
RPF prime neighbor: 192.168.1.1
Downstream interface(s) information:
Total number of downstreams: 1
1: HundredGigE1/0/2
Protocol: igmp, UpTime: 02:54:43, Expires: 00:02:47
(2) Device B上的显示信息
# 查看Device B上组播组232.1.1.1的IGMP SSM Mapping规则。
[DeviceB] display igmp ssm-mapping 232.1.1.1
Group: 232.1.1.1
Source list:
10.110.5.101
# 查看Device B上的PIM路由表信息。
[DeviceB] display pim routing-table
Total 0 (*, G) entries; 1 (S, G) entries
(10.110.5.101, 232.1.1.1)
Protocol: pim-ssm, Flag:
UpTime: 00:12:16
Upstream interface: HundredGigE1/0/1
Upstream neighbor: 192.168.2.1
RPF prime neighbor: 192.168.2.1
Downstream interface(s) information:
Total number of downstreams: 1
1: HundredGigE1/0/2
Protocol: igmp, UpTime: 02:54:43, Expires: 00:02:47
通过显示信息可知,在Device A和Device B上配置了IGMP SSM Mapping功能后,Device A将接收者主机发来的IGMPv2成员关系报告报文中所包含的(0.0.0.0,232.1.1.1)信息映射为(10.110.5.100,232.1.1.1)信息,Device B将接收者主机发来的IGMPv2成员关系报告报文中所包含的(0.0.0.0,232.1.1.1)信息映射为(10.110.5.101,232.1.1.1)信息,从而使接收者Host A只接收来自Source 1的组播报文,使接收者Host C只接收来自Source 2的组播报文。
· DeviceA:
#
interface HundredGigE1/0/1
pim sm
#
interface HundredGigE1/0/2
igmp enable
igmp version 3
#
multicast routing
#
pim
ssm-policy 2000
#
igmp
ssm-mapping 10.110.5.100 2000
#
acl basic 2000
rule 0 permit source 232.1.1.0 0.0.0.255
#
· Device B:
#
interface HundredGigE1/0/1
pim sm
#
interface HundredGigE1/0/2
igmp enable
igmp version 3
#
multicast routing
#
pim
ssm-policy 2000
#
igmp
ssm-mapping 10.110.5.100 2000
#
acl basic 2000
rule 0 permit source 232.1.1.0 0.0.0.255
#
· Device C:
#
interface HundredGigE1/0/1
pim sm
#
interface HundredGigE1/0/2
pim sm
#
interface HundredGigE1/0/3
pim sm
#
multicast routing
#
pim
c-bsr 192.168.1.1
c-rp 192.168.1.1
#
· H3C S12500R系列交换路由器 IP组播配置指导-R3606
· H3C S12500R系列交换路由器IP组播命令参考-R3606
不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!