【实验分享】OSPF虚链路配置
创始人
2025-05-29 20:59:37

实验目的

  1. 掌握OSPF虚链路的配置

  2. 掌握OSPF虚链路认证的配置

  3.  加微 xmws-IT:备注:视频资料。赠华为、思科学习视频教程

实验拓扑

实验需求

  1. 根据实验拓扑图,完成设备的基本配置;

  2. 根据实验拓扑图,在所有设备上启用OSPF,进程号为1,使用Loopback0作为OSPF的Router-ID;

  3. 在R1、R2之间建立虚链路并启用虚链路MD5认证,认证密码为wisdom。

实验步骤

  1. 设备基本配置

    R1基本配置如下:
    hostname R1
    interface Serial1/0ip address 12.1.1.1 255.255.255.0no shutdown
    interface Serial1/1ip address 14.1.1.1 255.255.255.0no shutdown
    interface loopback0ip address 1.1.1.1 255.255.255.255R2的基本配置如下:
    hostname R2
    interface Serial1/0ip address 12.1.1.2 255.255.255.0no shutdown
    interface Serial1/1ip address 23.1.1.2 255.255.255.0no shutdown
    interface loopback0ip address 2.2.2.2 255.255.255.255R3的基本配置如下:
    hostname R3
    interface Serial1/0ip address 23.1.1.3 255.255.255.0no shutdown
    interface loopback0ip address 3.3.3.3 255.255.255.255R4的基本配置如下:
    hostname R4
    interface Serial1/0ip address 14.1.1.4 255.255.255.0no shutdown
    interface loopback0ip address 4.4.4.4 255.255.255.255
    
  2. 配置OSPF

    配置R1:
    router ospf 1router-id 1.1.1.1network 1.1.1.1 0.0.0.0 area 12network 12.1.1.1 0.0.0.0 area 12network 14.1.1.1 0.0.0.0 area 14
    配置R2:
    router ospf 1router-id 2.2.2.2network 2.2.2.2 0.0.0.0 area 12network 12.1.1.2 0.0.0.0 area 12network 23.1.1.2 0.0.0.0 area 0
    配置R3:
    router ospf 1router-id 3.3.3.3network 3.3.3.3 0.0.0.0 area 0network 23.1.1.3 0.0.0.0 area 0
    配置R4:
    ip routing
    router ospf 1router-id 4.4.4.4network 4.4.4.4 0.0.0.0 area 14network 14.1.1.4 0.0.0.0 area 14
    检查R1的OSPF邻居:
    R1#show ip ospf neighbor 
    Neighbor ID  Pri   State         Dead Time   Address         Interface
    2.2.2.2       0   FULL/  -       00:00:31    12.1.1.2        Serial1/0
    4.4.4.4       1   FULL/DR       00:00:37    14.1.1.4        Serial1/1
    检查R2的OSPF邻居:
    R2#show ip ospf neighbor 
    Neighbor ID     Pri   State           Dead Time   Address         Interface
    3.3.3.3           0   FULL/  -        00:00:37    23.1.1.3        Serial1/1
    1.1.1.1           0   FULL/  -        00:00:30    12.1.1.1        Serial1/0
    检查R3的OSPF邻居:
    R3#show ip ospf neighbor 
    Neighbor ID     Pri   State           Dead Time   Address         Interface
    2.2.2.2           0   FULL/  -        00:00:34    23.1.1.2        Serial1/1
    检查R4的OSPF邻居:
    R4#show ip ospf neighbor 
    Neighbor ID  Pri   State          Dead Time   Address         Interface
    1.1.1.1       1   FULL/BDR      00:00:32    14.1.1.1         Serial1/0
    经检查,现在每台设备的OSPF邻居是正常的。那是不是路由的接收也正常的呢?
    检查R1的路由表:
    R1#show ip route ospf 2.0.0.0/32 is subnetted, 1 subnets
    O       2.2.2.2 [110/65] via 12.1.1.2, 00:06:07, Serial1/03.0.0.0/32 is subnetted, 1 subnets
    O IA    3.3.3.3 [110/129] via 12.1.1.2, 00:05:13, Serial1/04.0.0.0/32 is subnetted, 1 subnets
    O       4.4.4.4 [110/2] via 14.1.1.4, 00:05:13, Serial1/123.0.0.0/24 is subnetted, 1 subnets
    O IA    23.1.1.0 [110/128] via 12.1.1.2, 00:05:13, Serial1/0路由表正常。
    检查R2的路由表:
    R2#show ip route ospf 1.0.0.0/32 is subnetted, 1 subnets
    O       1.1.1.1 [110/65] via 12.1.1.1, 00:09:49, Serial1/03.0.0.0/32 is subnetted, 1 subnets
    O       3.3.3.3 [110/65] via 23.1.1.3, 00:09:39, Serial1/1
    没有4.4.4.4/32和14.1.1.0/24路由,因为Area14作为常规区域并没有和Area0直接相连。
    检查R3的路由表:
    R3#show ip route ospf 1.0.0.0/32 is subnetted, 1 subnets
    O IA    1.1.1.1 [110/129] via 23.1.1.2, 00:09:50, Serial1/12.0.0.0/32 is subnetted, 1 subnets
    O IA    2.2.2.2 [110/65] via 23.1.1.2, 00:09:50, Serial1/112.0.0.0/24 is subnetted, 1 subnets
    O IA    12.1.1.0 [110/128] via 23.1.1.2, 00:09:50, Serial1/1
    没有4.4.4.4/32和14.1.1.0/24路由,因为Area14作为常规区域并没有和Area0直接相连。
    检查R4的路由表:
    R4#show ip route ospf没有路由!因为Area14作为常规区域并没有和Area0直接相连。
    
  3. 配置OSPF虚链路

    配置R1:
    R1(config)#router ospf 1
    R1(config-router)#area 12 virtual-link 2.2.2.2配置R2:
    R2(config)#router ospf 1
    R2(config-router)#area 12 virtual-link 1.1.1.1检查R1的邻居表:
    R1#show ip ospf neighbor 
    Neighbor ID  Pri   State         Dead Time   Address         Interface
    2.2.2.2       0   FULL/ -           -        12.1.1.2        OSPF_VL0
    2.2.2.2       0   FULL/ -        00:00:33    12.1.1.2        Serial1/0
    4.4.4.4       1   FULL/DR        00:00:30    14.1.1.4        Serial1/1发现邻居表多了一个条目,邻居是2.2.2.2,OSPF邻居状态为Full,Dead时间是空的,这是因为Virtual-link是一条按需的链路,建立起来之后Virtual-link上是不存在Hello报文发送的。检查R2的邻居表:
    R2#show ip ospf neighbor 
    Neighbor ID  Pri   State           Dead Time   Address         Interface
    1.1.1.1        0   FULL/  -           -        12.1.1.1        OSPF_VL0
    3.3.3.3        0   FULL/  -        00:00:38    23.1.1.3        Serial1/1
    1.1.1.1        0   FULL/  -        00:00:32    12.1.1.1        Serial1/0检查R1上的Virtual-link:
    R1#show ip ospf virtual-links 
    Virtual Link OSPF_VL0 to router 2.2.2.2 is upRun as demand circuitDoNotAge LSA allowed.Transit area 12, via interface Serial1/0, Cost of using 64Transmit Delay is 1 sec, State POINT_TO_POINT,Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5Hello due in 00:00:00Adjacency State FULL (Hello suppressed)Index 1/3, retransmission queue length 0, number of retransmission 0First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)Last retransmission scan length is 0, maximum is 0Last retransmission scan time is 0 msec, maximum is 0 msec检查R2上的Virtual-link:
    R2#show ip ospf virtual-links 
    Virtual Link OSPF_VL0 to router 1.1.1.1 is upRun as demand circuitDoNotAge LSA allowed.Transit area 12, via interface Serial1/0, Cost of using 64Transmit Delay is 1 sec, State POINT_TO_POINT,Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5Hello due in 00:00:08Adjacency State FULL (Hello suppressed)Index 2/3, retransmission queue length 0, number of retransmission 0First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)Last retransmission scan length is 0, maximum is 0
    Last retransmission scan time is 0 msec, maximum is 0 msec检查R1的路由表:
    R1#show ip route ospf 2.0.0.0/32 is subnetted, 1 subnets
    O       2.2.2.2 [110/65] via 12.1.1.2, 00:38:24, Serial1/03.0.0.0/32 is subnetted, 1 subnets
    O       3.3.3.3 [110/129] via 12.1.1.2, 00:38:24, Serial1/04.0.0.0/32 is subnetted, 1 subnets
    O       4.4.4.4 [110/2] via 14.1.1.4, 00:38:41, Serial1/123.0.0.0/24 is subnetted, 1 subnets
    O       23.1.1.0 [110/128] via 12.1.1.2, 00:38:24, Serial1/0检查R2的路由表:
    R2#show ip route ospf 1.0.0.0/32 is subnetted, 1 subnets
    O       1.1.1.1 [110/65] via 12.1.1.1, 00:38:39, Serial1/03.0.0.0/32 is subnetted, 1 subnets
    O       3.3.3.3 [110/65] via 23.1.1.3, 00:38:39, Serial1/14.0.0.0/32 is subnetted, 1 subnets
    O IA    4.4.4.4 [110/66] via 12.1.1.1, 00:38:39, Serial1/014.0.0.0/24 is subnetted, 1 subnets
    O IA    14.1.1.0 [110/65] via 12.1.1.1, 00:38:39, Serial1/0检查R3的路由表:
    R3#show ip route ospf 1.0.0.0/32 is subnetted, 1 subnets
    O IA    1.1.1.1 [110/129] via 23.1.1.2, 00:38:50, Serial1/12.0.0.0/32 is subnetted, 1 subnets
    O IA    2.2.2.2 [110/65] via 23.1.1.2, 00:38:50, Serial1/14.0.0.0/32 is subnetted, 1 subnets
    O IA    4.4.4.4 [110/130] via 23.1.1.2, 00:38:50, Serial1/112.0.0.0/24 is subnetted, 1 subnets
    O IA    12.1.1.0 [110/128] via 23.1.1.2, 00:38:50, Serial1/114.0.0.0/24 is subnetted, 1 subnets
    O IA    14.1.1.0 [110/129] via 23.1.1.2, 00:38:50, Serial1/1检查R4的路由表:
    R4#show ip route ospf 1.0.0.0/32 is subnetted, 1 subnets
    O IA    1.1.1.1 [110/2] via 14.1.1.1, 00:39:30, Serial1/02.0.0.0/32 is subnetted, 1 subnets
    O IA    2.2.2.2 [110/66] via 14.1.1.1, 00:39:30, Serial1/03.0.0.0/32 is subnetted, 1 subnets
    O IA    3.3.3.3 [110/130] via 14.1.1.1, 00:39:14, Serial1/023.0.0.0/24 is subnetted, 1 subnets
    O IA    23.1.1.0 [110/129] via 14.1.1.1, 00:39:14, Serial1/012.0.0.0/24 is subnetted, 1 subnets
    O IA    12.1.1.0 [110/65] via 14.1.1.1, 00:39:30, Serial1/0
    能够学习到完整的路由条目。
    
  4. 配置虚链路认证

    配置R1:
    router ospf 1
    area 12 virtual-link 2.2.2.2 authentication message-digestarea 12 virtual-link 2.2.2.2 message-digest-key 1 md5 wisdom配置R2:
    router ospf 1area 12 virtual-link 1.1.1.1 authentication message-digestarea 12 virtual-link 1.1.1.1 message-digest-key 1 md5 wisdom检查R1的邻居表:
    R1#show ip ospf neighbor 
    Neighbor ID  Pri   State         Dead Time   Address         Interface
    2.2.2.2       0   FULL/  -         -        12.1.1.2        OSPF_VL0
    2.2.2.2       0   FULL/  -      00:00:37    12.1.1.2        Serial1/0
    4.4.4.4       1   FULL/DR       00:00:34    14.1.1.4        Serial1/1检查R2的邻居表:
    R2#show ip ospf neighbor 
    Neighbor ID  Pri   State           Dead Time   Address         Interface
    1.1.1.1        0   FULL/  -           -        12.1.1.1        OSPF_VL0
    3.3.3.3        0   FULL/  -        00:00:36    23.1.1.3        Serial1/1
    1.1.1.1        0   FULL/  -        00:00:39    12.1.1.1        Serial1/0
    

 

相关内容

热门资讯

【实验报告】实验一 图像的... 实验目的熟悉Matlab图像运算的基础——矩阵运算;熟悉图像矩阵的显示方法࿰...
MATLAB | 全网最详细网... 一篇超超超长,超超超全面网络图绘制教程,本篇基本能讲清楚所有绘制要点&#...
大模型落地比趋势更重要,NLP... 全球很多人都开始相信,以ChatGPT为代表的大模型,将带来一场NLP领...
Linux学习之端口、网络协议... 端口:设备与外界通讯交流的出口 网络协议:   网络协议是指计算机通信网...
kuernetes 资源对象分... 文章目录1. pod 状态1.1 容器启动错误类型1.2 ImagePullBackOff 错误1....
STM32实战项目-数码管 程序实现功能: 1、上电后,数码管间隔50ms计数; 2、...
TM1638和TM1639差异... TM1638和TM1639差异说明 ✨本文不涉及具体的单片机代码驱动内容,值针对芯...
Qt+MySql开发笔记:Qt... 若该文为原创文章,转载请注明原文出处 本文章博客地址:https://h...
Java内存模型中的happe... 第29讲 | Java内存模型中的happen-before是什么? Java 语言...
《扬帆优配》算力概念股大爆发,... 3月22日,9股封单金额超亿元,工业富联、鸿博股份、鹏鼎控股分别为3.0...
CF1763D Valid B... CF1763D Valid Bitonic Permutations 题目大意 拱形排列࿰...
SQL语法 DDL、DML、D... 文章目录1 SQL通用语法2 SQL分类3 DDL 数据定义语言3.1 数据库操作3.2 表操作3....
文心一言 VS ChatGPT... 3月16号,百度正式发布了『文心一言』,这是国内公司第一次发布类Chat...
CentOS8提高篇5:磁盘分...        首先需要在虚拟机中模拟添加一块新的硬盘设备,然后进行分区、格式化、挂载等...
Linux防火墙——SNAT、... 目录 NAT 一、SNAT策略及作用 1、概述 SNAT应用环境 SNAT原理 SNAT转换前提条...
部署+使用集群的算力跑CPU密... 我先在开头做一个总结,表达我最终要做的事情和最终环境是如何的,然后我会一...
Uploadifive 批量文... Uploadifive 批量文件上传_uploadifive 多个上传按钮_asing1elife的...
C++入门语法基础 文章目录:1. 什么是C++2. 命名空间2.1 域的概念2.2 命名...
2023年全国DAMA-CDG... DAMA认证为数据管理专业人士提供职业目标晋升规划,彰显了职业发展里程碑及发展阶梯定义...
php实现助记词转TRX,ET... TRX助记词转地址网上都是Java,js或其他语言开发的示例,一个简单的...
【分割数据集操作集锦】毕设记录 1. 按要求将CSV文件转成json文件 有时候一些网络模型的源码会有data.json这样的文件里...
Postman接口测试之断言 如果你看文字部分还是不太理解的话,可以看看这个视频,详细介绍postma...
前端学习第三阶段-第4章 jQ... 4-1 jQuery介绍及常用API导读 01-jQuery入门导读 02-JavaScri...
4、linux初级——Linu... 目录 一、用CRT连接开发板 1、安装CRT调试工具 2、连接开发板 3、开机后ctrl+c...
Urban Radiance ... Urban Radiance Fields:城市辐射场 摘要:这项工作的目标是根据扫描...
天干地支(Java) 题目描述 古代中国使用天干地支来记录当前的年份。 天干一共有十个,分别为:...
SpringBoot雪花ID长... Long类型精度丢失 最近项目中使用雪花ID作为主键,雪花ID是19位Long类型数...
对JSP文件的理解 JSP是java程序。(JSP本质还是一个Servlet) JSP是&#...
【03173】2021年4月高... 一、单向填空题1、大量应用软件开发工具,开始于A、20世纪70年代B、20世纪 80年...
LeetCode5.最长回文子... 目录题目链接题目分析解题思路暴力中心向两边拓展搜索 题目链接 链接 题目分析 简单来说࿰...