Configuration:
1) Basic network configuration
IP addresses and OSPF routing area 0 should be configured on each router and PC.
PC1
PC1#ifconfig eth0 192.168.1.2 netmask 255.255.255.0
PC1#route add default gw 192.168.1.1
PC2
PC2#ifconfig eth0 172.16.0.2 netmask 255.255.255.0
PC2#route add default gw 172.16.0.1
Router MA1
MA1(config)#hostname MA1
MA1(config)#interface #MA1:MA1-SW#
MA1(config-if)#ip address 10.0.0.1 255.255.255.0
MA1(config-if)#no shutdown
MA1(config)#router ospf 1
MA1(config-router)#network 10.0.0.0 0.0.0.255 area 0
Router MA2
MA2(config)#hostname MA2
MA2(config)#interface #MA2:MA2-SW#
MA2(config-if)#ip address 10.0.0.2 255.255.255.0
MA2(config-if)#no shutdown
MA2(config)#router ospf 1
MA2(config-router)#network 10.0.0.0 0.0.0.255 area 0
Router RP1
RP1(config)#hostname RP1
RP1(config)#interface #RP1:RP1-SW#
RP1(config-if)#ip address 10.0.0.4 255.255.255.0
RP1(config-if)#no shutdown
RP1(config)#router ospf 1
RP1(config-router)#network 10.0.0.0 0.0.0.255 area 0
Router RP2
RP2(config)#hostname RP2
RP2(config)#interface #RP2:RP2-SW#
RP2(config-if)#ip address 10.0.0.6 255.255.255.0
RP2(config-if)#no shutdown
RP2(config)#router ospf 1
RP2(config-router)#network 10.0.0.0 0.0.0.255 area 0
Router R1
R1(config)#hostname R1
R1(config)#interface #R1:R1-SW#
R1(config-if)#ip address 10.0.0.3 255.255.255.0
R1(config-if)#no shutdown
R1(config)#interface #R1:PC1-R1#
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config)#router ospf 1
R1(config-router)#network 10.0.0.0 0.0.0.255 area 0
R1(config-router)#network 192.168.1.0 0.0.0.255 area 0
Router R2
R2(config)#hostname R2
R2(config)#interface #R2:R2-SW#
R2(config-if)#ip address 10.0.0.5 255.255.255.0
R2(config-if)#no shutdown
R2(config)#interface #R2:PC2-R2#
R2(config)#ip address 172.16.0.1 255.255.255.0
R2(config-if)#no shutdown
R2(config)#router ospf 1
R2(config-router)#network 10.0.0.0 0.0.0.255 area 0
R2(config-router)#network 172.16.0.0 0.0.0.255 area 0
Test connectivity between devices using ping command.
2) Multicast configuration – mapping agents
Router MA1
MA1(config)#ip multicast-routing; enable multicast routing on the router
MA1(config)#interface #MA1:MA1-SW#
MA1(config-if)#ip pim sparse-dense-mode; enable PIM protocol in sparse-dense mode
MA1(config)#ip pim send-rp-discovery scope 100; set router as Mapping agent, hello messages will be sent with TTL 100
Router MA2
MA2(config)#ip multicast-routing; enable multicast routing on the router
MA2(config)#interface #MA2:MA2-SW#
MA2(config-if)#ip pim sparse-dense-mode; enable PIM protocol in sparse-dense mode
MA2(config)#ip pim send-rp-discovery scope 100; set router as Mapping agent, hello messages will be sent with TTL 100
3) Multicast configuration – rendezvouz points
Router RP1
RP1(config)#ip multicast-routing
RP1(config)#interface #RP1:RP1-SW#
RP1(config-if)#ip pim sparse-dense-mode; enable PIM protocol in sparse-dense mode
RP1(config)#ip pim send-rp-announce 10.0.0.4 scope 100; set router to announce itself as RP candidate
RP1(config)#ip pim send-rp-announce #RP1:RP1-SW# scope 100 interval 20; set router to announce itself as RP candidate on interface #RP1:RP1-SW#, TTL 100, every 20 seconds
Router RP2
RP2(config)#ip multicast-routing
RP2(config)#interface #RP2:RP2-SW#
RP2(config-if)#ip pim sparse-dense-mode; enable PIM protocol in sparse-dense mode
RP2(config)#ip pim send-rp-announce 10.0.0.6 scope 100; set router to announce itself as RP candidate
RP2(config)#ip pim send-rp-announce #RP2:RP2-SW# scope 100 interval 20;set router to announce itself as RP candidate on interface #RP2:RP2-SW#, TTL 100, every 20 seconds
4) Multicast configuration – client routers
Router R1
R1(config)#ip multicast-routing
R1(config)#interface #R1:R1-SW#
R1(config-if)#ip pim sparse-dense-mode
R1(config)#interface #R1:PC1-R1#
R1(config-if)#ip pim sparse-dense-mode
Router R2
R2(config)#ip multicast-routing
R2(config)#interface #R2:R2-SW#
R2(config-if)#ip pim sparse-dense-mode
R2(config)#interface #R2:PC2-R2#
R2(config-if)#ip pim sparse-dense-mode
Function test:
1) Turn PIM debugging on
MA1# debug ip pim; turn PIM debuggign on to display PIM communication
2) Display PIM information
MA1# sh ip pim rp mapping; show which router is RP
MA1# sh ip pim autorp ; display if auto RP is enabled
MA1# sh ip pim neighbor ; display PIM neighbors
3) send multicast traffic
PC1# mcast -4 -s -a 239.0.10.10 -m "This is multicast message"; run mcast application as sender of IPv4 multicast traffic to group address 239.0.10.10
PC2# mcast -4 -l -a 239.0.10.10 ; run mcast application as listener of IPv4 multicast traffic to group address 239.0.10.10
4) Turn RP2 off to initiate RP1 to be rendezvouz point
RP2(config)#interface #RP2:RP2-SW#
RP2(config-if)#shutdown
; after interface shutdown router RP2 will no longer act as RP, RP role will be switched to the RP1 which has lower IP address
5) Display PIM information
MA1# sh ip pim rp mapping; show which router is RP
MA1# sh ip pim autorp ; display if auto RP is enabled
MA1# sh ip pim neighbor ; display PIM neighbors
6) Turn MA2 off to use MA1 as mapping agent
MA2(config)#interface #MA2:MA2-SW#
MA2(config-if)#shutdown
; after interface shutdown router MA2 will no longer act as mapping agent, role will be swithed to the MA1 which has lower IP address
7) Display PIM information
MA1# sh ip pim rp mapping; show which router is RP
MA1# sh ip pim autorp ; display if auto RP is enabled
MA1# sh ip pim neighbor ; display PIM neighbors