-
配置各接口的IP地址
[LSW1]vlan batch 10 40 50
[LSW1-GigabitEthernet0/0/1]port link-type access
[LSW1-GigabitEthernet0/0/1]port default vlan 50
[LSW1-GigabitEthernet0/0/4]port link-type trunk
[LSW1-GigabitEthernet0/0/4]port trunk allow-pass vlan 40
[LSW1-GigabitEthernet0/0/5]port link-type trunk
[LSW1-GigabitEthernet0/0/5]port trunk allow-pass vlan 10
[LSW1]stp disable
[LSW1-Vlanif10]ip add 10.1.1.1 24
[LSW1-Vlanif50]ip add 192.168.5.1 24
[LSW1-Vlanif40]ip add 10.1.4.1 24
[LSW2]vlan batch 20 60
[LSW2-GigabitEthernet0/0/5]port link-type trunk
[LSW2-GigabitEthernet0/0/5]port trunk allow-pass vlan 20
[LSW2-GigabitEthernet0/0/9]port link-type trunk
[LSW2-GigabitEthernet0/0/9]port trunk allow-pass vlan 60
[LSW2]stp disable
[LSW2-Vlanif20]ip add 10.1.2.2 24
[LSW2-Vlanif60]ip add 192.168.6.2 24
[LSW3]vlan batch 30 60
[LSW3-GigabitEthernet0/0/5]port link-type trunk
[LSW3-GigabitEthernet0/0/5]port trunk allow-pass vlan 30
[LSW3-GigabitEthernet0/0/9]port link-type trunk
[LSW3-GigabitEthernet0/0/9]port trunk allow-pass vlan 60
[LSW3]stp disable
[LSW3-Vlanif30]ip add 10.1.3.3 24
[LSW3-Vlanif60]ip add 192.168.6.3 24
[LSW4]vlan batch 40 70 80
[LSW4-GigabitEthernet0/0/1]port link-type trunk
[LSW4-GigabitEthernet0/0/1]port trunk allow-pass vlan 40
[LSW4-GigabitEthernet0/0/2]port link-type access
[LSW4-GigabitEthernet0/0/2]port default vlan 70
[LSW4-GigabitEthernet0/0/3]port link-type trunk
[LSW4-GigabitEthernet0/0/3]port trunk allow-pass vlan 80
[LSW4-Vlanif40]ip add 10.1.4.4 24
[LSW4-Vlanif70]ip add 192.168.7.4 24
[LSW4-Vlanif80]ip add 10.1.8.4 24
[LSW4]stp disable
[LSW5]vlan batch 10 20 30 80
[LSW5-GigabitEthernet0/0/1]port link-type trunk
[LSW5-GigabitEthernet0/0/1]port trunk allow-pass vlan 10
[LSW5-GigabitEthernet0/0/2]port link-type trunk
[LSW5-GigabitEthernet0/0/2]port trunk allow-pass vlan 20
[LSW5-GigabitEthernet0/0/3]port link-type trunk
[LSW5-GigabitEthernet0/0/3]port trunk allow-pass vlan 30
[LSW5-GigabitEthernet0/0/4]port link-type trunk
[LSW5-GigabitEthernet0/0/4]port trunk allow-pass vlan 80
[LSW5-Vlanif10]ip add 10.1.1.5 24
[LSW5-Vlanif20]ip add 10.1.2.5 24
[LSW5-Vlanif30]ip add 10.1.3.5 24
[LSW5-Vlanif80]ip add 10.1.8.5 24
[LSW5]stp disable
[LSW9]vlan batch 60
[LSW9-GigabitEthernet0/0/1]port link-type access
[LSW9-GigabitEthernet0/0/1]port default vlan 60
[LSW9-GigabitEthernet0/0/2]port link-type trunk
[LSW9-GigabitEthernet0/0/2]port trunk allow-pass vlan 60
[LSW9-GigabitEthernet0/0/3]port link-type trunk
[LSW9-GigabitEthernet0/0/3]port trunk allow-pass vlan 60
[LSW9-Vlanif60]ip add 192.168.6.9 24
[LSW9]stp disable
-
配置单播路由协议:OSPF
[LSW1]ospf 1
[LSW1-ospf-1]area 0
[LSW1-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255
[LSW1-ospf-1-area-0.0.0.0]network 10.1.4.0 0.0.0.255
[LSW1-ospf-1-area-0.0.0.0]network 192.168.5.0 0.0.0.255
[LSW2]ospf 1
[LSW2-ospf-1]area 0
[LSW2-ospf-1-area-0.0.0.0]network 10.1.2.0 0.0.0.255
[LSW2-ospf-1-area-0.0.0.0]network 192.168.6.0 0.0.0.255
[LSW3]ospf 1
[LSW3-ospf-1]area 0
[LSW3-ospf-1-area-0.0.0.0]network 10.1.3.0 0.0.0.255
[LSW3-ospf-1-area-0.0.0.0]network 192.168.6.0 0.0.0.255
[LSW4]ospf 1
[LSW4-ospf-1]area 0
[LSW4-ospf-1-area-0.0.0.0]network 10.1.4.0 0.0.0.255
[LSW4-ospf-1-area-0.0.0.0]network 10.1.8.0 0.0.0.255
[LSW4-ospf-1-area-0.0.0.0]network 192.168.7.0 0.0.0.255
[LSW5]ospf 1
[LSW5-ospf-1]area 0
[LSW5-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255
[LSW5-ospf-1-area-0.0.0.0]network 10.1.2.0 0.0.0.255
[LSW5-ospf-1-area-0.0.0.0]network 10.1.3.0 0.0.0.255
[LSW5-ospf-1-area-0.0.0.0]network 10.1.8.0 0.0.0.255
[LSW9]ospf 1
[LSW9-ospf-1]area 0
[LSW9-ospf-1-area-0.0.0.0]network 192.168.6.0 0.0.0.255
-
使能组播功能,在各接口上使能PIM-SM功能
[LSW1]multicast routing-enable
[LSW1-Vlanif10]pim sm
[LSW1-Vlanif40]pim sm
[LSW1-Vlanif50]pim sm
[LSW2]multicast routing-enable
[LSW2-Vlanif20]pim sm
[LSW2-Vlanif60]pim sm
[LSW3]multicast routing-enable
[LSW3-Vlanif30]pim sm
[LSW3-Vlanif60]pim sm
[LSW4]multicast routing-enable
[LSW4-Vlanif40]pim sm
[LSW4-Vlanif70]pim sm
[LSW4-Vlanif80]pim sm
[LSW5]multicast routing-enable
[LSW5-Vlanif10]pim sm
[LSW5-Vlanif20]pim sm
[LSW5-Vlanif30]pim sm
[LSW5-Vlanif80]pim sm
[LSW9]multicast routing-enable
[LSW9-Vlanif60]pim sm
-
在连接用户主机的接口上使能IGMP功能
[LSW1-Vlanif50]igmp enable
[LSW9-Vlanif60]igmp enable
-
在LSW1接口上使能PIM silent
[LSW1-Vlanif50]pim silent
-
配置RP:同时配置两种RP,默认优选动态RP,静态RP作为备份;指定LSW5同时为C-RP和C-BSR,在LSW5上配置RP服务的组地址范围,及C-BSR和C-RP所在接口位置
[LSW5]acl 2001
[LSW5-acl-basic-2001]rule permit source 225.1.1.1 0.0.0.255
[LSW5]pim
[LSW5-pim]c-bsr Vlanif 20
[LSW5-pim]c-rp Vlanif 20 group-policy 2001
[LSW1]pim
[LSW1-pim]static-rp 10.1.8.5
[LSW2]pim
[LSW2-pim]static-rp 10.1.8.5
[LSW3]pim
[LSW3-pim]static-rp 10.1.8.5
[LSW4]pim
[LSW4-pim]static-rp 10.1.8.5
[LSW5]pim
[LSW5-pim]static-rp 10.1.8.5
[LSW9]pim
[LSW9-pim]static-rp 10.1.8.5
-
在LSW5与Internet相连的接口上配置BSR边界
[LSW4-Vlanif70]pim bsr-boundary
-
验证配置