配置OSPF邻居认证.ppt
《配置OSPF邻居认证.ppt》由会员分享,可在线阅读,更多相关《配置OSPF邻居认证.ppt(83页珍藏版)》请在三一办公上搜索。
1、1,6.9 配置OSPF邻居认证,6.9.1操作内容和环境操作内容:本节主要介绍在思科路由器上配置OSPF邻居认证的命令和方法,通过学习,了解并掌握多区域中OSPF路由器之间邻居认证方式:明文认证和MD5算法密文认证。组网环境:Router3是思科CISCO 3725路由器,IOS为c3725-jk9s-mz.123-12a(版本为12.3),Router1和Router2是思科CISCO 2621XM路由器,IOS为c2600-adventerprisek9-mz.123-11.T3(版本为12.3)。PC机3台,DTE-DCE交叉电缆(V35电缆)1对,交叉网线1根(或一台交换机和2根直通
2、网线),console配置电缆3根。Router1以太网口与Router3的以太网口通过交叉网线相连或通过交换机相连,Router1串口与Router3的串口通过V35电缆相连。(图中的Fa0/0代表快速以太网FastEtherent0/0端口)。,2,图6-11 OSPF邻居认证配置拓扑结构图,3,6.9.2 相关知识介绍(基础知识)OSPF协议支持基于接口的OSPF报文认证,认证OSPF相邻路由器的身份,以保证OSPF报文来自经认证的邻居路由器,防止未授权的邻居向自己传递包含虚假路由信息的的OSPF报文OSPF协议支持两种认证方式:在相邻路由器之间明文认证(Simple),或MD5算法密文
3、认证。采用明文认证时,认证密码在链路上以明文方式传送,用数据包嗅探器就可以轻易地捕获OSPF的分组,并解码出没有加密的密码。如果使用密文认证,则路由器只在链路上传送密码的消息摘要或哈希值,而不传送密码本身,只有接收的路由器配置了正确的认证密钥,认证才能通过,4,6.9.2 相关知识介绍(注意要点)当接口采用MD5密文认证时,除了设定认证字(即认证密码),还要指定认证字键值key-id,每个key-id是一个1255之间的整数,与MD5认证字配合使用。在一个接口上,后配置的认证字与key-id将覆盖原有的认证字与key-id。需要缺省情况下,接口不对报文进行认证。在配置对报文进行认证时,其明文认
4、证密码的最大长度为8个字符;MD5认证密码的最大长度为16个字符;key-id为MD5认证方式时的认证字键值,取值范围为1255。同一网段上的相邻路由器的接口配置的报文认证方式、认证密码以及key-id都必须一致,否则认证会失败。,5,6.9.2 相关知识介绍(认证格式)(1)相邻路由器明文认证的设置第一步:在区域中进入认证的路由器上启动区域明文认证。启动区域明文认证的命令格式如下:area area_id authentication 第二步,在接口上输入明文形式的密码 在接口上配置明文认证方式和密码的命令格式如下:ip ospf authentication-key password例:配
5、置区域0内接口Serial0/0 对OSPF 报文采用简单认证,密码为abc123,命令如下:Router(config)#router ospf 1 Router(config-router)#area 0 authentication Router(config-router)#exit Router(config)#interface s0/0 Router(config-if)#ip ospf authentication-key abc123,6,6.9.2 相关知识介绍(认证格式)(2)相邻路由器MD5密文认证的设置第一步:在区域中进入认证的路由器上启动MD5区域认证。启动区域MD
6、5密文认证的命令格式如下:area area_id authentication message-digest在接口上输入MD5认证字(或称为认证密钥)及认证字键值 在接口上配置MD5认证字及认证字键值的命令格式如下:ip ospf message-digest-key keyid md5 key 例:配置区域0内接口Serial0/0 采用MD5密文认证,MD5认证密钥为bbbb,key-id 为178,命令如下:Router(config)#router ospf 1 Router(config-router)#area 0 authentication message-digest Ro
7、uter(config-router)#exit Router(config)#interface s0/0 Router(config-if)#ip ospf message-digest-key 178 md5 bbbb,7,6.9.3 操作步骤按拓扑图配置各个端口及认证方式(1)配置 Router3的FA0/0接口及接口认证方式Router3路由器型号为:思科CISCO 3725,其命令如下Routerenable Router#config terminalEnter configuration commands,one per line.End with CNTL/Z.Router(
8、config)#hostname Router3 Router3(config)#interface fa0/0Router3(config-if)#ip address 10.10.1.2 255.255.255.0Router3(config-if)#no shutdownRouter3(config-if)#ip ospf authentication-key aaaa Router3(config-if)#exitRouter3(config)#router ospf 1#进入ospf设置状态Router3(config-router)#network 10.10.1.0 0.0.0.
9、255 area 0Router3(config-router)#area 0 authentication#在区域0路由器上启动区域认证Router3(config-router)#end,8,6.9.3 操作步骤按拓扑图配置各个端口及认证方式(2)Router1的FA0/0、S0/0接口配置及接口认证方式:Router1路由器型号为:思科CISCO2621XM,其命令如下 Routerenable Router#config terminal Enter configuration commands,one per line.End with CNTL/Z.Router(config)#h
10、ostname Router1 Router1(config)#interface fa0/0 Router1(config-if)#ip address 10.10.1.1 255.255.255.0 Router1(config-if)#no shutdown Router1(config-if)#ip ospf authentication-key aaaa Router1(config-if)#interface s0/0 Router1(config-if)#ip address 192.168.1.1 255.255.255.0 Router1(config-if)#no shut
11、down Router1(config-if)#clockrate 64000#连接该端口的电缆若是DTE电缆,则不用配置 Router1(config-if)#ip ospf message-digest-key 178 md5 bbbb,9,Router1(config-if)#exit Router1(config)#router ospf 1#进入ospf设置状态 Router1(config-router)#network 192.168.1.0 0.0.0.255 area 1 Router1(config-router)#network 10.10.1.0 0.0.0.255 a
12、rea 0 Router1(config-router)#area 0 authentication#在区域0路由器上启动区域明文认证 Router1(config-router)#area 1 authentication message-digest#在区域1路由器上启动MD5区域认证 Router1(config-router)#end Router1#,10,6.9.3 操作步骤按拓扑图配置各个端口及认证方式(3)Router2的S0/0接口的配置及认证方式 Router2的型号为:思科CISCO 2621XM路由器,配置命令如下:Routerenable Router#config
13、terminal Enter configuration commands,one per line.End with CNTL/Z.Router(config)#hostname Router2 Router2(config)#interface s0/0 Router2(config-if)#ip address 192.168.1.2 255.255.255.0 Router2(config-if)#no shut Router2(config-if)#clockrate 64000#连接该端口的电缆若是 DTE电缆,则不用设置 Router2(config-if)#ip ospf me
14、ssage-digest-key 178 md5 bbbb Router2(config-if)#exit Router2(config)#router ospf 1 Router2(config-router)#network 192.168.1.0 0.0.0.255 area 1 Router2(config-router)#area 1 authentication message-digest,11,6.9.3 操作步骤2.测试认证方式的正确性 Router2#ping 10.10.1.1 Type escape sequence to abort.Sending 5,100-byt
15、e ICMP Echos to 10.10.1.1,timeout is 2 seconds:!Success rate is 100 percent(5/5),round-trip min/avg/max=28/28/32 ms从结果看,Router2能ping通Router1,线路是连通的,MD5密文认证通过。再测试其它网段。Router2#ping 192.168.1.1#测试结果是连通的 Router2#ping 10.10.1.2#测试结果是连通的 通过ping命令测试,Router2能ping通Router3,线路是连通的,明文认证也通过,并且OSPF协议工作正常。,12,6.9.
16、3 操作步骤3.查看路由信息,确定其认证方式(1)查看Router2和Router3的路由表,测试认证方式的正确性Router2#show ip route Gateway of last resort is not set 10.0.0.0/24 is subnetted,1 subnets O IA 10.10.1.0 110/65 via 192.168.1.1,00:11:36,Serial0/0 C 192.168.1.0/24 is directly connected,Serial0/0 Router3#show ip route Gateway of last resort i
17、s not set 10.0.0.0/24 is subnetted,1 subnets C 10.10.1.0 is directly connected,FastEthernet0/0 O IA 192.168.1.0/24 110/65 via 10.10.1.1,00:13:08,FastEthernet0/0通过显示的路由表内容可知,Router2和Router3通过OSPF协议,获得了非直连网段路由信息,这说明链路是连通的,邻居认证通过。,13,6.9.3 操作步骤3.查看路由信息,确定其认证方式(1)查看在Router1上查看端口信息,测试认证方式的正确性Router1#show
18、 ip ospf interface FastEthernet0/0 is up,line protocol is up Internet Address 10.10.1.1/24,Area 0 Process ID 1,Router ID 192.168.1.1,Network Type BROADCAST,Cost:1 Transmit Delay is 1 sec,State DR,Priority 1 Designated Router(ID)192.168.1.1,Interface address 10.10.1.1 Backup Designated router(ID)10.1
19、0.1.2,Interface address 10.10.1.2 Timer intervals configured,Hello 10,Dead 40,Wait 40,Retransmit 5 oob-resync timeout 40 Hello due in 00:00:02 Supports Link-local Signaling(LLS)Index 1/2,flood queue length 0 Next 0 x0(0)/0 x0(0)Last flood scan length is 1,maximum is 1 Last flood scan time is 0 msec,
20、maximum is 0 msec,14,Neighbor Count is 1,Adjacent neighbor count is 1 Adjacent with neighbor 10.10.1.2(Backup Designated Router)Suppress hello for 0 neighbor(s)Simple password authentication enabled Serial0/0 is up,line protocol is up Internet Address 192.168.1.1/24,Area 1 Process ID 1,Router ID 192
21、.168.1.1,Network Type POINT_TO_POINT,Cost:64 Transmit Delay is 1 sec,State POINT_TO_POINT,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 0 x0(0)/0 x0(0)Last flood scan
22、length is 1,maximum is 1,15,Last flood scan time is 0 msec,maximum is 0 msec Neighbor Count is 1,Adjacent neighbor count is 1 Adjacent with neighbor 192.168.1.2 Suppress hello for 0 neighbor(s)Message digest authentication enabled Youngest key id is 178由Router1上的端口信息可知:在FastEthernet0/0上明文认证方式已启动,在Se
23、rial0/0上MD5密文认证方式已启动,其最新设置的认证字key-id号为178,这与我们配置相符。在路由器之间进行邻居认证时,认证双方的认证方式与密码必须一致,否则,不能通过认证。下面我们修改认证一方的认证密码,使其与对方不一致,再测试邻居认证情况。,16,6.9.3 操作步骤4.修改S2端口的OSPF认证密码:(1)修改S0/0端口的OSPF认证密码,使其与对端不一致Router2#config terminal Router2(config)#interface s0/0 Router2(config-if)#no ip ospf message-digest-key 178 md5
24、bbbb Router2(config-if)#ip ospf message-digest-key 123 md5 abcd(2)用ping命令测试连通性Router2#ping 10.10.1.1Type escape sequence to abort.Sending 5,100-byte ICMP Echos to 10.1.1.1,timeout is 2 seconds:.Success rate is 0 percent(0/5)(不通)在Router2上执行ping 10.10.1.1,则后发现此时链路不通,说明Router2与Router1之间的MD5密文认证方式没有通过。,
25、17,6.9.3 操作步骤4.修改S2端口的OSPF认证密码:(3)查看路由表信息Router2#show ip route Gateway of last resort is not set C 192.168.1.0/24 is directly connected,Serial0/0从路由表信息可知,由于邻居之间认证失败,所以链路不通,OSPF协议无法正确执行,路由表中不含通过OSPF获得的到远端网络的路由信息。由此说明在邻居之间进行身份认证时,必须设置统一的认证密码。,18,6.9.3 操作步骤4.修改S2端口的OSPF认证密码:(4)测试Router1与Router2Router2#
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 配置 OSPF 邻居 认证

链接地址:https://www.31ppt.com/p-2867957.html