路由与交换系列之OSPF在帧中继的配置实践

简介: 掌握OSPF在帧中继网络中的配置方法理解Hub- Spoke组网架构掌握在帧中继网络中排除OSPF故障的方法


【实验目的】

掌握OSPF在帧中继网络中的配置方法

理解Hub- Spoke组网架构

掌握在帧中继网络中排除OSPF故障的方法


【实验环境】


IP地址规划表

设备

接口

IP地址

子网掩码

R1

S0/0/0

10.45.123.1

255.255.255.0

E0/0/0

10.45.1.1

255.255.255.0

R2

S0/0/1

10.45.123.2

255.255.255.0

E0/0/0

10.45.2.1

255.255.255.0

R3

S0/0/2

10.45.123.3

255.255.255.0

E0/0/0

10.45.3.1

255.255.255.0

PC1

E0/0/1

10.45.1.10

255.255.255.0

PC2

E0/0/1

10.45.2.10

255.255.255.0

PC3

E0/0/1

10.45.3.10

255.255.255.0


【实验过程】

27.1基本配置

在R1、R2、R3上配置帧帧中继接口,关闭帧中继逆向地址解析功能,其中将R1设置为DR,DR优先级为100:

AR1

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys AR1
[AR1]link-protocol fr ietf
[AR1]int s0/0/0
[AR1-Serial0/0/0]link-protocol fr ietf
Warning: The encapsulation protocol of the link will be changed.
Continue? [Y/N]:y
[AR1-Serial0/0/0]ip add 10.45.123.1 24
[AR1-Serial0/0/0]undo fr inarp
[AR1-Serial0/0/0]fr map ip 10.45.123.2 102
[AR1-Serial0/0/0]fr map ip 10.45.123.3 103
[AR1-Serial0/0/0]ospf dr-priority 100
[AR1-Serial0/0/0]q
[AR1]int e0/0/0
[AR1-Ethernet0/0/0]ip add 10.45.1.1 24
[AR1-Ethernet0/0/0]q


AR2

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys AR2
[AR2]int s0/0/1
[AR2-Serial0/0/1]link-protocol fr ietf
Warning: The encapsulation protocol of the link will be changed.
Continue? [Y/N]:y
[AR2-Serial0/0/1]ip add 10.45.123.2 24
[AR2-Serial0/0/1]undo fr inarp
[AR2-Serial0/0/1]fr map ip 10.45.123.1 201
[AR2-Serial0/0/1]q
[AR2]int e0/0/0
[AR2-Ethernet0/0/0]ip add 10.45.2.1 24
[AR2-Ethernet0/0/0]q


AR3

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys AR3
[AR3]int s0/0/2
[AR3-Serial0/0/2]link-protocol fr ietf
Warning: The encapsulation protocol of the link will be changed.
Continue? [Y/N]:y
[AR3-Serial0/0/2]ip add 10.45.123.3 24
[AR3-Serial0/0/2]undo fr inarp
[AR3-Serial0/0/2]fr map ip 10.45.123.1 301
[AR3-Serial0/0/2]q
[AR3]int e0/0/0
[AR3-Ethernet0/0/0]ip add 10.45.3.1 24
[AR3-Ethernet0/0/0]q


27.2查看帧中继的虚电路和映射表

[AR1]dis fr pvc-info
PVC statistics for interface Serial0/0/0 (DTE, physical UP)
DLCI = 102, USAGE = LOCAL (00000100), Serial0/0/0
create time = 2020/11/21 18:45:33, status = ACTIVE
InARP = Disable
in BECN = 0, in FECN = 0
in packets = 0, in bytes = 0
out packets = 1, out bytes = 30
DLCI = 103, USAGE = LOCAL (00000100), Serial0/0/0
create time = 2020/11/21 18:45:33, status = ACTIVE
InARP = Disable
in BECN = 0, in FECN = 0
in packets = 0, in bytes = 0
out packets = 1, out bytes = 30
[AR1]dis fr map-info
Map Statistics for interface Serial0/0/0 (DTE)
DLCI = 102, IP 10.45.123.2, Serial0/0/0
create time = 2020/11/21 18:45:59, status = ACTIVE
encapsulation = ietf, vlink = 3
DLCI = 103, IP 10.45.123.3, Serial0/0/0
create time = 2020/11/21 18:46:00, status = ACTIVE
encapsulation = ietf, vlink = 4

27.3测试连通性

R1和R2的连通性

R1和R2的连通性

27.4在帧中继上搭建OSPF网络

AR1

[AR1]ospf router-id 10.45.1.10
[AR1-ospf-1]area 0
[AR1-ospf-1-area-0.0.0.0]net 10.45.123.1 0.0.0.255
[AR1-ospf-1-area-0.0.0.0]net 10.45.1.10 0.0.0.255
[AR1-ospf-1-area-0.0.0.0]q
[AR1-ospf-1]q



AR2

[AR2]ospf router-id 10.45.2.10
[AR2-ospf-1]area 0
[AR2-ospf-1-area-0.0.0.0]net 10.45.123.2 0.0.0.255
[AR2-ospf-1-area-0.0.0.0]net 10.45.2.10 0.0.0.255
[AR2-ospf-1-area-0.0.0.0]q
[AR2-ospf-1]q


AR3

[AR3]ospf router-id 10.45.3.10
[AR3-ospf-1]area 0
[AR3-ospf-1-area-0.0.0.0]net 10.45.123.2 0.0.0.255
[AR3-ospf-1-area-0.0.0.0]net 10.45.3.10 0.0.0.255
[AR3-ospf-1-area-0.0.0.0]q
[AR3-ospf-1]q


27.5查看R1的邻居

[AR1]dis ospf peer
OSPF Process 1 with Router ID 10.45.1.1

发现无法正常建立邻居,这是明显的网络故障。于是我们来排查故障,排查故障时应遵循底层逐步向上层的顺序,即先检查物理层,然后二层链路层,之后高层。

物理层的检查这里省略,直接测试连通性:

[AR1]ping 10.45.123.2
PING 10.45.123.2: 56 data bytes, press CTRL_C to break
Reply from 10.45.123.2: bytes=56 Sequence=1 ttl=255 time=70 ms
Reply from 10.45.123.2: bytes=56 Sequence=2 ttl=255 time=10 ms
Reply from 10.45.123.2: bytes=56 Sequence=3 ttl=255 time=10 ms
Reply from 10.45.123.2: bytes=56 Sequence=4 ttl=255 time=110 ms
Reply from 10.45.123.2: bytes=56 Sequence=5 ttl=255 time=40 ms
--- 10.45.123.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/48/110 ms

可以观察到,直连链路没有问题,我们来检查三层路由协议,即相应接口是否被通告到OSPF进程中。

[AR1]display ospf interface
OSPF Process 1 with Router ID 10.45.1.10
Interfaces
Area: 0.0.0.0 (MPLS TE not enabled)
IP Address Type State Cost Pri DR BDR
10.45.123.1 NBMA DR 1562 100 10.45.123.1 0.0.0.0
10.45.1.1 P2P P-2-P 0 1 10.45.1.1 0.0.0.0


发现R1始终没有向外发送OSPF报文,这是因为OSPF在帧中继上默认的网络类型为NBMA,即非广播多路访问。这种类型是不支持广播和组播的,而OSPF默认时组播发送,故OSPF无法在帧中继中发送报文,无法建立邻居关系。

可以采取手工配置邻居,单播发送报文。

27.6手工配置邻居

AR1

[AR1]ospf
[AR1-ospf-1]peer 10.45.123.2
[AR1-ospf-1]peer 10.45.123.3
[AR1-ospf-1]q

AR2

[AR2]ospf
[AR2-ospf-1]peer 10.45.123.1
[AR2-ospf-1]peer 10.45.123.3
[AR2-ospf-1]q


AR3

[AR3]ospf
[AR3-ospf-1]peer 10.45.123.1
[AR3-ospf-1]peer 10.45.123.2
[AR3-ospf-1]q


查看R1的邻居关系

可以看到,邻居关系已经建立成功。

27.7配置PVC复用技术

[AR2-Serial0/0/1]fr map ip 10.45.123.3 201
[AR3-Serial0/0/2]fr map ip 10.45.123.2 301

 

27.8测试R2和R3的的连通性

PC>ping 10.45.123.3
Ping 10.45.123.3: 32 data bytes, Press Ctrl_C to break
From 10.45.123.3: bytes=32 seq=1 ttl=255 time=109 ms
From 10.45.123.3: bytes=32 seq=2 ttl=255 time=47 ms
From 10.45.123.3: bytes=32 seq=3 ttl=255 time=47 ms
From 10.45.123.3: bytes=32 seq=4 ttl=255 time=31 ms
From 10.45.123.3: bytes=32 seq=5 ttl=255 time=63 ms
--- 10.45.123.3 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 31/59/109 ms


知识点总结

帧中继(frame-ralay)是一种广域网技术,属于分组交换门里的一种;frame-relay是一种二层技术,与具体的物理链路无关。再说说ospf:ospf是一种动态路由协议,用以生成路由表,是众多的路由协议中较为优秀的一种,一般用再大中型企业。路由表是路由器转发数据所依赖的一张表。因此可以说没有路由协议就没有路由表,路由器就不能完成转发数据的重任。

目录
相关文章
计算机毕业设计 图书管理系统 Vue+SpringBoot+MySQL(二)
计算机毕业设计 图书管理系统 Vue+SpringBoot+MySQL
664 2
|
传感器 物联网 开发工具
基于华为物联网云平台设计的智能家居控制系统(STM32+ESP8266)
现在可以接入的物联网云平台非常多,阿里云物联网云平台、OneNet中国移动物联网云平台,还有机智云、涂鸦智能、百度云平台、华为云平台等等。
1761 1
|
JavaScript 内存技术
node与npm版本对应关系以及使用nvm管理node版本
node与npm版本对应关系以及使用nvm管理node版本
9640 0
|
缓存 前端开发
css使用各类样式表
css使用各类样式表
|
Shell Linux 人机交互
shell脚本入门到实战(二)--shell输入和格式化输出
shell脚本入门到实战(二)--shell输入和格式化输出
1004 0
|
12月前
|
数据采集 人工智能 监控
数据治理系统对企业的应用价值 大型企业治理与系统建设方法论
数据治理正从合规驱动迈向价值驱动,呈现平台化、智能化、业务融合三大趋势。企业需构建“平台+流程+组织”三位一体体系,分阶段推进治理落地。选型应结合云生态、多云需求与资产化目标,以业务价值衡量成效,实现数据从成本中心向价值引擎转变。
|
Linux 虚拟化 iOS开发
GNS3 v3.0.5 - 开源免费网络模拟器
GNS3 v3.0.5 - 开源免费网络模拟器
1696 3
GNS3 v3.0.5 - 开源免费网络模拟器
|
域名解析 监控 网络协议
21.7K star!再见吧花生壳,没有公网ip,也能搞定所有网络访问!内网穿透神器NPS
“nps”是一款强大的内网穿透工具,支持多种协议与功能。它无需公网IP或复杂配置,可实现远程桌面、文件共享和私有云搭建等。项目采用Go语言开发,具有高性能与轻量级特点,适用于远程办公、物联网管理等场景。其核心亮点包括零配置穿透、多级代理网络、实时流量监控及企业级安全特性。对比同类工具,“nps”在安装复杂度、协议支持和管理界面方面表现优异。项目地址:https://github.com/ehang-io/nps。
3412 12
|
监控 负载均衡 网络协议
一文带你浅入浅出Keepalived
一文带你浅入浅出Keepalived
11754 118
|
Ubuntu Linux C语言
Ubuntu安装笔记(二):ubuntu18.04编译安装opencv 3.4.0 opencv_contrib3.4.0
本文介绍了在Ubuntu 18.04系统上编译安装OpenCV 3.4.0及其扩展包opencv_contrib 3.4.0的详细步骤,包括下载源码、安装依赖、配置CMake和编译安装,以及常见问题的解决方法。
1730 1
Ubuntu安装笔记(二):ubuntu18.04编译安装opencv 3.4.0 opencv_contrib3.4.0