您的位置:首页 > 其它

CCNP-17 OSPF试验13(BSCI)

2007-10-24 08:14 501 查看

CCNP-17 OSPF试验13

实验拓扑:



试验要求:1 R1 R2起OSPF,配置R1 R2接口明文验证;

2 R1 R2起OSPF,配置R1 R2接口密文验证;

3 R1 R2起OSPF,配置R1 R2区域明文验证;

4 R1 R2起OSPF,配置R1 R2区域密文验证;
试验目的:掌握OSPF不同验证方法的配置。

试验配置:
R1:
R1(config)#int s1/0
R1(config-if)#ip add 199.99.1.1
255.255.255.0
R1(config-if)#clock rate 64000
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)#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
area 0
R1(config-router)#exit

R2:
R2(config)#int s1/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)#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
area 0
R2(config-router)#exit

配置好基本的OSPF后,接下来开始验证的配置:
一.
OSPF接口明文验证:
R1(config)#int s1/0
R1(config-if)#ip ospf
authentication-key cisco
R1(config-if)#ip ospf
authentication
先配置好R1后,在R1上clear ip ospf pj后,邻居关系会消失,debug ip ospf adj会发现以下问题:
R1#debug ip ospf adj
OSPF adjacency events debugging is on
*Mar 1 00:01:51.911: OSPF: Rcv pkt from
199.99.1.2, Serial1/0 : Mismatch Authentication type. Input packet specified
type 0, we use type 1

同样在R2上debug ip ospf adj:
R2#debug ip ospf adj
OSPF adjacency events debugging is on
*Mar 1 00:02:11.979: OSPF: Rcv pkt from
199.99.1.1, Serial1/0 : Mismatch Authentication type. Input packet specified
type 1, we use type 0
可以发现一条错误提示:验证类型不匹配。缺省情况下,无验证为类型0,明文验证为1,记住!
下面在R2接口上同样配置明文验证:
R2(config)#int s1/0
R2(config-if)#ip ospf
authentication-key cisco
R2(config-if)#ip ospf
authentication
这样配置完后,邻居关系就会马上建立起来,在R1上查看邻居关系:
R2#show ip ospf
neighbor

Neighbor ID Pri
State Dead Time Address Interface
1.1.1.1
0 FULL/
- 00:00:31 199.99.1.1 Serial1/0

二.OSPF接口密文验证:
首先用no语句去掉接口上的明文验证,然后输入如下命令:
R1(config)#int s1/0
R1(config-if)#ip ospf
message-digest-key 1 md5 cisco
R1(config-if)#ip ospf
authentication message-digest
R1(config-if)#end
同样是先在R1上配置好后clear ip ospf p再debug ip ospf adj查看:
R1#debug ip ospf adj
OSPF adjacency events
debugging is on

*Mar 1 00:03:47.139: OSPF: Send with youngest Key
1
*Mar 1 00:03:51.935: OSPF: Rcv pkt from
199.99.1.2, Serial1/0 : Mismatch Authentication type. Input packet specified
type 0, we use type 2
R1发送了key-id为1的key,但是R2上没有配置验证,所以会出现验证类型不匹配的错误提示,默认情况下密文验证为类型2。
然后查看R2的debug信息:
R2#debug ip ospf adj
OSPF adjacency events
debugging is on
R2#
*Mar 1 00:04:07.083: OSPF: Rcv pkt from
199.99.1.1, Serial1/0 : Mismatch Authentication type. Input packet specified
type 2, we use type 0
同样出现了类型不匹配的错误,下面在R2的接口上配置密文验证:
R2(config)#int s1/0
R2(config-if)#ip ospf
message-digest-key 1 md5 cisco
R2(config-if)#ip ospf
authentication message-digest
R2(config-if)#end
配置完成后,会发现邻居关系也会迅速的建立起来,再R1上show ip ospf neighbor:
R1#show ip ospf
neighbor

Neighbor ID Pri
State Dead Time Address Interface
2.2.2.2
0 FULL/ -
00:00:39 199.99.1.2 Serial1/0
下面我们把R2接口上配置的密文验证的key-id改成其他数字后,看看有什么效果:
R2(config-if)#no ip
ospf message-digest-key 1
R2(config-if)#ip ospf
message-digest-key 2 md5 cisco
注意,在这里我把1改成了2,下面查看R1上的debug信息:
R1#debug ip ospf adj
OSPF adjacency events
debugging is on

*Mar 1 00:05:14.111: OSPF: Rcv pkt from
199.99.1.2, Serial1/0 : Mismatch Authentication Key - No message digest key 2
on interface
可以看到错误提示key-id不匹配,所以无法建立邻居关系。

三.OSPF区域明文验证:
首先no掉接口上的所有验证的配置,然后进行区域明文验证的配置:
R1(config)#router ospf
100
R1(config-router)#area 0
authentication
这样在R1上配置后,观察debug信息:
R1#debug ip ospf adj
OSPF adjacency events
debugging is on

*Mar 1 00:07:04.103: OSPF: Rcv pkt from
199.99.1.2, Serial1/0 : Mismatch Authentication type. Input packet specified
type 0, we use type 1
同样会发现验证类型不匹配的错误提示,只需在R2上做同样的配置即可解决这个问题:
R2(config)#router ospf
100
R2(config-router)#area 0
authentication
这样配置完成后就可以顺利建立邻居关系了。

四.OSPF区域密文验证:
首先no掉关于OSPF区域明文的配置,然后进行OSPF区域密文验证:
R1(config)#router ospf
100
R1(config-router)#area 0
authentication message-digest
R1(config-router)#end
同样在R1上观察debug信息:
R1#debug ip ospf adj
OSPF adjacency events
debugging is on

*Mar 1 00:08:04.103: OSPF: Rcv pkt from
199.99.1.2, Serial1/0 : Mismatch Authentication type. Input packet specified
type 0, we use type 2
同样收到了验证类型不匹配的错误提示,然后在R2上进行同样的配置:
R2(config)#router ospf
100
R2(config-router)#area 0
authentication message-digest
配置完成后邻居关系就可以建立起来了。

实验总结:以上为全部OSPF验证类型的配置,要熟练掌握每种验证类型的配置。
本文出自 “★Beckham~23” 博客,请务必保留此出处http://loveme23.blog.51cto.com/7891/47480
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: