拓扑:
R1配置;
no ip routing
interface FastEthernet0/1
ip address 12.1.1.1 255.255.255.0
no ip route-cache
ip igmp join-group 224.1.1.1
!
ip default-gateway 12.1.1.2
R7配置:
no ip routing
interface FastEthernet0/0
ip address 57.1.1.7 255.255.255.0
no ip route-cache
duplex auto
speed auto
!
ip default-gateway 57.1.1.5
R2配置:
ip multicast-routing
interface Loopback0
ip address 2.2.2.2 255.255.255.255
ip pim sparse-mode
!
interface Loopback100
ip address 100.100.100.100 255.255.255.255
ip pim sparse-mode
!
interface FastEthernet0/0
ip address 23.1.1.2 255.255.255.0
ip pim sparse-mode
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 12.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 23.1.1.0 0.0.0.255 area 0
network 100.100.100.100 0.0.0.0 area 0
!
router bgp 100
no synchronization
bgp router-id 2.2.2.2
bgp log-neighbor-changes
neighbor 3.3.3.3 remote-as 100 nlri unicast multicast
neighbor 3.3.3.3 update-source Loopback0
no auto-summary
ip pim rp-address 100.100.100.100
ip msdp peer 3.3.3.3 connect-source Loopback0
ip msdp originator-id Loopback0
R3配置:
ip multicast-routing
interface Loopback0
ip address 3.3.3.3 255.255.255.255
ip pim sparse-mode
!
interface FastEthernet0/0
ip address 23.1.1.3 255.255.255.0
ip pim sparse-mode
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 34.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
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
!
router bgp 100
no synchronization
bgp router-id 3.3.3.3
bgp log-neighbor-changes
neighbor 2.2.2.2 remote-as 100 nlri unicast multicast
neighbor 2.2.2.2 update-source Loopback0
neighbor 2.2.2.2 route-reflector-client
neighbor 4.4.4.4 remote-as 100 nlri unicast multicast
neighbor 4.4.4.4 update-source Loopback0
neighbor 4.4.4.4 route-reflector-client
no auto-summary
ip pim rp-address 100.100.100.100
ip msdp peer 4.4.4.4 connect-source Loopback0
ip msdp peer 2.2.2.2 connect-source Loopback0
R4配置:
ip multicast-routing
interface Loopback0
ip address 4.4.4.4 255.255.255.255
ip pim sparse-mode
!
interface Loopback100
ip address 100.100.100.100 255.255.255.255
!
interface FastEthernet0/0
ip address 46.1.1.4 255.255.255.0
ip pim bsr-border
ip pim sparse-mode
ip multicast boundary 1
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 34.1.1.4 255.255.255.0
ip pim sparse-mode
duplex auto
speed auto
!
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
network 100.100.100.100 0.0.0.0 area 0
!
router bgp 100
no synchronization
bgp router-id 4.4.4.4
bgp log-neighbor-changes
redistribute connected route-map connecten-bgp
neighbor 3.3.3.3 remote-as 100 nlri unicast multicast
neighbor 3.3.3.3 update-source Loopback0
neighbor 3.3.3.3 next-hop-self
neighbor 46.1.1.6 remote-as 200 nlri unicast multicast
no auto-summary
!
ip pim rp-address 100.100.100.100
ip msdp peer 3.3.3.3 connect-source Loopback0
ip msdp peer 6.6.6.6 connect-source Loopback0 remote-as 200
ip msdp originator-id Loopback0
!
access-list 1 deny 224.0.1.39
access-list 1 deny 224.0.1.40
access-list 1 deny 230.0.0.0 0.255.255.255
access-list 1 permit any
access-list 40 permit 100.100.100.100
access-list 40 permit 4.4.4.4
access-list 40 deny any
access-list 110 deny ip any host 224.0.2.2
access-list 110 deny ip any host 224.0.1.3
access-list 110 deny ip any host 224.0.1.24
access-list 110 deny ip any host 224.0.1.22
access-list 110 deny ip any host 224.0.1.2
access-list 110 deny ip any host 224.0.1.35
access-list 110 deny ip any host 224.0.1.60
access-list 110 deny ip any host 224.0.1.39
access-list 110 deny ip any host 224.0.1.40
access-list 110 deny ip any 239.0.0.0 0.255.255.255
access-list 110 deny ip 10.0.0.0 0.255.255.255 any
access-list 110 deny ip 127.0.0.0 0.255.255.255 any
access-list 110 deny ip 172.16.0.0 0.15.255.255 any
access-list 110 deny ip 192.168.0.0 0.0.255.255 any
access-list 110 deny ip any 232.0.0.0 0.255.255.255
access-list 110 permit ip any any
!
route-map connecten-bgp permit 10
match ip address 40
set origin igp
R6配置:
ip multicast-routing
!
interface Loopback0
ip address 6.6.6.6 255.255.255.255
ip pim sparse-mode
!
interface FastEthernet0/0
ip address 46.1.1.6 255.255.255.0
ip pim bsr-border
ip pim sparse-mode
ip multicast boundary 1
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 56.1.1.6 255.255.255.0
ip pim sparse-mode
duplex auto
speed auto
!
router ospf 200
router-id 6.6.6.6
log-adjacency-changes
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
no synchronization
bgp router-id 6.6.6.6
bgp log-neighbor-changes
redistribute connected route-map connecten-bgp
neighbor 5.5.5.5 remote-as 200 nlri unicast multicast
neighbor 5.5.5.5 update-source Loopback0
neighbor 46.1.1.4 remote-as 100 nlri unicast multicast
no auto-summary
!
ip pim rp-address 6.6.6.6
ip msdp peer 4.4.4.4 connect-source Loopback0 remote-as 200
ip msdp originator-id Loopback0
!
access-list 1 deny 224.0.1.39
access-list 1 deny 224.0.1.40
access-list 1 deny 230.0.0.0 0.255.255.255
access-list 1 permit any
access-list 60 permit 6.6.6.6
access-list 60 deny any
access-list 110 deny ip any host 224.0.2.2
access-list 110 deny ip any host 224.0.1.3
access-list 110 deny ip any host 224.0.1.24
access-list 110 deny ip any host 224.0.1.22
access-list 110 deny ip any host 224.0.1.2
access-list 110 deny ip any host 224.0.1.35
access-list 110 deny ip any host 224.0.1.60
access-list 110 deny ip any host 224.0.1.39
access-list 110 deny ip any host 224.0.1.40
access-list 110 deny ip any 239.0.0.0 0.255.255.255
access-list 110 deny ip 10.0.0.0 0.255.255.255 any
access-list 110 deny ip 127.0.0.0 0.255.255.255 any
access-list 110 deny ip 172.16.0.0 0.15.255.255 any
access-list 110 deny ip 192.168.0.0 0.0.255.255 any
access-list 110 deny ip any 232.0.0.0 0.255.255.255
access-list 110 permit ip any any
!
!
!
route-map connecten-bgp permit 10
match ip address 60
set origin igp
R5配置:
ip multicast-routing
interface Loopback0
ip address 5.5.5.5 255.255.255.255
ip pim sparse-mode
!
interface FastEthernet0/0
ip address 57.1.1.5 255.255.255.0
ip pim sparse-mode
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 56.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 56.1.1.0 0.0.0.255 area 0
!
router bgp 200
no synchronization
bgp router-id 5.5.5.5
bgp log-neighbor-changes
network 57.1.1.0 mask 255.255.255.0
neighbor 6.6.6.6 remote-as 200 nlri unicast multicast
neighbor 6.6.6.6 update-source Loopback0
no auto-summary
!
no ip http secure-server
ip pim rp-address 6.6.6.6
验证: