CCNP-5 OSPF试验1(BSCI)
版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://loveme23.blog.51cto.com/7891/45808 |
CCNP-5 OSPF试验1试验拓扑: ![]() 试验要求:模拟在广播环境下,OSPF的配置与调试。
试验目的:掌握OSPF的基本配置,并且能够分析得到OSPF在广播环境下邻居发现过程,DR/BDR选举过程,定时器的时间间隔。
实验配置:
R1:
R1(config)#int f0/0
R1(config-if)#ip add 199.99.1.1
255.255.255.0
R1(config-if)#no shu
R1(config-if)#exit
R1(config)#int loop0
R1(config-if)#ip add
R1(config-if)#ip ospf
network point-to-point
R1(config-if)#exit
R1(config)#router ospf 100
R1(config-router)#router-id
R1(config-router)#network 199.99.1.0
R2:
R2(config)#int f0/0
R2(config-if)#ip add 199.99.1.2
255.255.255.0
R2(config-if)#no shu
R2(config-if)#exit
R2(config)#int loop0
R2(config-if)#ip add
R2(config-if)#ip ospf
network point-to-point
R2(config-if)#exit
R2(config)#router ospf 100
R2(config-router)#router-id
R2(config-router)#network 199.99.1.0
R3:
R3(config)#int f0/0
R3(config-if)#ip add 199.99.1.3
255.255.255.0
R3(config-if)#no shu
R3(config-if)#exit
R3(config)#int loop0
R3(config-if)#ip add
R3(config-if)#ip ospf
network point-to-point
R3(config-if)#exit
R3(config)#router ospf 100
R3(config-router)#router-id
R3(config-router)#network 199.99.1.0
配置完成后,使用show
ip ospf interface命令查看端口类型:
R1#show ip ospf interface f0/0
FastEthernet0/0 is up, line protocol is up
Internet Address 199.99.1.1/24, Area 0
Process ID 100, Router ID
Transmit Delay is 1 sec, State DROTHER, Priority 1
Designated Router (ID)
Backup Designated router (ID)
Timer intervals configured, Hello 10, Dead 40,
Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:01
Supports Link-local Signaling (LLS)
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 2, Adjacent neighbor count is 2
Adjacent with neighbor
Adjacent with neighbor
Suppress hello for 0 neighbor(s)
R2#show ip ospf interface f0/0
FastEthernet0/0 is up, line protocol is up
Internet Address 199.99.1.2/24, Area 0
Process ID 100, Router ID
Transmit Delay is 1 sec, State BDR, Priority 1
Designated Router (ID)
Backup Designated router (ID)
Timer intervals configured, Hello 10, Dead 40,
Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:06
Supports Link-local Signaling (LLS)
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 2, Adjacent neighbor count is 2
Adjacent with neighbor
Adjacent with neighbor
Suppress hello for 0 neighbor(s)
R3#show ip ospf interface f0/0
FastEthernet0/0 is up, line protocol is up
Internet Address
199.99.1.3/24, Area 0
Process ID 100, Router ID
Transmit Delay is 1 sec,
Designated Router (ID)
Backup Designated router (ID)
Timer intervals configured, Hello 10, Dead 40,
Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:07
Supports Link-local Signaling (LLS)
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 2, Adjacent neighbor count is 2
Adjacent with
neighbor
Adjacent with neighbor
Suppress hello for 0 neighbor(s)
不仅可以看到网络类型是BROADCAST,还可以知道端口属于哪个AREA,ROUTER ID是多少,优先级都是默认值1DR,BDR是谁,HELLO/DEAD/WAIT计时器为多少等等。
使用show ip ospf
neiighbore命令查看OSPF邻居表:
R1#show ip ospf neighbor
Neighbor ID Pri
State Dead Time Address Interface
R2#show ip ospf neighbor
Neighbor ID Pri
State Dead Time Address Interface
R3#show ip ospf neighbor
Neighbor ID Pri
State Dead Time Address Interface
通过上面的输出可以知道R3是DR,R2是BDR,R1为DROther,这是因为R3的router-id最大,R2的次之,R1最小。再使用show ip
ospf database查看都有哪些LSA类型:
R1#show ip ospf database
OSPF Router with ID (
Router
Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
199.99.1.3
R2#show ip ospf database
OSPF Router with ID (
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
Net
Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
199.99.1.3
R3#show ip ospf database
OSPF Router with ID (
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
Net
Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
199.99.1.3
可以看到只有1类和2类LSA。
然后我们抓取一下R1的debug信息看看:
R1#debug ip ospf adj
OSPF adjacency events debugging is on
R1#
R1#clear ip ospf p
R1#clear ip ospf process
Reset ALL OSPF processes? [no]: y
R1#
*Mar
1 00:13:57.483: OSPF: Interface FastEthernet0/0 going Down
*Mar
1 00:13:57.483: OSPF:
*Mar
1 00:13:57.483: OSPF: Neighbor change Event on interface FastEthernet0/0
*Mar
1 00:13:57.483: OSPF: DR/BDR election on FastEthernet0/0
*Mar
1 00:13:57.487: OSPF: Elect BDR
*Mar
1 00:13:57.487: OSPF: Elect DR
*Mar
1 00:13:57.487: DR:
*Mar
1 00:13:57.487: OSPF:
*Mar
1 00:13:57.487: %OSPF-5-ADJCHG: Process 100, Nbr
*Mar
1 00:13:57.491: OSPF: Neighbor change Event on interface FastEthernet0/0
*Mar
1 00:13:57.491: OSPF: DR/BDR election on FastEthernet0/0
*Mar
1 00:13:57.491: OSPF: Elect BDR
*Mar
1 00:13:57.491: OSPF: Elect DR
*Mar
1 00:13:57.495: DR:
*Mar
1 00:13:57.495: OSPF:
*Mar
1 00:13:57.495: %OSPF-5-ADJCHG: Process 100, Nbr
*Mar
1 00:13:57.499: OSPF: Neighbor change Event on interface FastEthernet0/0
*Mar
1 00:13:57.499: OSPF: DR/BDR election on FastEthernet0/0
*Mar
1 00:13:57.499: OSPF: Elect BDR
*Mar
1 00:13:57.499: OSPF: Elect DR
*Mar
1 00:13:57.499: DR:
none BDR: none
*Mar
1 00:13:57.503: OSPF: Remember old DR
*Mar
1 00:13:57.587: OSPF: Interface FastEthernet0/0 going Up
*Mar
1 00:13:57.639: OSPF: 2 Way Communication to
*Mar
1 00:13:57.639: OSPF: Backup seen Event before WAIT timer on
FastEthernet0/0
*Mar 1 00:13:57.639: OSPF: DR/BDR election on
FastEthernet0/0 \\与R2比较,选取DR/BDR
*Mar 1 00:13:57.643: OSPF: Elect BDR
*Mar 1 00:13:57.643: OSPF: Elect DR
*Mar 1 00:13:57.643: DR:
*Mar 1 00:13:57.643: OSPF: Send DBD to
*Mar 1 00:13:57.663: OSPF: 2 Way Communication to
*Mar 1 00:13:57.663: OSPF: Neighbor change Event
on interface FastEthernet0/0
*Mar 1 00:13:57.663: OSPF: DR/BDR election on
FastEthernet0/0 \\与R2和R3比较,选取DR/BDR
*Mar 1 00:13:57.667: OSPF: Elect BDR
*Mar 1 00:13:57.667: OSPF: Elect DR
*Mar 1 00:13:57.667: OSPF: Send DBD to
*Mar
1 00:13:57.671: OSPF: Remember old DR
*Mar
1 00:13:57.671: OSPF: Neighbor change Event on interface FastEthernet0/0
*Mar
1 00:13:57.671: OSPF: DR/BDR election on FastEthernet0/0
*Mar
1 00:13:57.671: OSPF: Elect BDR
*Mar
1 00:13:57.671: OSPF: Elect DR
*Mar
1 00:13:57.675: DR:
*Mar 1 00:13:57.711: OSPF: Rcv DBD from
*Mar 1 00:13:57.711: OSPF: NBR Negotiation Done.
We are the SLAVE \\MASTER/SLAVE的选取,在此为R2为MASTER,R1为SLAVE。
*Mar 1 00:13:57.715: OSPF: Send DBD to
*Mar 1 00:13:57.759: OSPF: Rcv DBD from
*Mar 1 00:13:57.763: OSPF: NBR Negotiation Done.
We are the SLAVE \\MASTER/SLAVE的选取,在此为R3为MASTER,R1为SLAVE。
*Mar 1 00:13:57.763: OSPF: Send DBD to
*Mar 1 00:13:57.767: OSPF: Rcv DBD from
*Mar 1 00:13:57.771: OSPF: Send DBD to
*Mar 1 00:13:57.879: OSPF: Rcv DBD from
*Mar 1 00:13:57.879: OSPF: Exchange Done with
*Mar 1 00:13:57.883: OSPF: Send LS REQ to
*Mar 1 00:13:57.883: OSPF: Send DBD to
*Mar 1 00:13:57.955: OSPF: Rcv DBD from
*Mar 1 00:13:57.955: OSPF: Send DBD to
*Mar 1 00:13:57.987: OSPF: Reset old DR on
FastEthernet0/0
*Mar 1 00:13:57.987: OSPF: Build router LSA for
area 0, router ID
*Mar 1 00:13:57.995: OSPF: Rcv LS UPD from
*Mar 1 00:13:57.995: OSPF: Synchronized with
*Mar 1 00:13:57.999: OSPF: Rcv DBD from
*Mar 1 00:13:57.999: OSPF: Exchange Done with
*Mar 1 00:13:58.003: OSPF: Synchronized with
*Mar 1 00:13:58.003: OSPF: Send DBD to
*Mar 1 00:13:58.083: OSPF: Rcv LS UPD from
*Mar 1 00:14:02.583: OSPF: Rcv LS UPD from
*Mar 1 00:14:02.783: OSPF: Rcv LS UPD from
*Mar 1 00:14:02.855: OSPF: Rcv LS UPD from
*Mar 1 00:14:02.859: OSPF: Rcv LS UPD from
*Mar 1 00:14:03.135: OSPF: Rcv LS UPD from
*Mar 1 00:14:03.499: OSPF: Build router LSA for
area 0, router ID
*Mar 1 00:14:03.671: OSPF: Rcv LS UPD from
红色标记/蓝色注释的部分比较重要,通过红色标记/蓝色注释的部分可以看到整个OSPF邻居建立和选取DR/BDR和交换DBD报文和LSU/LSR/LSAck报文,最终形成FULL状态的全部过程。
实验总结:通过这个简单的实验我们可以知道在广播环境下,OSPF的邻居关系是自动建立的,并且需要有DR/BDR地选取,还可以看到几个特别计时器的设置,hello间隔为10秒,死亡,等待时间为hello时间间隔的4倍40秒。
本文出自 “★Beckham~23” 博客,请务必保留此出处http://loveme23.blog.51cto.com/7891/45808 本文出自 51CTO.COM技术博客 |




loveme23
博客统计信息
热门文章
最新评论
友情链接
