环境:三台路由器串口相连,其它的配置如图所示
要求:1. R1,R2,R3配置ospf 并把所有接口加入到area 0
2.配置R1为rp,配置R2为映射代理,把R3加入239.3.3.3组
3.练习本课所有show命令
步骤一:在每个路由器上配置1个loopback 口,并 配置三台路由器接口使其连通。
R1的配置
R1(config)# interface Loopback0
R1(config-if)# ip address 30.1.1.1 255.255.255.0
R1(config)# interface Serial0
R1(config-if)# ip address
10.1.1
.1 255.255.255.0
R1(config-if)# clockrate 64000
R1(config-if)#no shutdown
R2的配置
R2(config)#interface Loopback0
R2(config-if)# ip address 40.1.1.1 255.255.255.0
R2(config)#interface Serial0
R2(config-if)# ip address
20.1.1
.1 255.255.255.0
R2(config-if)#clockrate 64000
R2(config-if)#no shutdown
R2(config)#interface Serial1
R2(config-if)# ip address
10.1.1
.2 255.255.255.0
R2(config-if)#no shutdown
R3的配置
R3(config)#interface Loopback0
R3(config-if)# ip address 50.1.1.1 255.255.255.0
R3(config)#interface Serial1
R3(config-if)# ip address
20.1.1
.2 255.255.255.0
R3(config-if)#no shutdown
步骤二:配置ospf路由协议,使其连通
R1的配置
R1(config)#router ospf 1
R1(config-router)# network
10.1.1
.0 0.0.0.255 area 0
R1(config-router)# network 30.1.1.0
0.0.0
.255 area 0
R2的配置
R2(config)#router ospf 1
R2(config-router)#network
10.1.1
.0 0.0.0.255 area 0
R2(config-router)# network
20.1.1
.0 0.0.0.255 area 0
R2(config-router)# network 40.1.1.0
0.0.0
.255 area 0
R3的配置
R3(config)#router ospf 1
R3(config-router)# network
20.1.1
.0 0.0.0.255 area 0
R3(config-router)# network 50.1.1.0
0.0.0
.255 area 0
步骤三:配置R1为rp,配置R2为映射代理,把R3加入239.3.3.3组
R1的配置
R1(config)#ip multicast-routing à启用多播协议
R1(config)# interface Loopback0
R1(config-if)# ip pim sparse-mode à接口PIM模式为稀疏
R1(config)# interface Serial0
R1(config-if)# ip pim sparse-mode
R1(config)# ip pim send-rp-announce Loopback0 scope 5 à指定R1为RP
R2的配置
R2(config)#ip multicast-routing
R2(config)# interface Loopback0
R2(config-if)# ip pim sparse-mode
R2(config)# interface Serial0
R2(config-if)# ip pim sparse-mode
R2(config)# interface Serial1
R2(config-if)# ip pim sparse-mode
R2(config)# ip pim send-rp-discovery Loopback0 scope 5 à将R2指定为映射代理
R3的配置
R3(config)#ip multicast-routing
R3(config)# interface Loopback0
R3(config-if)# ip pim sparse-mode
R3(config-if)# ip igmp join-group 239.3.3.3 à将此接口加入到组239.3.3.3
R3(config)# interface Serial1
R3(config-if)# ip pim sparse-mode
步骤四:查看组播路由表
R1#sh ip mroute 239.3.3.3
IP Multicast Routing Table
Flags: D - Dense, S - Sparse, B - Bidir Group, s - SSM Group, C - Connected,
L - Local, P - Pruned, R - RP-bit set, F - Register flag,
T - SPT-bit set, J - Join SPT, M - MSDP created entry,
X - Proxy Join Timer Running, A - Candidate for MSDP Advertisement,
U - URD, I - Received Source Specific Host Report, Z - Multicast Tunnel
Y - Joined MDT-data group, y - Sending to MDT-data group
Outgoing interface flags: H - Hardware switched
Timers: Uptime/Expires
Interface state: Interface, Next-Hop or VCD, State/Mode
(*, 239.3.3.3), 00:37:56/stopped, RP 30.1.1.1, flags: S
Incoming interface: Null, RPF nbr
0.0.0
.0
Outgoing interface list:
Serial0, Forward/Sparse, 00:37:56/00:03:07
(
10.1.1
.1, 239.3.3.3), 00:00:04/00:02:56, flags: P à学来对端的基于源的多播路由
Incoming interface: Serial0, RPF nbr
0.0.0
.0
Outgoing interface list: Null
(30.1.1.1, 239.3.3.3), 00:00:04/00:03:28, flags: T
Incoming interface: Loopback0, RPF nbr
0.0.0
.0
Outgoing interface list:
Serial0, Forward/Sparse, 00:00:05/00:03:24
(50.1.1.1, 239.3.3.3), 00:00:12/00:03:17, flags: PX
Incoming interface: Serial0, RPF nbr
10.1.1
.2
Outgoing interface list: Null
R2#sh ip mroute 239.3.3.3
IP Multicast Routing Table
Flags: D - Dense, S - Sparse, B - Bidir Group, s - SSM Group, C - Connected,
L - Local, P - Pruned, R - RP-bit set, F - Register flag,
T - SPT-bit set, J - Join SPT, M - MSDP created entry,
X - Proxy Join Timer Running, A - Candidate for MSDP Advertisement,
U - URD, I - Received Source Specific Host Report, Z - Multicast Tunnel
Y - Joined MDT-data group, y - Sending to MDT-data group
Outgoing interface flags: H - Hardware switched
Timers: Uptime/Expires
Interface state: Interface, Next-Hop or VCD, State/Mode
(*, 239.3.3.3), 00:43:06/stopped, RP 30.1.1.1, flags: SF
Incoming interface: Serial1, RPF nbr
10.1.1
.1
Outgoing interface list:
Serial0, Forward/Sparse, 00:42:48/00:03:02
(
20.1.1
.1, 239.3.3.3), 00:00:22/00:03:07, flags: T
Incoming interface: Serial0, RPF nbr
0.0.0
.0, Registering
Outgoing interface list:
Serial1, Forward/Sparse, 00:00:22/00:03:07
(40.1.1.1, 239.3.3.3), 00:00:23/00:03:08, flags: FT
Incoming interface: Loopback0, RPF nbr
0.0.0
.0, Registering
Outgoing interface list:
Serial0, Forward/Sparse, 00:00:24/00:03:06
(50.1.1.1, 239.3.3.3), 00:01:39/00:01:53, flags:
Incoming interface: Serial0, RPF nbr
20.1.1
.2
Outgoing interface list:
Serial1, Forward/Sparse, 00:01:39/00:01:53
R3#sh ip mroute 239.3.3.3
IP Multicast Routing Table
Flags: D - Dense, S - Sparse, B - Bidir Group, s - SSM Group, C - Connected,
L - Local, P - Pruned, R - RP-bit set, F - Register flag,
T - SPT-bit set, J - Join SPT, M - MSDP created entry,
X - Proxy Join Timer Running, A - Candidate for MSDP Advertisement,
U - URD, I - Received Source Specific Host Report, Z - Multicast Tunnel
Y - Joined MDT-data group, y - Sending to MDT-data group
Outgoing interface flags: H - Hardware switched
Timers: Uptime/Expires
Interface state: Interface, Next-Hop or VCD, State/Mode
(*, 239.3.3.3), 00:46:06/stopped, RP 30.1.1.1, flags: SJCLF
Incoming interface: Serial1, RPF nbr
20.1.1
.1
Outgoing interface list:
Loopback0, Forward/Sparse, 00:46:06/00:02:27
(50.1.1.1, 239.3.3.3), 00:03:54/00:03:06, flags: LFT
Incoming interface: Loopback0, RPF nbr
0.0.0
.0, Registering
Outgoing interface list:
Serial1, Forward/Sparse, 00:00:32/00:02:58
步骤五:查看接口组播信息
R1#sh ip pim int s0
Address Interface Ver/
Nbr
Query
DR
DR
Mode Count Intvl Prior
R1#sh ip pim int lo 0
Address Interface Ver/
Nbr
Query
DR
DR
Mode Count Intvl Prior
30.1.1.1 Loopback0 v2/S 0 30 1 30.1.1.1
R2#sh ip pim int s0
Address Interface Ver/
Nbr
Query
DR
DR
Mode Count Intvl Prior
R2#sh ip pim int s1
Address Interface Ver/
Nbr
Query
DR
DR
Mode Count Intvl Prior
R2#sh ip pim int lo 0
Address Interface Ver/
Nbr
Query
DR
DR
Mode Count Intvl Prior
40.1.1.1 Loopback0 v2/S 0 30 1 40.1.1.1
R3#sh ip pim int s1
Address Interface Ver/
Nbr
Query
DR
DR
Mode Count Intvl Prior
R3#sh ip pim int lo 0
Address Interface Ver/
Nbr
Query
DR
DR
Mode Count Intvl Prior
50.1.1.1 Loopback0 v2/S 0 30 1 50.1.1.1
步骤六:查看组播邻居
R1#sh ip pim neighbor
PIM Neighbor Table
Neighbor Interface Uptime/Expires
Ver
DR
Address Prio/Mode
R2#sh ip pim nei
PIM Neighbor Table
Neighbor Interface Uptime/Expires
Ver
DR
Address Prio/Mode
R3#sh ip pim neighbor
PIM Neighbor Table
Neighbor Interface Uptime/Expires
Ver
DR
Address Prio/Mode
步骤七:查看rp映射表
R1#sh ip pim rp mapping
PIM Group-to-RP Mappings
This system is an RP (Auto-RP)
Group(s) 224.0.0.0/4
RP 30.1.1.1 (?), v2v1
Info source: 40.1.1.1 (?), elected via Auto-RP
Uptime: 00:43:36, expires: 00:02:59
R2#sh ip pim rp mapping
PIM Group-to-RP Mappings
This system is an RP-mapping agent (Loopback0)
Group(s) 224.0.0.0/4
RP 30.1.1.1 (?), v2v1
Info source: 30.1.1.1 (?), elected via Auto-RP
Uptime: 00:48:13, expires: 00:02:44
R3#sh ip pim rp mapping
PIM Group-to-RP Mappings
Group(s) 224.0.0.0/4
RP 30.1.1.1 (?), v2v1
Info source: 40.1.1.1 (?), elected via Auto-RP
Uptime: 00:50:26, expires: 00:02:03
步骤八: ping 组播地址测试
R1#ping 239.3.3.3
Type escape sequence to abort.
Sending 1, 100-byte ICMP Echos to 239.3.3.3, timeout is 2 seconds:
Reply to request 0 from
20.1.1
.2, 80 ms à此显示为已通
Reply to request 0 from
20.1.1
.2, 112 ms
R2#ping 239.3.3.3
Type escape sequence to abort.
Sending 1, 100-byte ICMP Echos to 239.3.3.3, timeout is 2 seconds:
Reply to request 0 from
20.1.1
.2, 56 ms
Reply to request 0 from
20.1.1
.2, 136 ms
Reply to request 0 from
20.1.1
.2, 80 ms
R3#ping 239.3.3.3
Type escape sequence to abort.
Sending 1, 100-byte ICMP Echos to 239.3.3.3, timeout is 2 seconds:
Reply to request 0 from 50.1.1.1, 8 ms
本文转自hexianguo 51CTO博客,原文链接:
http://blog.51cto.com/xghe110/88948
,如需转载请自行联系原作者