拓扑:

组播穿越MPLS ×××+SSM_SSM

R1配置:

ip multicast-routing
interface Loopback0
ip address 1.1.1.1 255.255.255.0
ip pim sparse-dense-mode
!
interface FastEthernet0/1
ip address 12.1.1.1 255.255.255.0
ip pim sparse-dense-mode
duplex auto
speed auto
!
router rip
version 2
network 1.0.0.0
network 12.0.0.0
no auto-summary
!
ip pim rp-address 1.1.1.1

R2配置:
ip vrf r2
rd 100:2
route-target export 100:2
route-target import 100:2
route-target import 100:4
mdt default 239.192.10.1
!
ip multicast-routing
ip multicast-routing vrf r2
!
mpls label range 200 299
interface Loopback0
ip address 2.2.2.2 255.255.255.255
ip pim sparse-dense-mode
!
interface FastEthernet0/0
ip address 23.1.1.2 255.255.255.0
ip pim sparse-dense-mode
duplex auto
speed auto
mpls ip
!
interface FastEthernet0/1
ip vrf forwarding r2
ip address 12.1.1.2 255.255.255.0
ip pim sparse-dense-mode
duplex auto
speed auto
!
router ospf 100
router-id 2.2.2.2
log-adjacency-changes
network 2.2.2.2 0.0.0.0 area 0
network 23.1.1.0 0.0.0.255 area 0
!
router rip
!
address-family ipv4 vrf r2
redistribute bgp 100 metric transparent
network 12.0.0.0
no auto-summary
version 2
exit-address-family
!
router bgp 100
bgp router-id 2.2.2.2
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 4.4.4.4 remote-as 100
neighbor 4.4.4.4 update-source Loopback0
!
address-family vpnv4
neighbor 4.4.4.4 activate
neighbor 4.4.4.4 send-community extended
exit-address-family
!
address-family ipv4 vrf r2
redistribute rip
no synchronization
exit-address-family
!
ip pim ssm default
!
mpls ldp router-id Loopback0

R3配置:
ip multicast-routing
!
mpls label range 300 399
mpls label protocol ldp
interface Loopback0
ip address 3.3.3.3 255.255.255.255
!
interface FastEthernet0/0
ip address 23.1.1.3 255.255.255.0
ip pim sparse-dense-mode
duplex auto
speed auto
mpls ip
!
interface FastEthernet0/1
ip address 34.1.1.3 255.255.255.0
ip pim sparse-dense-mode
duplex auto
speed auto
mpls ip
!
router ospf 100
router-id 3.3.3.3
log-adjacency-changes
network 3.3.3.3 0.0.0.0 area 0
network 23.1.1.0 0.0.0.255 area 0
network 34.1.1.0 0.0.0.255 area 0
!
ip pim ssm default
mpls ldp router-id Loopback0

R4配置:
ip vrf r4
rd 100:4
route-target export 100:4
route-target import 100:4
route-target import 100:2
mdt default 239.192.10.1
!
ip multicast-routing
ip multicast-routing vrf r4
!
mpls label range 400 499
mpls label protocol ldp
interface Loopback0
ip address 4.4.4.4 255.255.255.255
ip pim sparse-dense-mode
!
interface FastEthernet0/0
ip vrf forwarding r4
ip address 45.1.1.4 255.255.255.0
ip pim sparse-dense-mode
ip igmp version 3
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 34.1.1.4 255.255.255.0
ip pim sparse-dense-mode
duplex auto
speed auto
mpls ip
!
router ospf 100
router-id 4.4.4.4
log-adjacency-changes
network 4.4.4.4 0.0.0.0 area 0
network 34.1.1.0 0.0.0.255 area 0
!
router rip
!
address-family ipv4 vrf r4
redistribute bgp 100 metric transparent
network 45.0.0.0
no auto-summary
version 2
exit-address-family
!
router bgp 100
bgp router-id 4.4.4.4
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 2.2.2.2 remote-as 100
neighbor 2.2.2.2 update-source Loopback0
!
address-family vpnv4
neighbor 2.2.2.2 activate
neighbor 2.2.2.2 send-community extended
exit-address-family
!
address-family ipv4 vrf r4
redistribute rip
no synchronization
exit-address-family
!
ip pim ssm default
!
mpls ldp router-id Loopback0

R5配置:
interface Loopback0
ip address 5.5.5.5 255.255.255.0
ip igmp join-group 232.1.1.5
ip igmp version 3
!
interface FastEthernet0/0
ip address 45.1.1.5 255.255.255.0
ip pim sparse-dense-mode
duplex auto
speed auto
!
router rip
version 2
network 5.0.0.0
network 45.0.0.0
no auto-summary
!
ip pim rp-address 1.1.1.1

验证:

组播穿越MPLS ×××+SSM_SSM_02

组播穿越MPLS ×××+SSM_SSM_03

组播穿越MPLS ×××+SSM_MPLS VPN_04

组播穿越MPLS ×××+SSM_SSM_05

组播穿越MPLS ×××+SSM_MPLS VPN_06