第二十五讲:OSPF路由协议邻居认证配置
创始人
2024-05-03 18:38:34
0

      在相同OSPF区域的路由器上启用身份验证的功能,只有经过身份验证的同一区域的路由器才能互相通告路由信息。这样做不但可以增加网络安全性,对OSPF重新配置时,不同口令可以配置在新口令和旧口令的路由器上,防止它们在一个共享的公共广播网络的情况下互相通信。

实验拓扑图如下所示

操作步骤:

步骤1:如图1所示,连接网络拓扑图。

步骤2:配置路由器A的主机名称和接口IP地址

Router>enable

Router#config

Router_config#hostname Router-A

Router-A_config#int s0/1

Router-A_config_s0/1#ip add 172.16.24.1 255.255.255.0

Router-A_config_s0/1#no shutdown

Router-A_config_s0/1#int loopback 0

Router-A_config_l0#ip add 10.10.10.1 255.255.255.0

步骤3:配置路由器B的主机名称和接口IP地址

Router_config#hostname Router-B

Router-B_config#

Router-B_config#int s0/2

Router-B_config_s0/2#ip add 172.16.24.2 255.255.255.0

Router-B_config_s0/2#physical-layer speed 64000

Router-B_config_s0/2#no shutdown

Router-B_config_s0/2# int loopback 0

Router-B_config_l0#ip add 11.10.10.1  255.255.255.0

步骤4:将Router-A、B相应接口按照拓扑加入area0。

Router-A_config#router ospf 1

Router-A_config_ospf_1#network 172.16.24.0 255.255.255.0 area 0

Router-B_config#router ospf 1

Router-B_config_ospf_1#network 172.16.24.0 255.255.255.0 area 0

步骤5:为Router-A接口配置MD5密文验证。

Router-A:

Router-A_config# interface S0/1

Router-A_config_s0/1#ip ospf message-digest-key 1 md5 DCNU

           !采用MD5加密,密码为DCNU

Router-A_config_s0/1#ip ospf authentication message-digest

在RA上配置好后,启用debug ip ospf packet可以看到:

2002-1-1 00:02:39 OSPF: Send HELLO to 224.0.0.5 on Serial0/2

2002-1-1 00:02:39       HelloInt 10 Dead 40 Opt 0x2 Pri 1 len 44

2002-1-1 00:02:49 OSPF: Recv IP_SOCKET_RECV_PACKET message

2002-1-1 00:02:49 OSPF: Entering ospf_recv

2002-1-1 00:02:49 OSPF: Recv a packet from source: 172.16.24.2 dest 224.0.0.5

2002-1-1 00:02:49 OSPF: ERR recv PACKET, auth type not match

2002-1-1 00:02:49 OSPF: ERROR! events 21

这是因为RA发送了key-id为1的key,但是RB还上没有配置验证,所以会出现验证类型不匹配的错误。

步骤6:为Router-B接口配置MD5密文验证。

Router-B_config# interface S0/2

Router-B_config_s0/2#ip ospf message-digest-key 1 md5 DCNU    

            !定义key和密码

Router-B_config_s0/2#ip ospf authentication message-digest      

            !定义认证类型为MD5

步骤7:查看邻居关系。

                  Router-A#sh ip ospf neighbor

---------------------------------------------------------------                            

OSPF process: 1

                                      AREA: 0

Neighbor ID     Pri   State            DeadTime   Neighbor Addr   Interface

11.10.10.1      1     FULL/-           37         172.16.24.2     Serial0/2

                                                                                     !邻居关系已经建立。

步骤8:删除掉接口认证的配置,然后进行OSPF区域密文验证。

Router-A:

Router-A_config_ospf_1#area 0 authentication message-digest

Router-B:

Router-B_config_ospf_1#area 0 authentication message-digest

步骤9:查看邻居关系。

                  Router-A#sh ip ospf neighbor

---------------------------------------------------------------                                        

OSPF process: 1

                                      AREA: 0

Neighbor ID     Pri   State            DeadTime   Neighbor Addr   Interface

11.10.10.1      1     FULL/-           37         172.16.24.2     Serial0/2

--------------------------------------------------------------

                                                                                          !邻居关系已经建立。

相关内容

热门资讯

监控摄像头接入GB28181平... 流程简介将监控摄像头的视频在网站和APP中直播,要解决的几个问题是:1&...
Windows10添加群晖磁盘... 在使用群晖NAS时,我们需要通过本地映射的方式把NAS映射成本地的一块磁盘使用。 通过...
protocol buffer... 目录 目录 什么是protocol buffer 1.protobuf 1.1安装  1.2使用...
在Word、WPS中插入AxM... 引言 我最近需要写一些文章,在排版时发现AxMath插入的公式竟然会导致行间距异常&#...
【PdgCntEditor】解... 一、问题背景 大部分的图书对应的PDF,目录中的页码并非PDF中直接索引的页码...
Fluent中创建监测点 1 概述某些仿真问题,需要创建监测点,用于获取空间定点的数据࿰...
educoder数据结构与算法...                                                   ...
MySQL下载和安装(Wind... 前言:刚换了一台电脑,里面所有东西都需要重新配置,习惯了所...
修复 爱普生 EPSON L4... L4151 L4153 L4156 L4158 L4163 L4165 L4166 L4168 L4...
MFC文件操作  MFC提供了一个文件操作的基类CFile,这个类提供了一个没有缓存的二进制格式的磁盘...