1.组播IGMP的各种情况
2.PIM Dense-Mode
3.PIM Sparse-Mode
4.PIM双向树和SSM
5.动态RP之auto-rp
6.动态RP之BSR
7.Anycast RP
8.域间组播
9.IPv6组播

enable
conf t
no ip do lo
enable pass cisco
line con 0
logg sync
exec-t 0 0
exit
line vty 0 4
pass cisco
logg sync
exit
host

1.组播IGMP的各种情况
------------------------------------------------------

实验目的
1.深入了解IGMPv1,IGMPv2,IGMPv3的区别
2.掌握配置IGMPv1,IGMPv2,IGMPv3的方法
3.理解不同IGMP版本查询路由器(querying router)的选举方法
4.理解DR的作用和选取方法
5.理解最后一个报告者(last reporter)的概念和不同IGMP版本的主机离开组的方式
6.理解IGMPv2最后一跳路由器的两种查询方法
7.理解fast leave
8.理解配置限制特定组的加入
9.理解IGMPv3的report方式如何兼容IGMPv2

实验假设:R1和R2模拟两台PC,加入组播组。R3和R4模拟最后一跳路由器


基本配置:
完成IP地址和IGP的配置,IGP为全网运行OSPF,均运行在area 0.

R1:
int f0/0
ip add 1.1.1.1 255.255.255.0
no shut
exit
int l0
ip add 11.1.1.1 255.255.255.0
exit

router ospf 1
router-id 11.1.1.1
network 1.1.1.0 0.0.0.255 area 0
network 11.1.1.0 0.0.0.255 area 0
exit

R2:
int f0/0
ip add 1.1.1.2 255.255.255.0
no shut
exit
int l0
ip add 22.1.1.1 255.255.255.0
exit

router ospf 1
router-id 22.1.1.1
network 1.1.1.0 0.0.0.255 area 0
network 22.1.1.0 0.0.0.255 area 0
exit

R3:
int f0/0
ip add 1.1.1.3 255.255.255.0
no shut
exit
int l0
ip add 33.1.1.1 255.255.255.0
exit

router ospf 1
router-id 33.1.1.1
network 1.1.1.0 0.0.0.255 area 0
network 33.1.1.0 0.0.0.255 area 0
exit

R4:
int f0/0
ip add 1.1.1.4 255.255.255.0
no shut
exit
int l0
ip add 44.1.1.1 255.255.255.0
exit

router ospf 1
router-id 44.1.1.1
network 1.1.1.0 0.0.0.255 area 0
network 44.1.1.0 0.0.0.255 area 0
exit
View Code

-----------------------------------------------------
R3/R4:
ip multicast-routing
int f0/0
ip pim sparse-mode
exit

R2:
show ip igmp int f0/0

R3/R4:
show ip igmp int f0/0
show ip pim int

查询路由器的作用:在有多个最后一跳路由器的情况下,由查询路由器发起IGMP的查询(query)消息。IGMPv2和IGMPv3的查询路由器的选取原则为接口IP地址小的为查询路由器。

DR的作用:在有多个第一跳路由器的情况下,由DR负责转发组播源发出的组播流和向RP注册;在有多个最后一跳路由器的情况下,由DR负责向组播源或者RP发送PIM的join消息。
DR的选取原则:优选DR优先级高的为DR,如果优先级一样,则选取IP地址大的为DR。

----------------------------------------------------
R3:
int f0/0
ip pim dr-priority 2
exit

show ip pim int

int f0/0
ip igmp ver 1
no ip pim dr-priority 2
exit

R4:
int f0/0
ip igmp ver 1
exit

show ip igmp int f0/0

DR路由器同时也是IGMPv1的查询路由器。

-----------------------------------------------
观察IGMP在最后一跳路由器和主机之间的交互情况,如哪台主机是last reporter, reporter抑制功能,主机离开一个组是否发送leave信息。

R3/R4:
int f0/0
ip igmp ver 2
exit

R1/R2:
int f0/0
ip igmp join-group 228.1.1.1
exit

R3:
debug ip igmp
no debug all
show ip igmp groups

当前R3的last reporter是R2

R2:
int f0/0
no ip igmp join-group 228.1.1.1

当last reporter离开一个组的时候,要发送leave报文通知最后一跳路由器,然后路由器连续发送两个查询报文,查询是否还有该组的接收者存在,此时的查询报文是针对特定组的查询;对于非last reporter离开一个组,不需要发送leave报文,因为这个时候路由器记录的组播接收者不是它。普通查询是周期性的,为60s一次,特定组的查询是针对有用户发出leave报文才触发的。

-----------------------------------------
fast leave: 在最后一跳路由器的接口只有一个接收者的情况下,如果接受者离开该组,发送leave报文,路由器不需要发送查询报文,直接停止发送组播流到该接口,这样可以大大的减少leave latency。

R3:
access-list 1 permit 229.1.1.1
int f0/0
ip igmp immediate-leave group-list 1
exit

R1:
int f0/0
ip igmp join-group 229.1.1.1
no ip igmp join-group 229.1.1.1
exit

-----------------------------------------------
缺省情况下,最后一跳路由器可以接收任何主机加入任何组。可以配置最后一跳路由器限制特定组的加入。(IGMPv2)

R3:
access-list 2 permit 228.1.1.1
access-list 2 permit 229.1.1.1
int f0/0
ip igmp access-group 2
exit

R1:
int f0/0
ip igmp join-group 230.1.1.1
exit

-------------------------------------------------------
IGMPv3支持针对特定源的特定组加入功能。

R2:
int f0/0
shutdown
exit

R3:
int f0/0
ip igmp version 3
ip pim sparse-mode
exit

end
show running-config int f0/0
conf t

R1:
int f0/0
ip igmp version 3
ip igmp join-group 232.1.1.1 source 33.1.1.1
ip igmp join-group 228.1.1.1
exit

end
show running-config int f0/0
conf t

R3:
show ip igmp groups detail

针对232.1.1.1,加入指定源33.1.1.1,为include模式,也就是说只能接收33.1.1.1发出的目的地址为232.1.1.1的组播流;
针对228.1.1.1,为exclude模式,但是排除的组播源列表为空,也就是说可以接收任何组播源发出的目的地址为228.1.1.1的组播流,这样就实现了对IGMPv2的兼容。

2.PIM Dense-Mode
------------------------------------------------------------------------------------------------------

实验目的
1.掌握配置PIM DM的基本步骤
2.掌握trouble shooting PIM DM
3.理解PIM的工作过程,体会组播树的生成和维护过程
4.理解assert选举方法和在哪些链路会选举assert路由器
5.理解嫁接过程
6.理解剪枝过程
7.深入理解RPF检查
8.理解组播路由表的标识位

实验假设:R5模拟组播源,R3模拟第一跳路由器,R7模拟最后一跳路由器,R8模拟组播接收者。
完成IP地址和IGP的配置,IGP为全网运行OSPF,均运行在area 0.

配置接口以及IGP(OSPF)

R1:
int f0/0
ip add 1.1.1.1 255.255.255.0
no shut
exit
int l0
ip add 11.1.1.1 255.255.255.0
exit
int f1/0
ip add 17.1.1.1 255.255.255.0
no shut
exit

router ospf 1
router-id 11.1.1.1
network 1.1.1.0 0.0.0.255 area 0
network 11.1.1.0 0.0.0.255 area 0
network 17.1.1.0 0.0.0.255 area 0
exit

R2:
int f0/0
ip add 1.1.1.2 255.255.255.0
no shut
exit
int l0
ip add 22.1.1.1 255.255.255.0
exit
int s2/0
ip add 27.1.1.2 255.255.255.0
no shut
exit
int s2/1
ip add 23.1.1.2 255.255.255.0
no shut
exit

router ospf 1
router-id 22.1.1.1
network 1.1.1.0 0.0.0.255 area 0
network 22.1.1.0 0.0.0.255 area 0
network 23.1.1.0 0.0.0.255 area 0
network 27.1.1.0 0.0.0.255 area 0
exit

R3:
int f0/0
ip add 1.1.1.3 255.255.255.0
no shut
exit
int l0
ip add 33.1.1.1 255.255.255.0
exit
int f0/1
ip add 36.1.1.3 255.255.255.0
no shut
exit
int f1/0
ip add 35.1.1.3 255.255.255.0
no shut
exit
int s2/1
ip add 23.1.1.3 255.255.255.0
no shut
exit

router ospf 1
router-id 33.1.1.1
network 1.1.1.0 0.0.0.255 area 0
network 33.1.1.0 0.0.0.255 area 0
network 35.1.1.0 0.0.0.255 area 0
network 36.1.1.0 0.0.0.255 area 0
network 23.1.1.0 0.0.0.255 area 0
exit

R4:
int f0/0
ip add 1.1.1.4 255.255.255.0
no shut
exit
int l0
ip add 44.1.1.1 255.255.255.0
exit

router ospf 1
router-id 44.1.1.1
network 1.1.1.0 0.0.0.255 area 0
network 44.1.1.0 0.0.0.255 area 0
exit

R5:
int f1/0
ip add 35.1.1.5 255.255.255.0
no shut
exit
int l0
ip add 55.1.1.1 255.255.255.0
exit

router ospf 1
router-id 55.1.1.1
network 35.1.1.0 0.0.0.255 area 0
network 55.1.1.0 0.0.0.255 area 0
exit

R6:
int f0/1
ip add 36.1.1.6 255.255.255.0
no shut
exit
int l0
ip add 66.1.1.1 255.255.255.0
exit

router ospf 1
router-id 66.1.1.1
network 36.1.1.0 0.0.0.255 area 0
network 66.1.1.0 0.0.0.255 area 0
exit

R7:
int f0/0
ip add 78.1.1.7 255.255.255.0
no shut
exit
int f1/0
ip add 17.1.1.7 255.255.255.0
no shut
exit
int s2/0
ip add 27.1.1.7 255.255.255.0
no shut
exit
int l0
ip add 77.1.1.1 255.255.255.0
exit

router ospf 1
router-id 77.1.1.1
network 78.1.1.0 0.0.0.255 area 0
network 17.1.1.0 0.0.0.255 area 0
network 27.1.1.0 0.0.0.255 area 0
network 77.1.1.0 0.0.0.255 area 0
exit

R8:
int f0/0
ip add 78.1.1.8 255.255.255.0
no shut
exit
int l0
ip add 88.1.1.1 255.255.255.0
exit

router ospf 1
router-id 88.1.1.1
network 78.1.1.0 0.0.0.255 area 0
network 88.1.1.0 0.0.0.255 area 0
exit
View Code

配置PIM Dense-Mode(除组播源及接受者外)

R1:
ip multicast-routing
int f0/0
ip pim dense-mode
exit
int f1/0
ip pim dense-mode
exit

R2:
ip multicast-routing
int f0/0
ip pim dense-mode
exit
int s2/0
ip pim dense-mode
exit
int s2/1
ip pim dense-mode
exit

R3:
ip multicast-routing
int f0/0
ip pim dense-mode
exit
int f0/1
ip pim dense-mode
exit
int f1/0
ip pim dense-mode
exit
int s2/1
ip pim dense-mode
exit

R4:
ip multicast-routing
int f0/0
ip pim dense-mode
exit

R6:
ip multicast-routing
int f0/1
ip pim dense-mode
exit

R7:
ip multicast-routing
int f0/0
ip pim dense-mode
exit
int f1/0
ip pim dense-mode
exit
int s2/0
ip pim dense-mode
exit
View Code

-------------------------------------------------
R2:
show ip pim int
show ip pim neighbor

R8:
int f0/0
ip igmp join-group 228.1.1.1
exit

R7:
show ip mroute

R5:
ping 228.1.1.1 repeat 10000

ping产生的是组播数据流,沿着组播树到达接收者,接收者然后单播发送echo reply报文到组播源,所以看到reply报文是从78.1.1.8来的。
由于测试数据分别经过组播树和单播路由,因此如果测试不成功,并不代表组播树一定有问题,还可能是单播的路由有故障,此时可以在接收者上debug ip icmp来判断。

R6:
int l0
ip pim dense-mode
ip igmp join-group 228.1.1.1
exit

R5:
ping 228.1.1.1 repeat 10000

R3/R1/R2/R7:
show ip mroute

可以看到组播路径是R5->R3->R1->R7->R8。在R3的s2/1的出接口和R2的s2/0的出接口上都有A标识,标识是该链路的assert路由器,避免重复组播流。
assert路由器选取原则:优选去往组播源IGP metric值小的路由器,其次选IP地址大的路由器。

每个路由器转发组播包的时候,都需要做RPF(reverse path forwarding)检查,确定收到组播的接口与echo reply的接口一致,否则丢弃组播包,此处检查的依据是组播源。
RPF检查的顺序:组播静态路由-->DVMRP(现实中不用)-->MB-BGP学习到的路由-->单播协议学习到的路由

对于每个组,路由器上的组播路由表都有两个表项,分别为(*,G)和(S,G),在转发组播数据流的时候,是依据(S,G)表项来进行的,可以理解为最长匹配原则。

(S,G)表项的计时器是由于有组播流触发而生成的。

R7:
show ip rpf 35.1.1.5

观察graft和prume
---------------------------------------------------------------------------
R8:
int f0/0
no ip igmp join-group 228.1.1.1
exit

R7:
debug ip pim

R8:
int f0/0
ip igmp join-group 228.1.1.1
no ip igmp join-group 228.1.1.1
exit

R7:
ip mroute 35.1.1.5 255.255.255.255 27.1.1.2
end

show ip rpf 35.1.1.5

R8:
int f0/0
ip igmp join-group 228.1.1.1
exit

R2/R7:
show ip mroute

Trouble Shooting commands:
-------------------------------------------------------------------------

show ip pim interface
show ip pim neighbor
mrinfo {hostname | add}
show ip rpf {source-add | name}
show ip route
show ip igmp interface
show ip igmp groups
show ip mroute
show ip mroute summary
show ip mroute count
show ip mroute active
debug ip mrouting [group]
debug ip mpacket [detail][access-list][group]
debug ip pim [group]


3.PIM Sparse-Mode
----------------------------------------------------------------------------------------------------------------

实验目的:
1.掌握Sparse-Mode的配置方法
2.观察Sparse-Mode共享树的生成和维护过程
3.观察Sparse-Mode源树的生成和维护过程
4.观察Sparse-Mode共享树向源树的切换过程
5.观察Sparse-Mode标识
6.掌握测试Sparse-Mode的方法和思路

实验假设:R5模拟组播源,R3模拟第一跳路由器,R2是RP,R7模拟最后一跳路由器,R8模拟组播接收者。
完成IP地址和IGP的配置,IGP为全网运行OSPF,均运行在area 0.

配置接口以及IGP(OSPF)

R1:
int f0/0
ip add 1.1.1.1 255.255.255.0
no shut
exit
int l0
ip add 11.1.1.1 255.255.255.0
exit
int f1/0
ip add 17.1.1.1 255.255.255.0
no shut
exit

router ospf 1
router-id 11.1.1.1
network 1.1.1.0 0.0.0.255 area 0
network 11.1.1.0 0.0.0.255 area 0
network 17.1.1.0 0.0.0.255 area 0
exit

R2:
int f0/0
ip add 1.1.1.2 255.255.255.0
no shut
exit
int l0
ip add 22.1.1.1 255.255.255.0
exit
int s2/0
ip add 27.1.1.2 255.255.255.0
no shut
exit
int s2/1
ip add 23.1.1.2 255.255.255.0
no shut
exit

router ospf 1
router-id 22.1.1.1
network 1.1.1.0 0.0.0.255 area 0
network 22.1.1.0 0.0.0.255 area 0
network 23.1.1.0 0.0.0.255 area 0
network 27.1.1.0 0.0.0.255 area 0
exit

R3:
int f0/0
ip add 1.1.1.3 255.255.255.0
no shut
exit
int l0
ip add 33.1.1.1 255.255.255.0
exit
int f0/1
ip add 36.1.1.3 255.255.255.0
no shut
exit
int f1/0
ip add 35.1.1.3 255.255.255.0
no shut
exit
int s2/1
ip add 23.1.1.3 255.255.255.0
no shut
exit

router ospf 1
router-id 33.1.1.1
network 1.1.1.0 0.0.0.255 area 0
network 33.1.1.0 0.0.0.255 area 0
network 35.1.1.0 0.0.0.255 area 0
network 36.1.1.0 0.0.0.255 area 0
network 23.1.1.0 0.0.0.255 area 0
exit

R4:
int f0/0
ip add 1.1.1.4 255.255.255.0
no shut
exit
int l0
ip add 44.1.1.1 255.255.255.0
exit

router ospf 1
router-id 44.1.1.1
network 1.1.1.0 0.0.0.255 area 0
network 44.1.1.0 0.0.0.255 area 0
exit

R5:
int f1/0
ip add 35.1.1.5 255.255.255.0
no shut
exit
int l0
ip add 55.1.1.1 255.255.255.0
exit

router ospf 1
router-id 55.1.1.1
network 35.1.1.0 0.0.0.255 area 0
network 55.1.1.0 0.0.0.255 area 0
exit

R6:
int f0/1
ip add 36.1.1.6 255.255.255.0
no shut
exit
int l0
ip add 66.1.1.1 255.255.255.0
exit

router ospf 1
router-id 66.1.1.1
network 36.1.1.0 0.0.0.255 area 0
network 66.1.1.0 0.0.0.255 area 0
exit

R7:
int f0/0
ip add 78.1.1.7 255.255.255.0
no shut
exit
int f1/0
ip add 17.1.1.7 255.255.255.0
no shut
exit
int s2/0
ip add 27.1.1.7 255.255.255.0
no shut
exit
int l0
ip add 77.1.1.1 255.255.255.0
exit

router ospf 1
router-id 77.1.1.1
network 78.1.1.0 0.0.0.255 area 0
network 17.1.1.0 0.0.0.255 area 0
network 27.1.1.0 0.0.0.255 area 0
network 77.1.1.0 0.0.0.255 area 0
exit

R8:
int f0/0
ip add 78.1.1.8 255.255.255.0
no shut
exit
int l0
ip add 88.1.1.1 255.255.255.0
exit

router ospf 1
router-id 88.1.1.1
network 78.1.1.0 0.0.0.255 area 0
network 88.1.1.0 0.0.0.255 area 0
exit
View Code

配置PIM Sparse-Mode(除组播源及接受者外)

R1:
ip multicast-routing
ip pim rp-address 22.1.1.1
int f0/0
ip pim sparse-mode
exit
int f1/0
ip pim sparse-mode
exit

R2:
ip multicast-routing
ip pim rp-address 22.1.1.1
int l0
ip pim sparse-mode
exit
int f0/0
ip pim sparse-mode
exit
int s2/0
ip pim sparse-mode
exit
int s2/1
ip pim sparse-mode
exit

R3:
ip multicast-routing
ip pim rp-address 22.1.1.1
int f0/0
ip pim sparse-mode
exit
int f0/1
ip pim sparse-mode
exit
int f1/0
ip pim sparse-mode
exit
int s2/1
ip pim sparse-mode
exit

R4:
ip multicast-routing
ip pim rp-address 22.1.1.1
int f0/0
ip pim sparse-mode
exit

R6:
ip multicast-routing
ip pim rp-address 22.1.1.1
int f0/1
ip pim sparse-mode
exit

R7:
ip multicast-routing
ip pim rp-address 22.1.1.1
int f0/0
ip pim sparse-mode
exit
int f1/0
ip pim sparse-mode
exit
int s2/0
ip pim sparse-mode
exit
View Code

-------------------------------------------------
R2:
show ip pim int
show ip pim neighbor
show ip pim rp mapping

R8:
int f0/0
ip igmp join-group 228.1.1.1
exit

R7:
show ip mroute
conf t
ip pim spt-threshold infinity
end
show ip mroute

R1/R2:
show ip mroute

R7:
int s2/0
ip ospf cost 1
exit
show ip route ospf

R2:
int f0/0
ip ospf cost 3
exit
int s2/1
ip ospf cost 2
exit
show ip route ospf

R7:
show ip route ospf

R7/R2:
show ip mroute

R5:
ping 228.1.1.1

R3/R2:
show ip mroute

R7:
ip pim spt-threshold 0
clear ip mroute *

R5:(wait until R2/R7 mroute establish again)
ping 228.1.1.1 reapeat 1

R3/R1/R2/R7:
show ip mroute

R5:
ping 228.1.1.1 reapeat 1

R3/R2/R7:
show ip mroute


4.PIM双向树和SSM
--------------------------------------------------------------------------------------------------------------------

实验目的:
1.掌握PIM双向树的配置方法
2.观察PIM双向树的组播路由表和标识
3.观察PIM双向树的DF选择原则
4.掌握PIM SSM的配置方法
5.观察PIM SSM的组播路由表和标识

实验假设:R5模拟组播源,R3模拟第一跳路由器,R7是RP,R8是最后一跳路由器,同时模拟接受者。

配置接口以及IGP(OSPF)

R1:
int f0/0
ip add 1.1.1.1 255.255.255.0
no shut
exit
int l0
ip add 11.1.1.1 255.255.255.0
exit
int f1/0
ip add 17.1.1.1 255.255.255.0
no shut
exit

router ospf 1
router-id 11.1.1.1
network 1.1.1.0 0.0.0.255 area 0
network 11.1.1.0 0.0.0.255 area 0
network 17.1.1.0 0.0.0.255 area 0
exit

R2:
int f0/0
ip add 1.1.1.2 255.255.255.0
no shut
exit
int l0
ip add 22.1.1.1 255.255.255.0
exit
int s2/0
ip add 27.1.1.2 255.255.255.0
no shut
exit

router ospf 1
router-id 22.1.1.1
network 1.1.1.0 0.0.0.255 area 0
network 22.1.1.0 0.0.0.255 area 0
network 27.1.1.0 0.0.0.255 area 0
exit

R3:
int f0/0
ip add 1.1.1.3 255.255.255.0
no shut
exit
int l0
ip add 33.1.1.1 255.255.255.0
exit
int f1/0
ip add 35.1.1.3 255.255.255.0
no shut
exit

router ospf 1
router-id 33.1.1.1
network 1.1.1.0 0.0.0.255 area 0
network 33.1.1.0 0.0.0.255 area 0
network 35.1.1.0 0.0.0.255 area 0
exit

R5:
int f1/0
ip add 35.1.1.5 255.255.255.0
no shut
exit
int l0
ip add 55.1.1.1 255.255.255.0
exit

router ospf 1
router-id 55.1.1.1
network 35.1.1.0 0.0.0.255 area 0
network 55.1.1.0 0.0.0.255 area 0
exit

R7:
int f0/0
ip add 78.1.1.7 255.255.255.0
no shut
exit
int f1/0
ip add 17.1.1.7 255.255.255.0
no shut
exit
int s2/0
ip add 27.1.1.7 255.255.255.0
no shut
exit
int l0
ip add 77.1.1.1 255.255.255.0
exit

router ospf 1
router-id 77.1.1.1
network 78.1.1.0 0.0.0.255 area 0
network 17.1.1.0 0.0.0.255 area 0
network 27.1.1.0 0.0.0.255 area 0
network 77.1.1.0 0.0.0.255 area 0
exit

R8:
int f0/0
ip add 78.1.1.8 255.255.255.0
no shut
exit
int l0
ip add 88.1.1.1 255.255.255.0
exit

router ospf 1
router-id 88.1.1.1
network 78.1.1.0 0.0.0.255 area 0
network 88.1.1.0 0.0.0.255 area 0
exit
View Code

配置PIM Sparse-Mode(除组播源及接受者外)

R1:
ip multicast-routing
ip pim bidir-enable
ip pim rp-address 77.1.1.1 bidir
int f0/0
ip pim sparse-mode
exit
int f1/0
ip pim sparse-mode
exit

R2:
ip multicast-routing
ip pim bidir-enable
ip pim rp-address 77.1.1.1 bidir
int f0/0
ip pim sparse-mode
exit
int s2/0
ip pim sparse-mode
exit

R3:
ip multicast-routing
ip pim bidir-enable
ip pim rp-address 77.1.1.1 bidir
int f0/0
ip pim sparse-mode
exit
int f1/0
ip pim sparse-mode
exit

R7:
ip multicast-routing
ip pim bidir-enable
ip pim rp-address 77.1.1.1 bidir
int f0/0
ip pim sparse-mode
exit
int f1/0
ip pim sparse-mode
exit
int s2/0
ip pim sparse-mode
exit
int l0
ip pim sparse-mode
exit

R8:
ip multicast-routing
ip pim bidir-enable
ip pim rp-address 77.1.1.1 bidir
int f0/0
ip pim sparse-mode
exit
int l0
ip pim sparse-mode
exit
View Code

-------------------------------------------------
R2:
show ip pim int
show ip pim neighbor
show ip pim rp mapping

R8:
int l0
ip igmp join-group 228.1.1.1
exit

show ip mroute

R7:
show ip mroute

R5:
ping 228.1.1.1

R3/R1/R7:
show ip mroute

R2:
int s2/0
ip ospf cost 1
exit

debug ip pim df

R5:
ping 228.1.1.1

R3/R1/R7:
show ip mroute

R8:
no ip pim bidir-enable
int f0/0
no ip pim sparse-mode
exit
int l0
no ip pim sparse-mode
no ip igmp join-group 228.1.1.1
exit

SSM配置
--------------------------------------------
R7:
int f0/0
ip igmp version 3
ip pim sparse-mode
exit
ip pim ssm default

R1/R2/R3:
conf t
ip pim ssm default

R8:
int f0/0
ip igmp version 3
ip igmp join-group 232.1.1.1 source 35.1.1.5
exit

R5:
ping 232.1.1.1


5.动态RP之auto-rp
-------------------------------------------------------------------------------------------

配置接口以及IGP(OSPF)

R1:
int f0/0
ip add 1.1.1.1 255.255.255.0
no shut
exit
int l0
ip add 11.1.1.1 255.255.255.0
exit
int f1/0
ip add 17.1.1.1 255.255.255.0
no shut
exit

router ospf 1
router-id 11.1.1.1
network 1.1.1.0 0.0.0.255 area 0
network 11.1.1.0 0.0.0.255 area 0
network 17.1.1.0 0.0.0.255 area 0
exit

R2:
int f0/0
ip add 1.1.1.2 255.255.255.0
no shut
exit
int l0
ip add 22.1.1.1 255.255.255.0
exit
int s2/0
ip add 27.1.1.2 255.255.255.0
no shut
exit

router ospf 1
router-id 22.1.1.1
network 1.1.1.0 0.0.0.255 area 0
network 22.1.1.0 0.0.0.255 area 0
network 27.1.1.0 0.0.0.255 area 0
exit

R3:
int f0/0
ip add 1.1.1.3 255.255.255.0
no shut
exit
int l0
ip add 33.1.1.1 255.255.255.0
exit
int f1/0
ip add 35.1.1.3 255.255.255.0
no shut
exit

router ospf 1
router-id 33.1.1.1
network 1.1.1.0 0.0.0.255 area 0
network 33.1.1.0 0.0.0.255 area 0
network 35.1.1.0 0.0.0.255 area 0
exit

R4:
int f0/0
ip add 1.1.1.4 255.255.255.0
no shut
exit
int l0
ip add 44.1.1.1 255.255.255.0
exit

router ospf 1
router-id 44.1.1.1
network 1.1.1.0 0.0.0.255 area 0
network 44.1.1.0 0.0.0.255 area 0
exit

R5:
int f1/0
ip add 35.1.1.5 255.255.255.0
no shut
exit
int l0
ip add 55.1.1.1 255.255.255.0
exit

router ospf 1
router-id 55.1.1.1
network 35.1.1.0 0.0.0.255 area 0
network 55.1.1.0 0.0.0.255 area 0
exit

R7:
int f0/0
ip add 78.1.1.7 255.255.255.0
no shut
exit
int f1/0
ip add 17.1.1.7 255.255.255.0
no shut
exit
int s2/0
ip add 27.1.1.7 255.255.255.0
no shut
exit
int l0
ip add 77.1.1.1 255.255.255.0
exit

router ospf 1
router-id 77.1.1.1
network 78.1.1.0 0.0.0.255 area 0
network 17.1.1.0 0.0.0.255 area 0
network 27.1.1.0 0.0.0.255 area 0
network 77.1.1.0 0.0.0.255 area 0
exit

R8:
int f0/0
ip add 78.1.1.8 255.255.255.0
no shut
exit
int l0
ip add 88.1.1.1 255.255.255.0
exit

router ospf 1
router-id 88.1.1.1
network 78.1.1.0 0.0.0.255 area 0
network 88.1.1.0 0.0.0.255 area 0
exit
View Code

配置PIM Sparse-Mode(除组播源及接受者外)

R1:
ip multicast-routing
int l0
ip pim sparse-mode
exit
int f0/0
ip pim sparse-mode
exit
int f1/0
ip pim sparse-mode
exit

R2:
ip multicast-routing
int l0
ip pim sparse-mode
exit
int f0/0
ip pim sparse-mode
exit
int s2/0
ip pim sparse-mode
exit

R3:
ip multicast-routing
int l0
ip pim sparse-mode
exit
int f0/0
ip pim sparse-mode
exit
int f1/0
ip pim sparse-mode
exit

R4:
ip multicast-routing
int l0
ip pim sparse-mode
exit
int f0/0
ip pim sparse-mode
exit

R7:
ip multicast-routing
int l0
ip pim sparse-mode
exit
int f0/0
ip pim sparse-mode
exit
int f1/0
ip pim sparse-mode
exit
int s2/0
ip pim sparse-mode
exit
View Code

配置Auto RP
-------------------------------------------------
R2:
show ip pim int
show ip pim neighbor

R2:
ip pim autorp listener
ip pim send-rp-announce 1oopback 0 scope 10 group-list 10
ip access-list 10 permit 224.100.100.100
exit

R3:
ip pim autorp listener
ip pim send-rp-announce 1oopback 0 scope 10 group-list 10
ip access-list 10 permit 224.100.100.100
exit

R1:
ip pim send-rp-discovery loopback 0 scope 10

当使用auto-rp在pim sparse-mode网络中,这个命令需要配置在所有候选路由器上。原因是因为auto-rp的两个组播地址224.0.1.39和224.0.1.40只可以在dense-mode下传输,因为所有端口都配置的是sparse,所以auto-rp的信息会被丢掉。而这个命令就是使得dense-mode的auto-rp traffic可以通过sparse-mode的端口。

设置了send-rp-announce的路由器充当rp,发送224.0.1.39的组播包告诉rp-map的路由器“我是rp”
设置了send-rp-discovery的路由器充当rp-map,发送224.0.1.40的组播包告诉网络中的其他路由器“选谁做rp”。

R7:
show ip pim rp mapping

R8:
int f0/0
ip igmp join-group 224.100.100.100
exit

R5:
ping 224.100.100.100


6.动态RP之BSR
--------------------------------------------------------------------------------------------------

------------------------------------------------------------
R2/R3:
no ip pim autorp listener
no ip pim send-rp-announce 1oopback 0
no ip access-list standard 10

R1:
no ip pim send-rp-discovery

配置BSR
------------------------------------------------------------

所有候选BSR通过bootstrap报文来选举BSR,优先级最高的BSR最后会通知在组播网中所有路由器它是BSR。这时候RP的候选会发送c-rp-adv报文到获胜的BSR,报文包括了这个RP的优先级和它对应的组播地址段。BSR将这些信息放入rp-set,然后放在boorstrap报文中发送给组播网中所有的路有器。
在整个过程中,所有的报文都是unicast发送的。


R2:
show ip pim int
show ip pim neighbor

R1:
ip pim bsr-candidate loopback 0 4 10

R3:
ip pim bsr-candidate loopback 0 5 5

R7/R3:
show ip pim bsr-router

R2:
ip pim rp-candidate loopback 0 group-list 1
access-list 1 permit 224.100.100.100

R7:
ip pim rp-candidate loopback 0 group-list 1 priority 100
access-list 1 permit 224.100.100.100

R8:
int f0/0
ip igmp join-group 224.100.100.100

R3:
show ip pim rp mapping
show ip pim rp

R5:
ping 224.100.100.100

Hash配置
--------------------------------------
R1/R3:
ip pim bsr-candidate loopback 0 30

R2/R7:
ip pim rp-candidate loopback 0

R8:
int f0/0
ip igmp join-group 224.100.100.100
ip igmp join-group 224.100.100.1
ip igmp join-group 224.100.100.2
ip igmp join-group 224.100.100.3
ip igmp join-group 224.100.100.4
ip igmp join-group 224.100.100.5
ip igmp join-group 224.100.100.6
ip igmp join-group 224.100.100.7
ip igmp join-group 224.100.100.8
ip igmp join-group 224.100.100.9
ip igmp join-group 224.100.100.10
ip igmp join-group 224.100.100.11
ip igmp join-group 224.100.100.12
ip igmp join-group 224.100.100.13
ip igmp join-group 224.100.100.14
ip igmp join-group 224.100.100.15
ip igmp join-group 224.100.100.16
ip igmp join-group 224.100.100.17
ip igmp join-group 224.100.100.18
ip igmp join-group 224.100.100.19
ip igmp join-group 224.100.100.20
ip igmp join-group 224.100.100.21
ip igmp join-group 224.100.100.22
ip igmp join-group 224.100.100.23
ip igmp join-group 224.100.100.24
ip igmp join-group 224.100.100.25
ip igmp join-group 224.100.100.26
ip igmp join-group 224.100.100.27
ip igmp join-group 224.100.100.28
ip igmp join-group 224.100.100.29
ip igmp join-group 224.100.100.30
ip igmp join-group 224.100.100.31
ip igmp join-group 224.100.100.32
ip igmp join-group 224.100.100.33
exit

R1:
show ip pim rp


7.Anycast RP
----------------------------------------------------------------------------------------------------

配置接口以及IGP(OSPF)

R1:
int f0/0
ip add 1.1.1.1 255.255.255.0
no shut
exit
int l0
ip add 11.1.1.1 255.255.255.0
exit
int f1/0
ip add 17.1.1.1 255.255.255.0
no shut
exit

router ospf 1
router-id 11.1.1.1
network 1.1.1.0 0.0.0.255 area 0
network 11.1.1.0 0.0.0.255 area 0
network 17.1.1.0 0.0.0.255 area 0
exit

R2:
int f0/0
ip add 1.1.1.2 255.255.255.0
no shut
exit
int l0
ip add 22.1.1.1 255.255.255.0
exit
int s2/0
ip add 27.1.1.2 255.255.255.0
no shut
exit

router ospf 1
router-id 22.1.1.1
network 1.1.1.0 0.0.0.255 area 0
network 22.1.1.0 0.0.0.255 area 0
network 27.1.1.0 0.0.0.255 area 0
exit

R3:
int f0/0
ip add 1.1.1.3 255.255.255.0
no shut
exit
int l0
ip add 33.1.1.1 255.255.255.0
exit
int f1/0
ip add 35.1.1.3 255.255.255.0
no shut
exit

router ospf 1
router-id 33.1.1.1
network 1.1.1.0 0.0.0.255 area 0
network 33.1.1.0 0.0.0.255 area 0
network 35.1.1.0 0.0.0.255 area 0
exit

R4:
int f0/0
ip add 1.1.1.4 255.255.255.0
no shut
exit
int l0
ip add 44.1.1.1 255.255.255.0
exit

router ospf 1
router-id 44.1.1.1
network 1.1.1.0 0.0.0.255 area 0
network 44.1.1.0 0.0.0.255 area 0
exit

R5:
int f1/0
ip add 35.1.1.5 255.255.255.0
no shut
exit
int l0
ip add 55.1.1.1 255.255.255.0
exit

router ospf 1
router-id 55.1.1.1
network 35.1.1.0 0.0.0.255 area 0
network 55.1.1.0 0.0.0.255 area 0
exit

R7:
int f0/0
ip add 78.1.1.7 255.255.255.0
no shut
exit
int f1/0
ip add 17.1.1.7 255.255.255.0
no shut
exit
int s2/0
ip add 27.1.1.7 255.255.255.0
no shut
exit
int l0
ip add 77.1.1.1 255.255.255.0
exit

R8:
int f0/0
ip add 78.1.1.8 255.255.255.0
no shut
exit
int l0
ip add 88.1.1.1 255.255.255.0
exit

router ospf 1
router-id 88.1.1.1
network 78.1.1.0 0.0.0.255 area 0
network 88.1.1.0 0.0.0.255 area 0
exit
View Code

配置PIM Sparse-Mode(除组播源及接受者外)

R1:
ip multicast-routing
int l0
ip pim sparse-mode
exit
int f0/0
ip pim sparse-mode
exit
int f1/0
ip pim sparse-mode
exit

R2:
ip multicast-routing
int l0
ip pim sparse-mode
exit
int f0/0
ip pim sparse-mode
exit
int s2/0
ip pim sparse-mode
exit

R3:
ip multicast-routing
int l0
ip pim sparse-mode
exit
int f0/0
ip pim sparse-mode
exit
int f1/0
ip pim sparse-mode
exit

R4:
ip multicast-routing
int l0
ip pim sparse-mode
exit
int f0/0
ip pim sparse-mode
exit

R7:
ip multicast-routing
int l0
ip pim sparse-mode
exit
int f0/0
ip pim sparse-mode
exit
int f1/0
ip pim sparse-mode
exit
int s2/0
ip pim sparse-mode
exit
View Code

配置Anycast RP
-------------------------------------------------
R2:
show ip pim int
show ip pim neighbor

R3/R7:
int l1
ip add 3.3.3.3 255.255.255.255
exit
router ospf 1
network 3.3.3.3 0.0.0.0 area 0
exit

int l1
ip pim sparse-mode
exit

R2:
ip pim bsr-candidate l0

R3/R7:
ip pim rp-candidate l1

R3:
ip msdp peer 77.1.1.1 connect-source l0

R7:
ip msdp peer 33.1.1.1 connect-source l0

show ip msdp summary

R8:
int f0/0
ip igmp join-group 224.100.100.100
exit

R5:
ping 224.100.100.100 repeat 5

R3/R7:
show ip mroute


8.域间组播
-----------------------------------------------------------------------------------------------------

配置接口以及IGP(OSPF)

R4:
int l0
ip add 44.1.1.1 255.255.255.0
exit
int f1/0
ip add 46.1.1.4 255.255.255.0
no shut
exit
int f0/0
ip add 14.1.1.4 255.255.255.0
no shut
exit

router ospf 1
router-id 44.1.1.1
network 44.1.1.0 0.0.0.255 area 0
network 46.1.1.0 0.0.0.255 area 0
exit

R6:
int l0
ip add 66.1.1.1 255.255.255.0
exit
int f1/0
ip add 46.1.1.6 255.255.255.0
no shut
exit
int f0/1
ip add 36.1.1.6 255.255.255.0
no shut
exit

router ospf 1
router-id 66.1.1.1
network 66.1.1.0 0.0.0.255 area 0
network 46.1.1.0 0.0.0.255 area 0
network 36.1.1.0 0.0.0.255 area 0
exit

R3:
int l0
ip add 33.1.1.1 255.255.255.0
exit
int f0/1
ip add 36.1.1.3 255.255.255.0
no shut
exit

router ospf 1
router-id 33.1.1.1
network 33.1.1.0 0.0.0.255 area 0
network 36.1.1.0 0.0.0.255 area 0
exit
View Code

配置接口以及IGP(OSPF)

R1:
int l0
ip add 11.1.1.1 255.255.255.0
exit
int f1/0
ip add 17.1.1.1 255.255.255.0
no shut
exit
int f0/1
ip add 18.1.1.1 255.255.255.0
no shut
exit
int f0/0
ip add 14.1.1.1 255.255.255.0
no shut
exit

router ospf 1
router-id 11.1.1.1
network 11.1.1.0 0.0.0.255 area 0
network 17.1.1.0 0.0.0.255 area 0
network 18.1.1.0 0.0.0.255 area 0
exit

R8:
int l0
ip add 88.1.1.1 255.255.255.0
exit
int f0/1
ip add 18.1.1.8 255.255.255.0
no shut
exit

router ospf 1
router-id 88.1.1.1
network 88.1.1.0 0.0.0.255 area 0
network 18.1.1.0 0.0.0.255 area 0
exit

R7:
int l0
ip add 77.1.1.1 255.255.255.0
exit
int f1/0
ip add 17.1.1.7 255.255.255.0
no shut
exit
int s2/0
ip add 27.1.1.7 255.255.255.0
no shut
exit

router ospf 1
router-id 77.1.1.1
network 77.1.1.0 0.0.0.255 area 0
network 17.1.1.0 0.0.0.255 area 0
network 27.1.1.0 0.0.0.255 area 0
exit

R2:
int l0
ip add 22.1.1.1 255.255.255.0
exit
int s2/0
ip add 27.1.1.2 255.255.255.0
no shut
exit

router ospf 1
router-id 22.1.1.1
network 22.1.1.0 0.0.0.255 area 0
network 27.1.1.0 0.0.0.255 area 0
exit
View Code

配置AS 200 Pim Sparse-Mode

R4:
ip multicast-routing
int f1/0
ip pim sparse-mode
exit
int l0
ip pim sparse-mode
exit

R6:
ip multicast-routing
int f1/0
ip pim sparse-dense-mode
exit
int f0/1
ip pim sparse-dense-mode
exit
int l0
ip pim sparse-dense-mode
exit

ip pim send-rp-announce l0 scope 2
ip pim send-rp-discovery l0 scope 2

R3:
ip multicast-routing
int f0/1
ip pim sparse-mode
exit
int l0
ip pim sparse-mode
exit
View Code

R4:

show ip pim rp mapping

R3:
int f0/1
ip igmp join-group 228.1.1.1
exit

R6:
show ip mroute

配置AS 100 Pim Sparse-Mode

R1:
ip multicast-routing
int l0
ip pim sparse-mode
exit
int f0/1
ip pim sparse-mode
exit
int f1/0
ip pim sparse-mode
exit

R8:
ip multicast-routing
int l0
ip pim sparse-mode
exit
int f0/1
ip pim sparse-mode
exit

R7:
ip multicast-routing
int l0
ip pim sparse-mode
exit
int s2/0
ip pim sparse-mode
exit
int f1/0
ip pim sparse-mode
exit

ip pim bsr-candidate l0
ip pim rp-candidate l0

R2:
ip multicast-routing
int l0
ip pim sparse-mode
exit
int s2/0
ip pim sparse-mode
exit
View Code

R1:
show ip pim rp mapping

R2:
int s2/0
ip igmp join-group 228.1.1.1
exit

R7:
show ip mroute

MSDP Peer的配置
----------------------------------------------
R4:
router bgp 200
bgp router-id 44.1.1.1
neighbor 14.1.1.1 remote-as 100
neighbor 66.1.1.1 remote-as 200
neighbor 66.1.1.1 update-source l0
neighbor 66.1.1.1 next-hop-self
exit

R6:
router bgp 200
bgp router-id 66.1.1.1
neighbor 44.1.1.1 remote-as 200
neighbor 44.1.1.1 update-source l0
neighbor 33.1.1.1 remote-as 200
neighbor 33.1.1.1 update-source l0
neighbor 33.1.1.1 route-reflector-client
network 66.1.1.0 mask 255.255.255.0
exit

R3:
router bgp 200
bgp router-id 33.1.1.1
neighbor 66.1.1.1 remote-as 200
neighbor 66.1.1.1 update-source l0
exit


R1:
router bgp 100
bgp router-id 11.1.1.1
neighbor 14.1.1.4 remote-as 200
neighbor 77.1.1.1 remote-as 100
neighbor 77.1.1.1 update-source l0
neighbor 77.1.1.1 next-hop-self
exit

R7:
router bgp 100
bgp router-id 77.1.1.1
neighbor 11.1.1.1 remote-as 100
neighbor 11.1.1.1 update-source l0
network 77.1.1.0 mask 255.255.255.0
exit

R6:
ip msdp peer 77.1.1.1 connect-source l0

R7:
ip msdp peer 66.1.1.1 connect-source l0

R6/R7:
show ip msdp peer
show tcp brief

R3:
debug ip icmp

R8:
ping 228.1.1.1 repeat 3

R1:
int f0/0
ip pim sparse-mode
ip pim bsr-border
exit

R4:
int f0/0
ip pim sparse-mode
ip pim bsr-border
exit

R1:
router bgp 100
network 18.1.1.0 mask 255.255.255.0
exit

R6:
show ip route bgp
show ip msdp sa-cache
show ip mroute

R4:
show ip mroute


---------------------------------------------------------------------------------------
R1:
router bgp 100
no network 18.1.1.0 mask 255.255.255.0
address-family ipv4 multicast
neighbor 14.1.1.4 activate
network 18.1.1.0 mask 255.255.255.0
exit
exit

R4:
router bgp 200
address-family ipv4 multicast
neighbor 14.1.1.1 activate
neighbor 66.1.1.1 activate
exit
exit

R6:
router bgp 200
address-family ipv4 multicast
neighbor 44.1.1.1 activate
exit
exit

show ip bgp ipv4 multicast

R3:
debug ip icmp

R8:
ping 228.1.1.1 repeat 3

R1:
int f0/0
no ip pim sparse-mode
exit

int tunnel 0
ip add 41.1.1.1 255.255.255.0
tunnel source f0/0
tunnel destination 14.1.1.4
ip pim sparse-mode
ip pim bsr-border
exit

R4:
int f0/0
no ip pim sparse-mode
exit

int tunnel 0
ip add 41.1.1.4 255.255.255.0
tunnel source f0/0
tunnel destination 14.1.1.1
ip pim sparse-mode
ip pim bsr-border
exit

ip mroute 18.1.1.0 255.255.255.0 tunnel 0

R4:
show ip mroute


9.IPv6组播
-----------------------------------------------------------------------

posted on 2013-07-02 07:44  逝者如斯(乎)  阅读(4684)  评论(0编辑  收藏  举报