拓扑:
R1配置:
ip multicast-routing
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface FastEthernet0/0
ip address 12.1.1.1 255.255.255.0
ip pim sparse-mode
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 17.1.1.1 255.255.255.0
ip pim sparse-mode
duplex auto
speed auto
!
router ospf 100
router-id 1.1.1.1
log-adjacency-changes
passive-interface FastEthernet0/1
network 1.1.1.1 0.0.0.0 area 0
network 12.1.1.0 0.0.0.255 area 0
!
router bgp 100
bgp router-id 1.1.1.1
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 ipv4
neighbor 2.2.2.2 activate
no auto-summary
no synchronization
network 17.1.1.0 mask 255.255.255.0
exit-address-family
ip pim ssm default
R2配置:
ip multicast-routing
interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet0/0
ip address 12.1.1.2 255.255.255.0
ip pim sparse-mode
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 23.1.1.2 255.255.255.0
ip pim sparse-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 12.1.1.0 0.0.0.255 area 0
network 23.1.1.0 0.0.0.255 area 0
!
router bgp 100
bgp router-id 2.2.2.2
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 1.1.1.1 remote-as 100
neighbor 1.1.1.1 update-source Loopback0
neighbor 3.3.3.3 remote-as 100
neighbor 3.3.3.3 update-source Loopback0
!
address-family ipv4
neighbor 1.1.1.1 activate
neighbor 1.1.1.1 route-reflector-client
neighbor 3.3.3.3 activate
neighbor 3.3.3.3 route-reflector-client
no auto-summary
no synchronization
network 2.2.2.2 mask 255.255.255.255
exit-address-family
!
ip pim ssm default
R3配置:
ip multicast-routing
!
interface Loopback0
ip address 3.3.3.3 255.255.255.255
!
interface FastEthernet0/0
ip address 34.1.1.3 255.255.255.0
ip pim sparse-mode
ip multicast boundary 10
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 23.1.1.3 255.255.255.0
ip pim sparse-mode
duplex auto
speed auto
!
router ospf 100
router-id 3.3.3.3
log-adjacency-changes
passive-interface FastEthernet0/0
network 3.3.3.3 0.0.0.0 area 0
network 23.1.1.0 0.0.0.255 area 0
!
router bgp 100
bgp router-id 3.3.3.3
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
neighbor 34.1.1.4 remote-as 200
!
address-family ipv4
neighbor 2.2.2.2 activate
neighbor 2.2.2.2 next-hop-self
neighbor 34.1.1.4 activate
no auto-summary
no synchronization
exit-address-family
!
ip pim ssm default
!
access-list 10 deny 224.0.1.39
access-list 10 deny 224.0.1.40
access-list 10 deny 239.0.0.0 0.255.255.255
access-list 10 permit any
R4配置:
ip multicast-routing
!
interface Loopback0
ip address 4.4.4.4 255.255.255.255
!
interface FastEthernet0/0
ip address 34.1.1.4 255.255.255.0
ip pim sparse-mode
ip multicast boundary 10
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 45.1.1.4 255.255.255.0
ip pim sparse-mode
duplex auto
speed auto
!
router ospf 200
router-id 4.4.4.4
log-adjacency-changes
passive-interface FastEthernet0/0
network 4.4.4.4 0.0.0.0 area 0
network 45.1.1.0 0.0.0.255 area 0
!
router bgp 200
bgp router-id 4.4.4.4
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 5.5.5.5 remote-as 200
neighbor 5.5.5.5 update-source Loopback0
neighbor 34.1.1.3 remote-as 100
!
address-family ipv4
neighbor 5.5.5.5 activate
neighbor 5.5.5.5 next-hop-self
neighbor 34.1.1.3 activate
no auto-summary
no synchronization
exit-address-family
!
no ip http server
ip forward-protocol nd
!
access-list 10 deny 224.0.1.39
access-list 10 deny 224.0.1.40
access-list 10 deny 239.0.0.0 0.255.255.255
access-list 10 permit any
R5配置:
ip multicast-routing
!
interface Loopback0
ip address 5.5.5.5 255.255.255.255
!
interface FastEthernet0/0
ip address 56.1.1.5 255.255.255.0
ip pim sparse-mode
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 45.1.1.5 255.255.255.0
ip pim sparse-mode
duplex auto
speed auto
!
router ospf 200
router-id 5.5.5.5
log-adjacency-changes
network 5.5.5.5 0.0.0.0 area 0
network 45.1.1.0 0.0.0.255 area 0
network 56.1.1.0 0.0.0.255 area 0
!
router bgp 200
bgp router-id 5.5.5.5
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 4.4.4.4 remote-as 200
neighbor 4.4.4.4 update-source Loopback0
neighbor 6.6.6.6 remote-as 200
neighbor 6.6.6.6 update-source Loopback0
!
address-family ipv4
neighbor 4.4.4.4 activate
neighbor 4.4.4.4 route-reflector-client
neighbor 6.6.6.6 activate
neighbor 6.6.6.6 route-reflector-client
no auto-summary
no synchronization
network 5.5.5.5 mask 255.255.255.255
exit-address-family
!
ip pim ssm default
R6配置:
ip multicast-routing
!
interface Loopback0
ip address 6.6.6.6 255.255.255.255
!
interface FastEthernet0/0
ip address 56.1.1.6 255.255.255.0
ip pim sparse-mode
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 68.1.1.6 255.255.255.0
ip pim sparse-mode
ip igmp version 3
duplex auto
speed auto
!
router ospf 200
router-id 6.6.6.6
log-adjacency-changes
passive-interface FastEthernet0/1
network 6.6.6.6 0.0.0.0 area 0
network 56.1.1.0 0.0.0.255 area 0
!
router bgp 200
bgp router-id 6.6.6.6
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 5.5.5.5 remote-as 200
neighbor 5.5.5.5 update-source Loopback0
!
address-family ipv4
neighbor 5.5.5.5 activate
no auto-summary
no synchronization
exit-address-family
!
ip pim ssm default
R7配置:
interface FastEthernet0/0
ip address 17.1.1.7 255.255.255.0
duplex auto
speed auto
!
ip route 0.0.0.0 0.0.0.0 17.1.1.1
R8配置:
interface FastEthernet0/1
ip address 68.1.1.8 255.255.255.0
ip igmp join-group 232.1.1.1 source 17.1.1.7
ip igmp version 3
duplex auto
speed auto
!
ip route 0.0.0.0 0.0.0.0 68.1.1.6
验证: