02-IGMP典型配置举例
本章节下载: 02-IGMP典型配置举例 (224.51 KB)
目 录
IGMP(Internet Group Management Protocol,互联网组管理协议)用于在三层设备和其直连网段中的用户主机之间建立和维护组播组成员关系。本文介绍了IGMP的典型配置举例。
本文档中的配置均是在实验室环境下进行的配置和验证,配置前设备的所有参数均采用出厂时的缺省配置。如果您已经对设备进行了配置,为了保证配置效果,请确认现有配置和以下举例中的配置不冲突。
本文档假设您已了解IGMP特性。
如图1所示,网络中运行OSPF和PIM-DM,接收者通过组播方式接收视频点播信息,不同组织的接收者组成末梢网络N1和N2,Host A和Host C分别为N1和N2中的组播信息接收者。Switch A与N1之间运行IGMPv2,Switch A为IGMP查询器;Switch B、Switch C与N2之间也分别运行IGMPv2,且由于Switch B的接口IP地址较小,因此由其充当IGMP查询器。现要求:
· 网络N1内的接收者所能加入的组播组不做限制。
· 控制网络N2内的接收者只能加入组播组224.1.1.1。
图1 IGMP基本功能配置组网图
· 因共享网段N2内有多台IGMP交换机,为实现本组网需求,需要在该共享网段内的所有IGMP交换机上都配置相同的IGMP组播组过滤器。
· 为实现IGMP组播组过滤器控制主机加入组播组的范围,需要为其创建基本ACL,并在该ACL规则中指定允许主机加入的组播组范围。
产品 |
软件版本 |
S12500G-AF |
Release 8053P05及以上版本 |
S12500CR |
Release 8053P05及以上版本 |
S10500X-G |
Release 7753P05及以上版本 |
S7500X-G |
Release 7753P05及以上版本 |
S7000X |
Release 7753P05及以上版本 |
由于不同版本IGMP协议的报文结构与种类不同,因此需要为同一网段上的所有三层交换机配置相同版本的IGMP,否则IGMP将不能正常运行。
(1) 配置PIM-DM域内各交换机的IP地址和单播路由协议
# 配置PIM-DM域内交换机上各接口的IP地址和子网掩码,具体配置过程略。
# 配置PIM-DM域内的各交换机之间采用OSPF协议进行互连,确保PIM-DM域内部在网络层互通,具体配置过程略。
(2) 配置Switch A
# 在Switch A上使能IP组播路由,在接口Vlan-interface101上使能PIM-DM,并在主机侧接口Vlan-interface 100上使能IGMP。
<SwitchA> system-view
[SwitchA] multicast routing
[SwitchA-mrib] quit
[SwitchA] interface vlan-interface 100
[SwitchA-Vlan-interface100] igmp enable
[SwitchA-Vlan-interface100] quit
[SwitchA] interface vlan-interface 101
[SwitchA-Vlan-interface101] pim dm
[SwitchA-Vlan-interface101] quit
(3) 配置Switch B
# 在Switch B上使能IP组播路由,在接口Vlan-interface201上使能PIM-DM,并在主机侧接口Vlan-interface200上使能IGMP及配置组播组过滤器,以在Switch B上限制用户网络N2内的主机只能加入组播组224.1.1.1。
<SwitchB> system-view
[SwitchB] acl basic 2001
[SwitchB-acl-ipv4-basic-2001] rule permit source 224.1.1.1 0
[SwitchB-acl-ipv4-basic-2001] quit
[SwitchB] multicast routing
[SwitchB-mrib] quit
[SwitchB] interface vlan-interface 200
[SwitchB-Vlan-interface200] igmp enable
[SwitchB-Vlan-interface200] igmp group-policy 2001
[SwitchB-Vlan-interface200] quit
[SwitchB] interface vlan-interface 201
[SwitchB-Vlan-interface201] pim dm
[SwitchB-Vlan-interface201] quit
(4) 配置Switch C
# 在Switch C上使能IP组播路由,在接口Vlan-interface202上使能PIM-DM,并在主机侧接口Vlan-interface200上使能IGMP及配置组播组过滤器,以在Switch C上限制用户网络N2内的主机只能加入组播组224.1.1.1。
<SwitchC> system-view
[SwitchC] acl basic 2001
[SwitchC-acl-ipv4-basic-2001] rule permit source 224.1.1.1 0
[SwitchC-acl-ipv4-basic-2001] quit
[SwitchC] multicast routing
[SwitchC-mrib] quit
[SwitchC] interface vlan-interface 200
[SwitchC-Vlan-interface200] igmp enable
[SwitchC-Vlan-interface200] igmp group-policy 2001
[SwitchC-Vlan-interface200] quit
[SwitchC] interface vlan-interface 202
[SwitchC-Vlan-interface202] pim dm
[SwitchC-Vlan-interface202] quit
(1) 配置完成后,用户网络N1内的组播接收者Host A(地址为10.110.1.10)分别发送组播组地址为224.1.1.1和224.1.1.2的IGMP成员关系报告报文,通过display igmp group命令查看Switch A上IGMP组播组信息,验证配置效果。
# 查看Switch A上IGMP组播组信息。
[SwitchA] display igmp group
IGMP groups in total: 2
Vlan-interface100 (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成员关系报告报文,因Switch 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命令查看Switch B和Switch C上IGMP组播组信息,验证配置效果。
# 查看Switch B上IGMP组播组信息。
[SwitchB] display igmp group
IGMP groups in total: 1
Vlan-interface200(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
# 查看Switch C上IGMP组播组信息。
[SwitchC] display igmp group
IGMP groups in total: 1
Vlan-interface200(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成员关系报告报文,而Switch B和Switch C上只有组播组224.1.1.1的IGMP组播组信息,由此可见在Switch B和Switch C上配置的IGMP组播组过滤器已生效,用户网络N2内的组播接收者只能加入组播组224.1.1.1。
· Switch A:
#
vlan 100 to 101
#
interface Vlan-interface100
ip address 10.110.1.1 255.255.255.0
igmp enable
#
interface Vlan-interface101
ip address 10.111.1.1 255.255.255.0
pim dm
#
interface Ten-GigabitEthernet3/0/1
port link-mode bridge
port access vlan 100
#
interface Ten-GigabitEthernet3/0/2
port link-mode bridge
port access vlan 101
#
multicast routing
#
· Switch B:
#
acl basic 2001
rule 0 permit source 224.1.1.1 0
#
vlan 200 to 201
#
interface Vlan-interface200
ip address 10.110.2.1 255.255.255.0
igmp enable
igmp group-policy 2001
#
interface Vlan-interface201
ip address 10.111.2.1 255.255.255.0
pim dm
#
interface Ten-GigabitEthernet3/0/1
port link-mode bridge
port access vlan 200
#
interface Ten-GigabitEthernet3/0/2
port link-mode bridge
port access vlan 201
#
multicast routing
#
· Switch C:
#
acl basic 2001
rule 0 permit source 224.1.1.1 0
#
vlan 200
#
vlan 202
#
interface Vlan-interface200
ip address 10.110.2.2 255.255.255.0
igmp enable
igmp group-policy 2001
#
interface Vlan-interface202
ip address 10.111.3.1 255.255.255.0
pim dm
#
interface Ten-GigabitEthernet3/0/1
port link-mode bridge
port access vlan 200
#
interface Ten-GigabitEthernet3/0/2
port link-mode bridge
port access vlan 202
#
multicast routing
#
如图2所示,网络中运行OSPF和PIM-DM,接收者通过组播方式接收视频点播信息,不同组织的接收者组成末梢网络N1和N2,Host A和Host C分别为N1和N2中的组播信息接收者。Switch A与N1之间运行IGMPv2,Switch A为IGMP查询器;Switch B、Switch C与N2之间也分别运行IGMPv2,且由于Switch 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的Switch A接口上配置静态加入组播组来实现该需求。
· 为实现IGMP组播组过滤器控制主机加入组播组的范围,需要为其创建基本ACL,并在该ACL规则中指定允许主机加入的组播组范围。
· 因共享网段N2内有多台IGMP交换机,为实现本组网需求,需要在该共享网段内的所有IGMP交换机上都配置相同的IGMP组播组过滤器。
产品 |
软件版本 |
S12500G-AF |
Release 8053P05及以上版本 |
S12500CR |
Release 8053P05及以上版本 |
S10500X-G |
Release 7753P05及以上版本 |
S7500X-G |
Release 7753P05及以上版本 |
S7000X |
Release 7753P05及以上版本 |
由于不同版本IGMP协议的报文结构与种类不同,因此需要为同一网段上的所有三层交换机配置相同版本的IGMP,否则IGMP将不能正常运行。
(1) 配置PIM-DM域内各交换机的IP地址和单播路由协议
# 配置PIM-DM域内交换机上各接口的IP地址和子网掩码,具体配置过程略。
# 配置PIM-DM域内的各交换机之间采用OSPF协议进行互连,确保PIM-DM域内部在网络层互通,具体配置过程略。
(2) 配置Switch A
# 在Switch A上使能IP组播路由,并在接口Vlan-interface101上使能PIM-DM。
<SwitchA> system-view
[SwitchA] multicast routing
[SwitchA-mrib] quit
[SwitchA] interface vlan-interface 101
[SwitchA-Vlan-interface101] pim dm
[SwitchA-Vlan-interface101] quit
# 在主机侧接口Vlan-interface 100上使能IGMP,并配置该接口静态加入组播组224.1.1.2。
[SwitchA] interface vlan-interface 100
[SwitchA-Vlan-interface100] igmp enable
[SwitchA-Vlan-interface100] igmp static-group 224.1.1.2
[SwitchA-Vlan-interface100] quit
(3) 配置Switch B
# 在Switch B上使能IP组播路由,并在接口Vlan-interface201上使能PIM-DM。
<SwitchB> system-view
[SwitchB] multicast routing
[SwitchB-mrib] quit
[SwitchB] interface vlan-interface 201
[SwitchB-Vlan-interface201] pim dm
[SwitchB-Vlan-interface201] quit
# 配置ACL 2001用于组播过滤器。
[SwitchB] acl basic 2001
[SwitchB-acl-ipv4-basic-2001] rule permit source 224.1.1.1 0
[SwitchB-acl-ipv4-basic-2001] quit
# 在主机侧接口Vlan-interface200上使能IGMP及配置组播组过滤器,以在Switch B上限制用户网络N2内的主机只能加入组播组224.1.1.1
[SwitchB] interface vlan-interface 200
[SwitchB-Vlan-interface200] igmp enable
[SwitchB-Vlan-interface200] igmp group-policy 2001
[SwitchB-Vlan-interface200] quit
(4) 配置Switch C
# 在Switch C上使能IP组播路由,并在接口Vlan-interface201上使能PIM-DM。
<SwitchC> system-view
[SwitchC] multicast routing
[SwitchC-mrib] quit
[SwitchC] interface vlan-interface 202
[SwitchC-Vlan-interface202] pim dm
[SwitchC-Vlan-interface202] quit
# 配置ACL 2001用于组播过滤器。
[SwitchC] acl basic 2001
[SwitchC-acl-ipv4-basic-2001] rule permit source 224.1.1.1 0
[SwitchC-acl-ipv4-basic-2001] quit
# 在主机侧接口Vlan-interface200上使能IGMP及配置组播组过滤器,以在Switch C上限制用户网络N2内的主机只能加入组播组224.1.1.1
[SwitchC] interface vlan-interface 200
[SwitchC-Vlan-interface200] igmp enable
[SwitchC-Vlan-interface200] igmp group-policy 2001
[SwitchC-Vlan-interface200] quit
(1) 配置完成后,用户网络N1内的组播接收者Host A(地址为10.110.1.10)分别发送组播组地址为224.1.1.1和224.1.1.2的IGMP成员关系报告报文,通过display igmp group命令查看Switch A上IGMP组播组信息,验证配置效果。
# 查看Switch A上动态加入的IGMP组播组信息。
[SwitchA] display igmp group
IGMP groups in total: 2.
Vlan-interface100 (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
# 显示Switch A上静态加入的IGMP组播组信息。
[SwitchA] display igmp group static
Entries in total: 1
Group address Source address Interface Expires
224.1.1.2 0.0.0.0 Vlan100 Never
Host A发送了组播组地址为224.1.1.1和224.1.1.2的IGMP成员关系报告报文,因Switch 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命令查看Switch B和Switch C上IGMP组播组信息,验证配置效果。
# 查看Switch B上动态加入的IGMP组播组信息。
[SwitchB] display igmp group
IGMP groups in total: 1
Vlan-interface200(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
# 查看Switch C上动态加入的IGMP组播组信息。
[SwitchC] display igmp group
IGMP groups in total: 1
Vlan-interface200(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成员关系报告报文,而Switch B和Switch C上只有组播组224.1.1.1的IGMP组播组信息,由此可见在Switch B和Switch C上配置的IGMP组播组过滤器已生效,用户网络N2内的组播接收者只能加入组播组224.1.1.1。
· Switch A:
#
vlan 100 to 101
#
interface Vlan-interface100
ip address 10.110.1.1 255.255.255.0
igmp enable
igmp static-group 224.1.1.2
#
interface Vlan-interface101
ip address 10.111.1.1 255.255.255.0
pim dm
#
interface Ten-GigabitEthernet3/0/1
port link-mode bridge
port access vlan 100
#
interface Ten-GigabitEthernet3/0/2
port link-mode bridge
port access vlan 101
#
multicast routing
#
· Switch B:
#
acl basic 2001
rule 0 permit source 224.1.1.1 0
#
vlan 200 to 201
#
interface Vlan-interface200
ip address 10.110.2.1 255.255.255.0
igmp enable
igmp group-policy 2001
#
interface Vlan-interface201
ip address 10.111.2.1 255.255.255.0
pim dm
#
interface Ten-GigabitEthernet3/0/1
port link-mode bridge
port access vlan 200
#
interface Ten-GigabitEthernet3/0/2
port link-mode bridge
port access vlan 201
#
multicast routing
#
· Switch C:
#
acl basic 2001
rule 0 permit source 224.1.1.1 0
#
vlan 200
#
vlan 202
#
interface Vlan-interface200
ip address 10.110.2.2 255.255.255.0
igmp enable
igmp group-policy 2001
#
interface Vlan-interface202
ip address 10.111.3.1 255.255.255.0
pim dm
#
interface Ten-GigabitEthernet3/0/1
port link-mode bridge
port access vlan 200
#
interface Ten-GigabitEthernet3/0/2
port link-mode bridge
port access vlan 202
#
multicast routing
#
不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!