注册 | 登录 忘记密码? 51cto首页 | 博客 | 论坛 | 招聘
热点文章 子域部署Exchange服务器详..
 帮助

CCNP-5 OSPF试验1


2008-04-14 00:27:55
 标签:OSPF CCNP   [推送到技术圈]

试验拓扑:
http://blog.51cto.com/viewpic.php?refimg=" + "http://blog.51cto.com/viewpic.php?refimg=" + this.src)" http:="" blog.51cto.com="" viewpic.php?refimg=" + "http://blog.51cto.com/viewpic.php?refimg=" + this.src)" alt="" src="http://loveme23.blog.51cto.com/attachment/200710/200710021191283260656.jpg" border="0" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; max-width: 650px !important; " />
试验要求:模拟在广播环境下,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 1.1.1.1 255.255.255.0
R1(config-if)#ip ospf network point-to-point
R1(config-if)#exit
R1(config)#router ospf 100
R1(config-router)#router-id 1.1.1.1
R1(config-router)#network 199.99.1.0 0.0.0.255 a 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 2.2.2.2 255.255.255.0
R2(config-if)#ip ospf network point-to-point
R2(config-if)#exit
R2(config)#router ospf 100
R2(config-router)#router-id 2.2.2.2 
R2(config-router)#network 199.99.1.0 0.0.0.255 a 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 3.3.3.3 255.255.255.0
R3(config-if)#ip ospf network point-to-point
R3(config-if)#exit
R3(config)#router ospf 100
R3(config-router)#router-id 3.3.3.3
R3(config-router)#network 199.99.1.0 0.0.0.255 area 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 1.1.1.1, Network Type BROADCAST, Cost: 1
  Transmit Delay is 1 sec, State DROTHER, Priority 1
  Designated Router (ID) 3.3.3.3, Interface address 199.99.1.3
  Backup Designated router (ID) 2.2.2.2, Interface address 199.99.1.2
  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 2.2.2.2  (Backup Designated Router)
    Adjacent with neighbor 3.3.3.3  (Designated Router)
  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 2.2.2.2, Network Type BROADCAST, Cost: 1
  Transmit Delay is 1 sec, State BDR, Priority 1
  Designated Router (ID) 3.3.3.3, Interface address 199.99.1.3
  Backup Designated router (ID) 2.2.2.2, Interface address 199.99.1.2
  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 1.1.1.1
    Adjacent with neighbor 3.3.3.3  (Designated Router)
  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 3.3.3.3, Network Type BROADCAST, Cost: 1
  Transmit Delay is 1 sec, State DR, Priority 1
  Designated Router (ID) 3.3.3.3, Interface address 199.99.1.3
  Backup Designated router (ID) 2.2.2.2, Interface address 199.99.1.2
  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 1.1.1.1
    Adjacent with neighbor 2.2.2.2  (Backup Designated Router)
  Suppress hello for 0 neighbor(s)
不仅可以看到网络类型是BROADCAST,还可以知道端口属于哪个AREAROUTER ID是多少,优先级都是默认值1DR,BDR是谁,HELLO/DEAD/WAIT计时器为多少等等。
 
使用show ip ospf neiighbore命令查看OSPF邻居表:
R1#show ip ospf neighbor 
 
Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2             FULL/BDR        00:00:32    199.99.1.2      FastEthernet0/0
3.3.3.3           1   FULL/DR         00:00:36    199.99.1.3      FastEthernet0/0
 
R2#show ip ospf neighbor
 
Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1           1   FULL/DROTHER    00:00:32    199.99.1.1      FastEthernet0/0
3.3.3.3           1   FULL/DR         00:00:35    199.99.1.3      FastEthernet0/0
 
R3#show ip ospf neighbor
 
Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1           1   FULL/DROTHER    00:00:36    199.99.1.1      FastEthernet0/0
2.2.2.2           1   FULL/BDR        00:00:35    199.99.1.2      FastEthernet0/0
 
通过上面的输出可以知道R3DRR2BDRR1DROther,这是因为R3router-id最大,R2的次之,R1最小。再使用show ip ospf database查看都有哪些LSA类型:
R1#show ip ospf database
 
            OSPF Router with ID (1.1.1.1) (Process ID 100)
 
                Router Link States (Area 0)
 
Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         353         0x80000002 0x00AF1E 1
2.2.2.2         2.2.2.2         354         0x80000002 0x007153 1
3.3.3.3         3.3.3.3         354         0x80000002 0x003388 1
 
                Net Link States (Area 0)
 
Link ID         ADV Router      Age         Seq#       Checksum
199.99.1.3      3.3.3.3         354         0x80000001 0x00736F
 
R2#show ip ospf database
 
            OSPF Router with ID (2.2.2.2) (Process ID 100)
 
                Router Link States (Area 0)
 
Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         371         0x80000002 0x00AF1E 1
2.2.2.2         2.2.2.2         370         0x80000002 0x007153 1
3.3.3.3         3.3.3.3         371         0x80000002 0x003388 1
 
                Net Link States (Area 0)
 
Link ID         ADV Router      Age         Seq#       Checksum
199.99.1.3      3.3.3.3         371         0x80000001 0x00736F
 
R3#show ip ospf database
 
            OSPF Router with ID (3.3.3.3) (Process ID 100)
 
                Router Link States (Area 0)
 
Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         379         0x80000002 0x00AF1E 1
2.2.2.2         2.2.2.2         379         0x80000002 0x007153 1
3.3.3.3         3.3.3.3         378         0x80000002 0x003388 1
 
                Net Link States (Area 0)
 
Link ID         ADV Router      Age         Seq#       Checksum
199.99.1.3      3.3.3.3         378         0x80000001 0x00736F
可以看到只有1类和2LSA
然后我们抓取一下R1debug信息看看:
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: 1.1.1.1 address 199.99.1.1 on FastEthernet0/0 is dead, state DOWN
*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 2.2.2.2
*Mar  1 00:13:57.487: OSPF: Elect DR 3.3.3.3
*Mar  1 00:13:57.487:        DR: 3.3.3.3 (Id)   BDR: 2.2.2.2 (Id)
*Mar  1 00:13:57.487: OSPF: 2.2.2.2 address 199.99.1.2 on FastEthernet0/0 is dead, state DOWN
*Mar  1 00:13:57.487: %OSPF-5-ADJCHG: Process 100, Nbr 2.2.2.2 on FastEthernet0/0 from FULL to DOWN, Neighbor Down: Interface down or detached
*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 0.0.0.0
*Mar  1 00:13:57.491: OSPF: Elect DR 3.3.3.3
*Mar  1 00:13:57.495:        DR: 3.3.3.3 (Id)   BDR: none
*Mar  1 00:13:57.495: OSPF: 3.3.3.3 address 199.99.1.3 on FastEthernet0/0 is dead, state DOWN
*Mar  1 00:13:57.495: %OSPF-5-ADJCHG: Process 100, Nbr 3.3.3.3 on FastEthernet0/0 from FULL to DOWN, Neighbor Down: Interface down or detached
*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 0.0.0.0
*Mar  1 00:13:57.499: OSPF: Elect DR 0.0.0.0
*Mar  1 00:13:57.499:        DR: none    BDR: none
*Mar  1 00:13:57.503: OSPF: Remember old DR 3.3.3.3 (id)
*Mar  1 00:13:57.587: OSPF: Interface FastEthernet0/0 going Up
*Mar  1 00:13:57.639: OSPF: 2 Way Communication to 2.2.2.2 on FastEthernet0/0, state 2WAY\\R2建立邻居关系,形成2 Way
*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 2.2.2.2
*Mar  1 00:13:57.643: OSPF: Elect DR 2.2.2.2
*Mar  1 00:13:57.643:        DR: 2.2.2.2 (Id)   BDR: 2.2.2.2 (Id)
*Mar  1 00:13:57.643: OSPF: Send DBD to 2.2.2.2 on FastEthernet0/0 seq 0x1522 opt 0x52 flag 0x7 len 32 \\发送数据库描述报文
*Mar  1 00:13:57.663: OSPF: 2 Way Communication to 3.3.3.3 on FastEthernet0/0, state 2WAY\\R3建立邻居关系,形成2 Way
*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 \\R2R3比较,选取DR/BDR
*Mar  1 00:13:57.667: OSPF: Elect BDR 2.2.2.2
*Mar  1 00:13:57.667: OSPF: Elect DR 3.3.3.3
*Mar  1 00:13:57.667:        DR: 3.3.3.3 (Id)   BDR: 2.2.2.2 (Id) \\DRR3,BDRR2
*Mar  1 00:13:57.667: OSPF: Send DBD to 3.3.3.3 on FastEthernet0/0 seq 0x18AD opt 0x52 flag 0x7 len 32 \\发送数据库描述报文给DR
*Mar  1 00:13:57.671: OSPF: Remember old DR 2.2.2.2 (id)
*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 2.2.2.2
*Mar  1 00:13:57.671: OSPF: Elect DR 3.3.3.3
*Mar  1 00:13:57.675: