OSPF邻居认证实际案例(配图)+详细验证过程

简介:


邻居认证使得路由器确认每次所收到的路由更新的源。如果关键字不匹配,就会拒绝路由更新。
 
Cisco使用两种类型的邻居认证:纯文本和MD5。
 
纯文本认证发一个关键字,这个关键字是明文传输,可被非法用户所窃取,所以不推荐使用。
 
MD5认证发一个报文摘要,而不是关键字。MD5被用来生成一个关键字的散列。这个散列是被发送的对象。MD5方式不易被非法用户所窃取。
 
这个案例中,我们在R1与R2之间使用明文认证,在R2与R3之间使用MD5认证。
 
 
// R1 //
int e0/0
  ip ad 192.1.1.1 255.255.255.0
  ip ospf authentication-key cisco    //明文认证,关键字为cisco
 
router os 1
  network 192.1.1.1 0.0.0.0 area 0
  area 0 authentication
 
 
// R2 //
int e0/0
  ip ad 192.1.1.2 255.255.255.0
  ip ospf authentication-key cisco    //明文认证,关键字为cisco
 
int e1/0
  ip ad 193.1.1.2 255.255.255.0
  ip ospf message-digest-key 1 md5 cracker
 
router os 1
  network 192.1.1.2 0.0.0.0 area 0
  network 193.1.1.2 0.0.0.0 area 1
  area 0 authentication
  area 1 authentication message-digest
 
 
// R3 //
int e1/0
  ip ad 193.1.1.3 255.255.255.0
  ip ospf message-digest-key 1 md5 cracker
 
router os 1
  network 193.1.1.3 0.0.0.0 a 1
  area 1 authentication message-digest
 
 
 
验证过程:
r1#sh ip os int e0/0
Ethernet0/0 is up, line protocol is up
  Internet Address 192.1.1.1/24, Area 0
  Process ID 1, Router ID 192.1.1.1, Network Type BROADCAST, Cost: 10
  Transmit Delay is 1 sec, State BDR, Priority 1
  Designated Router (ID) 193.1.1.2, Interface address 192.1.1.2
  Backup Designated router (ID) 192.1.1.1, Interface address 192.1.1.1
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    Hello due in 00:00:06
  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 1, Adjacent neighbor count is 1
    Adjacent with neighbor 193.1.1.2  (Designated Router)
  Suppress hello for 0 neighbor(s)
   Simple password authentication enabled
 
r2#sh ip os int e0/0
Ethernet0/0 is up, line protocol is up
  Internet Address 192.1.1.2/24, Area 0
  Process ID 1, Router ID 193.1.1.2, Network Type BROADCAST, Cost: 10
  Transmit Delay is 1 sec, State DR, Priority 1
  Designated Router (ID) 193.1.1.2, Interface address 192.1.1.2
  Backup Designated router (ID) 192.1.1.1, Interface address 192.1.1.1
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    Hello due in 00:00:04
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 2
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 1, Adjacent neighbor count is 1
    Adjacent with neighbor 192.1.1.1  (Backup Designated Router)
  Suppress hello for 0 neighbor(s)
   Simple password authentication enabled
 
r2#sh ip os int e1/0
Ethernet1/0 is up, line protocol is up
  Internet Address 193.1.1.2/24, Area 1
  Process ID 1, Router ID 193.1.1.2, Network Type BROADCAST, Cost: 10
  Transmit Delay is 1 sec, State DR, Priority 1
  Designated Router (ID) 193.1.1.2, Interface address 193.1.1.2
  Backup Designated router (ID) 193.1.1.3, Interface address 193.1.1.3
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    Hello due in 00:00:03
  Index 1/2, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 2, maximum is 2
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 1, Adjacent neighbor count is 1
    Adjacent with neighbor 193.1.1.3  (Backup Designated Router)
  Suppress hello for 0 neighbor(s)
  Message digest authentication enabled
    Youngest key id is 1
 
r3#sh ip os int e1/0
Ethernet1/0 is up, line protocol is up
  Internet Address 193.1.1.3/24, Area 1
  Process ID 1, Router ID 193.1.1.3, Network Type BROADCAST, Cost: 10
  Transmit Delay is 1 sec, State BDR, Priority 1
  Designated Router (ID) 193.1.1.2, Interface address 193.1.1.2
  Backup Designated router (ID) 193.1.1.3, Interface address 193.1.1.3
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    Hello due in 00:00:04
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 2
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 1, Adjacent neighbor count is 1
    Adjacent with neighbor 193.1.1.2  (Designated Router)
  Suppress hello for 0 neighbor(s)
  Message digest authentication enabled
    Youngest key id is 1
 
 
 
为了更进一步理解认证过程,我们可以打开DEBUG,并将R3的MD5认证key改为5:
// R3 //
debug ip ospf adj
 
int e1/0
  ip ospf message-digest-key 5 md5 cracker
 
r3#
01:16:03: OSPF: Rcv pkt from 193.1.1.2, Ethernet1/0 :  Mismatch Authentication Key - No message digest key 1 on interface
01:16:09: OSPF:  Send with youngest Key 5
 
 
r3#show ip ospf neighbor    //观察结果无法发现邻居。
 
//认证未通过,无法与R2建立起邻居关系。
 
当我们把MD5认证KEY改回1后,认证通过。
 
 
第二步实验,我们把关键字进行修改:
// R3 //
debug ip ospf adj
 
int e1/0
  ip ospf message-digest-key 1 md5 cuijian
 
01:21:33: OSPF: Rcv pkt from 193.1.1.2, Ethernet1/0 :  Mismatch Authentication Key - Message Digest Key 1
01:21:40: OSPF:  Send with youngest Key 1
 
我们要在实际工作中学会使用debug这个思科排错的利器。









本文转自 ciscodocu51CTO博客,原文链接:http://blog.51cto.com/ciscodocu/52824,如需转载请自行联系原作者
目录
相关文章
|
关系型数据库 MySQL 数据库
项目实战24—xxljob控制台不打印日志
项目实战24—xxljob控制台不打印日志
835 0
|
6月前
|
计算机视觉 流计算 Python
人脸识别照片眨眼张嘴生成器,一键生成眨眼照片app,怎么用一张照片做人脸识别
基于Python的人脸识别照片动画生成系统,支持眨眼和张嘴动作。使用OpenCV、dlib等技术实现,可输出GIF或序列帧。代码包含完整的人脸检测
|
存储 Linux 虚拟化
超详细!VMware虚拟机迁移操作教程
为VMware虚拟机迁移提供从0到1的详尽操作指导
1683 0
超详细!VMware虚拟机迁移操作教程
|
网络协议 数据库 网络架构
OSPF邻居关系建立过程详解
OSPF邻居关系建立过程详解
1150 6
|
9月前
|
Java 关系型数据库 MySQL
weixin050高校体育场管理系统+ssm(文档+源码)_kaic
本文针对高校体育场管理系统的开发与实现进行详细介绍。随着经济快速发展,人们对手机软件需求增加,高校体育场管理系统应运而生。系统采用JAVA技术、Mysql数据库和SSM框架等成熟技术,通过分析功能需求、可行性及性能,设计出包含管理员、用户和学生角色的功能模块。系统实现用户注册登录、信息管理等功能,简化传统手工统计模式,提高管理效率,满足用户对信息获取的及时性与准确性需求。
weixin050高校体育场管理系统+ssm(文档+源码)_kaic
|
9月前
|
人工智能 自然语言处理 Java
30分钟速成:IntelliJ IDEA 2024下载安装与多语言开发环境配置手册
IntelliJ IDEA是Java/Kotlin开发领域的旗舰级IDE,最新版本实现了AI全栈辅助、量子计算插件和多语言互操作三大技术突破。AI辅助提升代码生成与性能优化准确率40%,量子计算插件支持1024量子位模拟,多语言混合调试性能提升300%。系统要求包括i5以上CPU、8GB内存及Windows 7+等。安装流程涵盖获取Ultimate版、配置启动器及性能优化设置。核心功能包括AI编码助手和多语言开发环境配置。提供量子算法开发和AI代码审查实战案例,并附故障排查指南和学习资源。
|
供应链 关系型数据库 MySQL
可重复读解决了哪些问题
在数据库事务处理中,隔离级别是一个核心概念,它决定了事务在并发执行时如何相互隔离。MySQL的隔离级别之一“可重复读(REPEATABLE READ)”解决了多个并发事务中的数据一致性问题。本文将详细探讨可重复读隔离级别解决了哪些问题。
|
JSON 监控 Shell
用shell脚本如何获取grafana上的监控数据
用shell脚本如何获取grafana上的监控数据
598 2
|
缓存 JavaScript 前端开发
微信 JS-SDK Demo “分享信息设置” API 及数字签名生成方法(NodeJS版本)
微信 JS-SDK Demo “分享信息设置” API 及数字签名生成方法(NodeJS版本)更新时间(2020-10-29)