一、认证的作用
1.增加网络安全性(推荐使用MD5)<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
2.对OSPF重新配置时,不同口令可以配置在新口令和旧口令的路由器上,防止它们在一个共享的公共广播网络的情况下互相通信
 
 
 
二、认证的种类
OSPF路由方式有三种:0 Null (也就是不认证), 1 (明文认证), 2 (MD5加密校验和)
 
 
 
三、实验拓扑,各种信息如拓扑所示:

1.  明文认证:
 
R1:
Router>
Router>en
Router#conf t
Router(config)#hostname R1
R1(config)#interface f0/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#exit
R1(config)#router ospf 1     //启用OSPF路由协议
R1(config-router)#router-id 1.1.1.1
R1(config-router)#network 192.168.1.1 0.0.0.0 area 0
R1(config-router)#exit
R1(config)#interface f0/0
R1(config-if)#ip ospf authentication     //启用认证,不打这个命令的话,密码不起作用
R1(config-if)#ip ospf authentication-key cisco    //配置密码(两边需一样)
R1(config-if)#exit
R1(config)#router ospf 1
R1(config-router)#area 0 authentication    //区域0采用明文认证
R1(config-router)#end
R1#
 
R2:
Router>
Router>en
Router#conf t
Router(config)#hostname R2
R2(config)#interface f0/0
R2(config-if)#ip address 192.168.1.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#exit
R2(config)#router ospf 1
R2(config-router)#router-id 2.2.2.2
R2(config-router)#network 192.168.1.2 0.0.0.0 area 0
R2(config-router)#exit
R2(config)#interface f0/0
R2(config-if)#ip ospf authentication    //启用认证,不打这个命令的话,密码不起作用
R2(config-if)#ip ospf authentication-key cisco     //配置密码
R2(config-if)#exit
R2(config)#router ospf 1
R2(config-router)#area 0 authentication      //区域0采用明文认证
R2(config-router)#end
R2#
 
查看R1接口信息:
R1#show ip ospf interface f0/0
FastEthernet0/0 is up, line protocol is up
Internet address is 192.168.1.1/24, Area 0
Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 1.1.1.1, Interface address 192.168.1.1
Backup Designated Router (ID) 2.2.2.2, Interface address 192.168.1.2
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:07
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 2.2.2.2  (Backup Designated Router)
Suppress hello for 0 neighbor(s)
Simple password authentication enabled   //明文密码认证启用
R1#
 
查看R1邻居表:
R1#show ip ospf neighbor 
Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2           1   FULL/BDR        00:00:31    192.168.1.2     FastEthernet0/0
R1#
 
2.MD5认证
 
MD5算法用在类型2 的认证方式中,将OSPF数据包内容与一个口令计算一个散列值,与密钥ID一起发送,有了密钥ID可以让路由器指定多个口令,口令最大长度16字节,密钥ID在1-255之间,一对邻居路由器密钥ID与口令必须相同.
R1:
R1(config)#interface f0/0
R1(config-if)#no ip ospf authentication     //NO掉明文认证
R1(config-if)#ip ospf message-digest-key 1 md5 cisco
//使用Key-id为1,密码为cisco的MD5认证方式(Key-id与密码两边都需一样)
R1(config-if)#exit
R1(config)#router ospf 1
R1(config-router)#area 0 authentication message-digest   //区域0采用MD5认证
R1(config-router)#end
R1#
R2:
R2(config)#interface f0/0
R2(config-if)#no ip ospf authentication     //同上
R2(config-if)#ip ospf message-digest-key 1 md5 cisco     //同上
R2(config-if)#exit
R2(config)#router ospf 1
R2(config-router)#area 0 authentication message-digest 
R2(config-router)#end
R2#
 
查看R1接口信息:
R1#show ip ospf interface f0/0
FastEthernet0/0 is up, line protocol is up
Internet address is 192.168.1.1/24, Area 0
Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 1.1.1.1, Interface address 192.168.1.1
Backup Designated Router (ID) 1.1.1.1, Interface address 192.168.1.1
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:09
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 2.2.2.2
Suppress hello for 0 neighbor(s)
Message digest authentication enabled    //启用MD5认证
Youngest key id is 1
R1#
 
注意:在一个区域只能使用一种认证方式,在不同链路之间口令可以不同。

转载于:https://blog.51cto.com/justim/273239

BSCI—9:配置OSPF认证相关推荐

  1. Cisco思科路由器配置OSPF认证的简单例子

    需求: 两台路由器之间配置OSPF认证,只有通过认证才能建立OSPF邻居关系. 实验拓扑: 配置: 1. 配置各端口的IP地址 R1: R1(config)#int loopback1 R1(conf ...

  2. 配置OSPF认证【eNSP实现】

    OSPF支持报文验证功能,只有通过验证的报文才能接收,否则将不能正常建立邻居关系. OSPF支持两种认证方式:区域认证和链路认证 使用区域认证时,一个区域中所有的路由器在该区域下的认证模式和口令必须一 ...

  3. BSCI—8-(2):OSPF的特殊区域类型与配置

    BSCI-8-(2):OSPF的特殊区域类型与配置 2010-01-29 09:10:48 标签:OSPF BSCI 特殊区域 [推送到技术圈] 版权声明:原创作品,允许转载,转载时请务必以超链接形式 ...

  4. Cisco Packet Tracer(配置OSPF)

    [OSPF]在R1/R2/R3/R4上配置单区域(area 0)OSPF,使得全网互通 [OSPF]观察R1/R2/R3/R4路由表协议标识:现在是通过什么协议学习到路由信息?为什么?请写出. [OS ...

  5. 1.2配置OSPF包文分析和验证

    1.2.2实验2:配置OSPF包文分析和验证 [1] 实验目的 通过抓包分析OSPF的包文 实现OSPF区域认证的配置 实验拓扑 实验拓扑图如图1-3所示. 图1-3 配置OSPF包文分析和验证 实验 ...

  6. Packet Tracer - 在思科路由器上配置 AAA 认证

    Packet Tracer - 在思科路由器上配置 AAA 认证 拓扑图 地址分配表 设备 接口 IP 地址 子网掩码 默认网关 交换机端口 R1 G0/1 192.168.1.1 255.255.2 ...

  7. 11.CCNA第十一天-配置OSPF/EIGRP(增强型内部网关协议)

    配置OSPF Branch(config)#router ospf ? <1-65535>  Process ID 通配符掩码 在IGP协议中,以连续的0和连续的1组成 有一种不科学的称呼 ...

  8. CCNA培训课总结笔记--配置OSPF实验(十一)

    实验目的: 理解OSPF协议,掌握配置OSPF协议的配置及验证命令. 实验拓扑图: 实验内容: 路由器的配置 R1上的配置 进入全局配置模式,同样地粘贴上基本路由命令 Router(config)#e ...

  9. 配置思路ensp_配置OSPF的Stub区域示例

    华为ENSP模拟器下载地址(提取码:f651 有任何下载安装问题可以在评论区讨论) 组网需求 如图1所示,三台交换机之间运行OSPF协议,整个OSPF网络被划分为Area0和Area1两个区域,其中S ...

最新文章

  1. Android数据存储之SD卡
  2. 【Linux】2_文件和用户管理
  3. 解决方案:无源(PON)光网络在弱电工程中的应用
  4. 项目怎么部署到服务器上_项目开发学习 云服务器的部署
  5. Node.js Stream - 基础篇
  6. mysql3.51 密码修改_mysql修改密码
  7. c++ for each 遍历tuple
  8. 高级技巧之Lambda表达式
  9. 计算机编码原理——不同数据类型存储中文编码
  10. Node.js 后端框架排名
  11. laravel的auth用户认证的例子
  12. 1159 最大全0子矩阵
  13. embedding lookup
  14. iOS从零开始学习之初
  15. “开源和商业化不能形成对立!”
  16. 计算机常用的输出设备有什么作用,常用的多媒体输入输出设备有哪些,主要功能是什么...
  17. 提升业务投入和研发人效,2个实用建议,很多大公司都在用
  18. 圣诞颂歌(Christmas Songs)
  19. PHP实现小型问卷星,JS实现问卷星自动填问卷脚本并在两秒自动提交功能
  20. 浅谈强化学习二之马尔卡夫决策过程与动态规划

热门文章

  1. 漂浮机器人新进展:Cimon的头部将为国际空间站带来人工智能
  2. Js中的window.parent ,window.top,window.self 详解
  3. 鲁亿通欲收购昇辉控股 跨界布局照明、智慧城市领域
  4. LR11之web_reg_find文本检查点的使用
  5. json-lib把XML转化为json
  6. 2013微软 MVP 社区巡讲
  7. 2011年的32有用的jQuery插件
  8. 先搞清楚了任务究竟是什么再说
  9. 以前写的一点东西,放上来吧。否则就扔掉了
  10. 人工智能这条小船何时才能变成航母?