看图

我们下完成初始配置,我们用r1模拟多播源,r5模拟pc

source配置:nterface Serial0/0

 ip address 192.168.1.1 255.255.255.0

 serial restart-delay 0

 clock rate 64000

!

interface Serial0/1

 no ip address

 shutdown

 serial restart-delay 0

!

interface Serial0/2

 no ip address

 shutdown

 serial restart-delay 0

!

interface Serial0/3

 no ip address

 shutdown

 serial restart-delay 0

!

ip http server

ip route 0.0.0.0 0.0.0.0 192.168.1.

r2配置;interface Serial0/0

 ip address 192.168.1.2 255.255.255.0

 serial restart-delay 0

!

interface Serial0/1

 ip address 192.168.2.2 255.255.255.0

 serial restart-delay 0

!

interface Serial0/2

 no ip address

 shutdown

 serial restart-delay 0

!

interface Serial0/3

 no ip address

 shutdown

 serial restart-delay 0

!

router eigrp 100

 network 2.2.2.0 0.0.0.255

 network 192.168.1.0

 network 192.168.2.0

 auto-summary

r3配置;!

interface Loopback0

 ip address 3.3.3.3 255.255.255.0

!

interface Serial0/0

 ip address 192.168.3.3 255.255.255.0

 serial restart-delay 0

!

interface Serial0/1

 ip address 192.168.2.3 255.255.255.0

 serial restart-delay 0

!

interface Serial0/2

 no ip address

 shutdown

 serial restart-delay 0

!

interface Serial0/3

 no ip address

 shutdown

 serial restart-delay 0

!

router eigrp 100

 network 3.3.3.0 0.0.0.255

 network 192.168.2.0

 network 192.168.3.0

 auto-summary

r4配置:interface Serial0/0

 ip address 192.168.3.4 255.255.255.0

 serial restart-delay 0

!

interface Serial0/1

 ip address 192.168.4.4 255.255.255.0

 serial restart-delay 0

!

interface Serial0/2

 no ip address

 shutdown

 serial restart-delay 0

!

interface Serial0/3

 no ip address

 shutdown

 serial restart-delay 0

!

router eigrp 100

 network 4.4.4.0 0.0.0.255

 network 192.168.3.0

 network 192.168.4.0

 auto-summary

r5;interface Serial0/1

 ip address 192.168.4.5 255.255.255.0

 serial restart-delay 0

!

interface Serial0/2

 no ip address

 shutdown

 serial restart-delay 0

!

interface Serial0/3

 no ip address

 shutdown

 serial restart-delay 0

!

ip http server

ip route 0.0.0.0 0.0.0.0 192.168.4.4

在source ping pc:

 

source#ping 192.168.4.5

 

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.4.5, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 8/55/104 ms

基本配置完成

我们把r3配置为maping agent r2 r4 配置为 候选路由

source(config)#ip pim autorp listener

source(config)#ip multicast-routing 

source(config)#int s0/0

source(config-if)#ip pim sparse-mode 

source(config)#ip igmp snooping 

r2(config)#ip pim autorp listener 

r2(config)#ip multicast-routing 

r2(config)#int s0/0

r2(config-if)#ip pim sparse-mode 

r2(config)#int s0/1

r2(config-if)#ip pim sparse-mode 

r2(config)#ip igmp snooping 

r2(config)#int lo 0

r2(config-if)#ip pim sparse-mode

r2(config)#ip pim send-rp-announce lo 0 scope 10 group-list 1

r2(config)#access-list 1 permit 224.0.0.0 255.255.255.0  

 

r3(config)#int lo 0

r3(config-if)#ip pim sp

r3(config-if)#ip pim sparse-mo

 

r3(config-if)#int s0/1

r3(config-if)#ip pim sp m

r3(config)#ip pim autorp l

 

r3(config-if)#ip pim sparse-mode

r3(config-if)#int s0/1

r3(config-if)#ip pim sp m

r3(config)#ip pim send-rp-discovery lo 0 scope 10

r4(config)#ip pim send-rp-announce lo 0 scope 10 group-list 1

r4(config)#access-list 1 permit 224.0.0.0 0.255.255.255.0

r4(config)#int lo 0

 

r4(config-if)#ip pim sp

r4(config-if)#ip pim sparse-mo

pc(config)#ip pim autorp l

pc(config-if)#ip igmp join-group 224.1.1.1

我们先检测下pim邻居关系;

 

r2#show ip pim neighbor 

PIM Neighbor Table

Mode: B - Bidir Capable, DR - Designated Router, N - Default DR Priority,

      S - State Refresh Capable

Neighbor          Interface                Uptime/Expires    Ver   DR

Address                                                            Prio/Mode

192.168.1.1       Serial0/0                00:06:38/00:01:29 v2    1 / S

192.168.2.3       Serial0/1                00:05:23/00:01:17 v2    1 / S

 

PIM Neighbor Table

Mode: B - Bidir Capable, DR - Designated Router, N - Default DR Priority,

      S - State Refresh Capable

Neighbor          Interface                Uptime/Expires    Ver   DR

Address                                                            Prio/Mode

192.168.3.4       Serial0/0                00:31:22/00:01:22 v2    1 / S

192.168.2.2       Serial0/1                00:31:43/00:01:30 v2    1 / S

邻居关系正确我们在ping下224.0.0.1

 

source#ping 224.1.1.1 

 

Type escape sequence to abort.

Sending 1, 100-byte ICMP Echos to 224.1.1.1, timeout is 2 seconds:

 

Reply to request 0 from 192.168.4.5, 352 ms

成功!

我们看下多播路由表;

 

r4#show ip mroute 

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, z - MDT-data group sender,

       Y - Joined MDT-data group, y - Sending to MDT-data group

Outgoing interface flags: H - Hardware switched, A - Assert winner

 Timers: Uptime/Expires

 Interface state: Interface, Next-Hop or VCD, State/Mode

 

(*, 224.1.1.1), 00:31:54/00:02:16, RP 0.0.0.0, flags: SJC

  Incoming interface: Null, RPF nbr 0.0.0.0

  Outgoing interface list:

    Serial0/1, Forward/Sparse, 00:31:54/00:02:16

 

(*, 224.0.1.39), 00:17:44/stopped, RP 0.0.0.0, flags: D

  Incoming interface: Null, RPF nbr 0.0.0.0

  Outgoing interface list:

    Serial0/0, Forward/Sparse, 00:17:44/00:00:00

 

(2.2.2.2, 224.0.1.39), 00:01:34/00:01:25, flags: PT

  Incoming interface: Serial0/0, RPF nbr 192.168.3.3

  Outgoing interface list: Null

 

(4.4.4.4, 224.0.1.39), 00:15:00/00:02:01, flags: T

  Incoming interface: Loopback0, RPF nbr 0.0.0.0

  Outgoing interface list:

    Serial0/0, Forward/Sparse, 00:15:00/00:00:00

          

(*, 224.0.1.40), 00:33:16/stopped, RP 0.0.0.0, flags: DCL

  Incoming interface: Null, RPF nbr 0.0.0.0

  Outgoing interface list:

    Serial0/0, Forward/Sparse, 00:33:16/00:00:00

发现这是基于源树分发的!  结束!

 

 下面是多播的一些要点

 

 

 

 

 

 ip igmp join-group 224.1.1.1

ip pim autorp listener