环境:三台路由器串口相连,其它的配置如图所示<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

要求: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 <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />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

 

 

步骤三: 配置R1rp,配置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 à指定R1RP

 

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 run

hostname R1

!

ip multicast-routing

!

interface Loopback0

 ip address 30.1.1.1 255.255.255.0

 ip pim sparse-mode

!

interface Serial0

 ip address 10.1.1.1 255.255.255.0

 ip pim sparse-mode

 clockrate 64000

!

router ospf 1

network 10.1.1.0 0.0.0.255 area 0

 network 30.1.1.0 0.0.0.255 area 0

!

ip pim send-rp-announce Loopback0 scope 5

end

 

R2#sh run

hostname R2

!

ip multicast-routing

!

interface Loopback0

 ip address 40.1.1.1 255.255.255.0

 ip pim sparse-mode

!

interface Serial0

 ip address 20.1.1.1 255.255.255.0

 ip pim sparse-mode

 clockrate 64000

!

interface Serial1

 ip address 10.1.1.2 255.255.255.0

 ip pim sparse-mode

!

router ospf 1

 network 10.1.1.0 0.0.0.255 area 0

 network 20.1.1.0 0.0.0.255 area 0

 network 40.1.1.0 0.0.0.255 area 0

!

ip pim send-rp-discovery Loopback0 scope 5

!

end

 

 

R3#sh run

hostname R3

!

ip multicast-routing

!

interface Loopback0

 ip address 50.1.1.1 255.255.255.0

 ip pim sparse-mode

 ip igmp join-group 239.3.3.3

!

interface Serial1

 ip address 20.1.1.2 255.255.255.0

 ip pim sparse-mode

!

router ospf 1

 network 20.1.1.0 0.0.0.255 area 0

 network 50.1.1.0 0.0.0.255 area 0

!

end