11.4 OSPF在帧中继网络中的配置
原理概述
OSPF将网络分为4种不同的类型,即Point-to-Point、Broadcast、NBMA 及Point-to-MultiPoint,不同网络类型下OSPF的工作制不一样。比如在Broadcast网络中,OSPF能够直接建立邻居邻接关系;在NBMA网络中默认必须手工指定邻居等。在实际网络中,可通过配置接口的网络类型来强制改变默认的接口的网络类型。在帧中继的环境中,OSPF默认的网络类型是NBMA。
实验目的
- 掌握OSPF在帧中继网络中的配置方法
- 理解Hub-Spoke组网架构
- 掌握在帧中继网络中排除OSPF故障的方法
场景
某公司网络使用OSPF协议,该公司由一个总部和两个分支机构组成。R1为总部路由器,R2和R3分别是两个分支机构的出口路由。两个分支机构都是通过租用运营商的帧中继虚电路来与总部通信的。但为了节省成本,两个分支机构之间没有直接互联的虚电路,即典型的Hub-Spoke组网架构,R1称为Hub端设备,R2、R3为Spoke端设备。
实验编址
设备 | 接口 | IP地址 | 子网掩码 | 默认网关 | DLCI |
R1 | Loopback 0 | 10.1.1.1 | 255.255.255.255 | N/A | N/A |
Serial 1/0/0 | 10.0.123.1 | 255.255.255.0 | N/A | 102/103 | |
R2 | Loopback 0 | 10.1.2.2 | 255.255.255.255 | N/A | N/A |
Serial 1/0/0 | 10.0.123.2 | 255.255.255.0 | N/A | 201 | |
R3 | Loopback 0 | 10.1.3.3 | 255.255.255.255 | N/A | N/A |
Serial 1/0/0 | 10.0.123.3 | 255.255.255.0 | N/A |
301 |
实验拓扑
实验步骤
1.基本配置
在公司总部路由器R1和两个分部的路由器R2、R3上配置帧中继接口,关闭帧中继逆向地址解析功能。
首先根据实验编址表进行相应的基本IP地址配置,并配置帧中继静态地址映射。环回接口掩码为32位,用来模拟公司总部和分部的主机。注意:将R1设置位DR,调整其DR优先级为100.
[R1]int loopback 0
[R1-LoopBack0]ip add 10.1.1.1 32
[R1-LoopBack0]int s1/0/0
[R1-Serial1/0/0]ip add 10.0.123.1 24
[R1-Serial1/0/0]link-protocol fr
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]:y
[R1-Serial1/0/0]undo fr inarp
[R1-Serial1/0/0]fr map ip 10.0.123.2 102
[R1-Serial1/0/0]fr map ip 10.0.123.3 103
[R1-Serial1/0/0]ospf dr-priority 100
[R2]int loopback 0
[R2-LoopBack0]ip add 10.1.2.2 32
[R2-LoopBack0]int s1/0/0
[R2-Serial1/0/0]ip add 10.0.123.2 24
[R2-Serial1/0/0]link-protocol fr
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]:y
[R2-Serial1/0/0]undo fr inarp
[R2-Serial1/0/0]fr map ip 10.0.123.1 201
[R3]int loopback 0
[R3-LoopBack0]ip add 10.1.3.3 32
[R3-LoopBack0]int s1/0/0
[R3-Serial1/0/0]ip add 10.0.123.3 24
[R3-Serial1/0/0]link-protocol fr
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]:y
[R3-Serial1/0/0]undo fr inarp
[R3-Serial1/0/0]fr map ip 10.0.123.1 301
配置完成后,检查帧中继的虚电路状态和映射表。
<R1>dis fr pvc-info
PVC statistics for interface Serial1/0/0 (DTE, physical UP)
DLCI = 102, USAGE = LOCAL (00000100), Serial1/0/0
create time = 2021/11/17 16:05:05, status = ACTIVE
InARP = Disable, PVC-GROUP = NONE
in packets = 0, in bytes = 0
out packets = 0, out bytes = 0
DLCI = 103, USAGE = LOCAL (00000100), Serial1/0/0
create time = 2021/11/17 16:05:05, status = ACTIVE
InARP = Disable, PVC-GROUP = NONE
in packets = 0, in bytes = 0
out packets = 0, out bytes = 0
可以观察到,PVC处于ACTIVE状态表示正常。
<R1>dis fr map-info
Map Statistics for interface Serial1/0/0 (DTE)
DLCI = 102, IP 10.0.123.2, Serial1/0/0
create time = 2021/11/17 16:05:05, status = ACTIVE
encapsulation = ietf, vlink = 1
DLCI = 103, IP 10.0.123.3, Serial1/0/0
create time = 2021/11/17 16:05:05, status = ACTIVE
encapsulation = ietf, vlink = 2
检查R1与R2,R1与R3之间的网络连通性。
<R1>ping 10.0.123.2
PING 10.0.123.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.123.2: bytes=56 Sequence=1 ttl=255 time=50 ms
Reply from 10.0.123.2: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 10.0.123.2: bytes=56 Sequence=3 ttl=255 time=20 ms
Reply from 10.0.123.2: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 10.0.123.2: bytes=56 Sequence=5 ttl=255 time=20 ms
<R1>ping 10.0.123.3
PING 10.0.123.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.123.3: bytes=56 Sequence=1 ttl=255 time=40 ms
Reply from 10.0.123.3: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 10.0.123.3: bytes=56 Sequence=3 ttl=255 time=20 ms
Reply from 10.0.123.3: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 10.0.123.3: bytes=56 Sequence=5 ttl=255 time=20 ms
此时通行正常。
2.在帧中继上搭建OSPF网络
在R1、R2和R3上配置OSPF协议。采用OSPF单区域配置,指定各自的环回接口地址为Router-ID,所有网段都属于区域0。
[R1]ospf 1 router-id 10.1.1.1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 10.0.123.1 0.0.0.255
[R1-ospf-1-area-0.0.0.0]network 10.1.1.1 0.0.0.0
[R2]ospf 1 router-id 10.1.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 10.0.123.2 0.0.0.255
[R2-ospf-1-area-0.0.0.0]network 10.1.2.2 0.0.0.0
[R3]ospf 1 router-id 10.1.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 10.0.123.3 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 10.1.3.3 0.0.0.0
配置完成后,查看OSPF邻居建立情况。
<R1>dis ospf peer
OSPF Process 1 with Router ID 10.1.1.1
发现无法正常建立邻居,这是明显网络故障,现在需要立刻进行分析排除故障。排障时需注意遵从从底层逐步往上层排查的顺序,即先检查物理层线路是否正常,然后检查二层链路的连通性,再检查三层路由协议的运行情况,最后检查高层相关应用是否正常。
测试直连线路的连通性。
<R1>ping 10.0.123.2
PING 10.0.123.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.123.2: bytes=56 Sequence=1 ttl=255 time=30 ms
Reply from 10.0.123.2: bytes=56 Sequence=2 ttl=255 time=30 ms
Reply from 10.0.123.2: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 10.0.123.2: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 10.0.123.2: bytes=56 Sequence=5 ttl=255 time=20 ms
<R1>ping 10.0.123.3
PING 10.0.123.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.123.3: bytes=56 Sequence=1 ttl=255 time=30 ms
Reply from 10.0.123.3: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 10.0.123.3: bytes=56 Sequence=3 ttl=255 time=20 ms
Reply from 10.0.123.3: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 10.0.123.3: bytes=56 Sequence=5 ttl=255 time=20 ms
直连链路连通性没有问题。再查看三层路由协议,即相应接口是否被通告到OSPF进程中。
<R1>dis ospf int
OSPF Process 1 with Router ID 10.1.1.1
Interfaces
Area: 0.0.0.0 (MPLS TE not enabled)
IP Address Type State Cost Pri DR BDR
10.1.1.1 P2P P-2-P 0 1 0.0.0.0 0.0.0.0
10.0.123.1 NBMA DR 48 100 10.0.123.1 0.0.0.0
观察到,所有接口已经被通告进入OSPF进程。
此时可以对R1的S1/0/0接口进行抓包分析,产看协议的运行情况。
发现R1始终没有向外发送OSPF数据包。这是由于OSPF在帧中继上默认的网络类型为NBMA,即非广播多路访问。这种网络类型的特定是不支持广播和组播的数据包,而OSPF协议默认是采用组播方式发送报文,所以设备的OSPF报文无法在帧中继链路上进行发送,导致没有成功建立邻居关系。
这时可采用peer命令手工指定OSPF邻居,才用单播方式发送报文。
[R1]ospf 1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]peer 10.0.123.2
[R1-ospf-1]peer 10.0.123.3
[R2]ospf 1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]peer 10.0.123.1
[R3]ospf 1
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]peer 10.0.123.1
配置完成后,再次检查OSPF的邻居关系状态。
<R1>dis ospf p b
OSPF Process 1 with Router ID 10.1.1.1
Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.0 Serial1/0/0 10.1.2.2 Full
0.0.0.0 Serial1/0/0 10.1.3.3 Full
----------------------------------------------------------------------------
可以观察到,这时R1与R2、R3都建立了完全的邻接关系。再查看R1、R2、R3的路由表。
<R1>dis ip routing protocol ospf
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 2 Routes : 2
OSPF routing table status : <Active>
Destinations : 2 Routes : 2
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.1.2.2/32 OSPF 10 48 D 10.0.123.2 Serial1/0/0
10.1.3.3/32 OSPF 10 48 D 10.0.123.3 Serial1/0/0
OSPF routing table status : <Inactive>
Destinations : 0 Routes : 0
<R2>dis ip routing protocol ospf
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 2 Routes : 2
OSPF routing table status : <Active>
Destinations : 2 Routes : 2
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.1.1.1/32 OSPF 10 48 D 10.0.123.1 Serial1/0/0
10.1.3.3/32 OSPF 10 48 D 10.0.123.3 Serial1/0/0
OSPF routing table status : <Inactive>
Destinations : 0 Routes : 0
<R3>dis ip routing protocol ospf
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 2 Routes : 2
OSPF routing table status : <Active>
Destinations : 2 Routes : 2
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.1.1.1/32 OSPF 10 48 D 10.0.123.1 Serial1/0/0
10.1.2.2/32 OSPF 10 48 D 10.0.123.2 Serial1/0/0
OSPF routing table status : <Inactive>
Destinations : 0 Routes : 0
可以观察到此时的R1、R2、R3路由表中都互相接收到了各自环回口所在网段的路由条目。测试环回口之间的连通性。
<R1>ping 10.1.2.2
PING 10.1.2.2: 56 data bytes, press CTRL_C to break
Reply from 10.1.2.2: bytes=56 Sequence=1 ttl=255 time=20 ms
Reply from 10.1.2.2: bytes=56 Sequence=2 ttl=255 time=10 ms
Reply from 10.1.2.2: bytes=56 Sequence=3 ttl=255 time=10 ms
Reply from 10.1.2.2: bytes=56 Sequence=4 ttl=255 time=10 ms
Reply from 10.1.2.2: bytes=56 Sequence=5 ttl=255 time=10 ms
......
<R1>ping 10.1.3.3
PING 10.1.3.3: 56 data bytes, press CTRL_C to break
Reply from 10.1.3.3: bytes=56 Sequence=1 ttl=255 time=30 ms
Reply from 10.1.3.3: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 10.1.3.3: bytes=56 Sequence=3 ttl=255 time=20 ms
Reply from 10.1.3.3: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 10.1.3.3: bytes=56 Sequence=5 ttl=255 time=20 ms
此时,R1与R2,R1与R3之间的环回口通信正常。再次测试R2与R3环回口之间的通行情况。
<R2>ping 10.1.3.3
PING 10.1.3.3: 56 data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out
发现R2无法连通R3的环回口,再次进行排障。物理链路和二层链路的连通性测试省略。首先查看R2的OSPF路由条目,观察到去往10.1.3.3的网段下一跳地址是10.0.123.3。
<R2>dis ip routing protocol ospf
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 2 Routes : 2
OSPF routing table status : <Active>
Destinations : 2 Routes : 2
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.1.1.1/32 OSPF 10 48 D 10.0.123.1 Serial1/0/0
10.1.3.3/32 OSPF 10 48 D 10.0.123.3 Serial1/0/0
OSPF routing table status : <Inactive>
Destinations : 0 Routes : 0
然后在R2上查看帧中继映射关系。
<R2>dis fr map-info
Map Statistics for interface Serial1/0/0 (DTE)
DLCI = 201, IP 10.0.123.1, Serial1/0/0
create time = 2021/11/17 16:05:09, status = ACTIVE
encapsulation = ietf, vlink = 1
可以观察到,此时没有关于10.0.123.3的映射,如果R2要发送数据包至下一跳10.0.123.3,但无法知晓该从哪条PVC上进行发送和封装,可以使用PVC复用技术解决此问题。这时需要在R2的S1/0/0接口下添加一条帧中继静态映射,通过R1与R2的PVC去往10.0.123.3。
[R2]int s1/0/0
[R2-Serial1/0/0]fr map ip 10.0.123.3 201
在R3上也添加关于10.0.123.2的相关映射。
[R3]int s1/0/0
[R3-Serial1/0/0]fr map ip 10.0.123.2 301
配置完成后,再在R2上查看帧中继映射关系。
<R2>dis fr map-info
Map Statistics for interface Serial1/0/0 (DTE)
DLCI = 201, IP 10.0.123.1, Serial1/0/0
create time = 2021/11/17 16:05:09, status = ACTIVE
encapsulation = ietf, vlink = 1
DLCI = 201, IP 10.0.123.3, Serial1/0/0
create time = 2021/11/17 16:56:50, status = ACTIVE
encapsulation = ietf, vlink = 2
此时已经添加上相关映射,再次测试R2与R3环回口的连通性。
<R2>ping 10.1.3.3
PING 10.1.3.3: 56 data bytes, press CTRL_C to break
Reply from 10.1.3.3: bytes=56 Sequence=1 ttl=254 time=30 ms
Reply from 10.1.3.3: bytes=56 Sequence=2 ttl=254 time=30 ms
Reply from 10.1.3.3: bytes=56 Sequence=3 ttl=254 time=30 ms
Reply from 10.1.3.3: bytes=56 Sequence=4 ttl=254 time=30 ms
Reply from 10.1.3.3: bytes=56 Sequence=5 ttl=254 time=20 ms
此时通信正常。
11.4 OSPF在帧中继网络中的配置相关推荐
- ospf在NBMA网络中的配置
1. R6为ISP只能配置ip地址,R1-5的环回为私有网段 2. R1/4/5为全连的MGRE结构,R1/2/3为星型的拓扑结构,R1为中心站点 3.所有私有网段可以互相通讯,私有网段使用OSPF协 ...
- OSPF在NBMA网络中的五种模式
帧中继网络中,可以使用多种OSPF配置,具体使用哪种取决于网络拓扑,下面是一些帧中继的拓扑类型: • 星形拓扑 又称为中央-分支拓扑,是最常用的拓扑类型,在这种拓扑中,远程站点与中央站点相连.星形拓扑 ...
- Ospf在广播网络中建立邻居关系的详细过程
Ospf 在广播网络中建立邻居关系的详细过程 目的:观察在广播网络中,OSPF建立邻接关系的过程 拓扑及设备需求 拓扑: 图片1 设备需求:3台路由器,ios版本为12.2 需求:配置3台路由器的以太 ...
- ospf在NBMA网络中的实验(保姆级别)
拓扑设计 具体拓扑图(因为从图来看需要创建两个虚拟接口所以需要R1与R6之间连两根线) 第一步:配置ip地址 R6为公网所以除了环回全部使用公网地址 R1: 其余路由器ip同理(环回在不同网段) 第二 ...
- 【帧中继网络运行OSPF的解决办法】
帧中继网络运行OSPF的解决办法 1.实验拓扑: 该图四个路由器,左边运行以太网,右边串行链路,基本ip配置和ospf运行宣告,以及每个路由器都有环回接口 2.实验需求: 我们都知道,帧中继直接运行o ...
- 在NBMA网络中配置OSPF
在NBMA网络中配置OSPF 在NBMA网络中配置OSPF协议和调整属性,可以灵活组建OSPF网络. 文章目录 在NBMA网络中配置OSPF 一.应用环境 二.前置任务 三.配置NBMA 1.修改OS ...
- OSPF网络中两端设备网络类型不一致所带来的故障现象
[前言] 众所周知,两台运行OSPF的路由器如果将一端的网络类型保持广播类型不变,另一端的网络类型设置为P2P,那么两台路由器的邻居关系仍旧会建立(进入Full状态).然而这样的结果在一定程度上会使得 ...
- 计算机网络实验(华为eNSP模拟器)——第十一章 帧中继网络
目录 一.帧中继网络的定义 二.实验步骤 结语 一.帧中继网络的定义 帧中继网络是一种数据包交换通信网络,它可以在一对一或者一对多的应用中快速而低廉地传输数字信息,是面向连接在物理连接上实现逻辑复用的 ...
- 路由器连接帧中继网络的接口是(11),连接双绞线以太网的接口是(12)。 【答案】D B
路由器连接帧中继网络的接口是(11),连接双绞线以太网的接口是(12). (11)A.AUI接口 B.RJ-45接口 C.Console接口 D.Serial接口 (12)A.AUI接口 B.RJ-4 ...
最新文章
- 如何进行高效的时间管理?
- LeetCode 508. Most Frequent Subtree Sum
- 星跃计划 | 新项目持续招募中!MSR Asia-MSR Redmond 联合科研计划邀你申请!
- hibernate 序列_Hibernate身份,序列和表(序列)生成器
- 英语笔记:词组句子:0906
- phpcmsV9留言板 - 提交后提示页UI自定义效果
- 正则表达式30分钟入门教程-2
- 2151: 种树 - BZOJ
- 错误与异常_2-7选择题
- 【UI】NGUI和UGUI
- asp.net门诊收费管理系统
- android页面监听扫描枪,Android监听扫描枪内容(二)
- Java工程师历年企业笔试真题汇总
- Python爬虫介绍
- 使用echarts生成海友网企业全国分布地图
- 【计算机网络】路由器和交换机的基本配置
- 但总觉得明白了一点点什么
- 小程序报错修改Expecting 'STRING','NUMBER'
- orb_slam3实现保存/加载地图功能and发布位姿功能
- 汇编语言第七章循环程序
热门文章
- 【教学类-12-03】20221106《连连看横版8*4(2套题目 适合中班))(中班主题《我们的城市》)
- 刀切水果(平面和空间切割问题)
- MyCobot六轴机械臂的基本操作(二)
- 爱因斯坦问题(原创)
- NLP入门(九)词义消岐(WSD)的简介与实现
- ChinaJoy“美”不胜收之外的一些个人记录-工具篇SoftImage
- scipy连续小波变换
- 【C++】头文件 bits/stdc++.h 是啥?
- 在线查询解析邮件接收的邮件
- 酒店订房系统怎么做_酒店民宿预订系统有哪些功能