非等价链路部分设备跑OSPF自动切换SLA测试

简介:

一.概述:
   QQ群里一位网友咨询三个地方通过MSTP专线两两互连,都是思科的设备,但是其中一台不支持OSPF,问如果保证正常情况下,数据走8M线路,但8M链路出现问题时才走4M备份链路,于是用GNS3搭建环境测试了一下,温习一下sla的设置。
二.基本思路:
A.静态路由优先动态OSPF路由,静态路由配置不同的metric值,并且设置SLA
B.备份链路因为能跑动态路由,因此把静态路由重分布到动态路由,这样可以保证三条线路任意一条线路出现故障时都不会影响三个网络的互相访问。
三.测试拓扑:

四.基本配置:
A.R1:

interface Loopback100
ip address 192.168.1.1 255.255.255.0
interface FastEthernet0/0
ip address 12.1.1.1 255.255.255.0
no shut
interface FastEthernet0/1
ip address 13.1.1.1 255.255.255.0
no shut
B.R2:
interface Loopback0
ip address 2.2.2.2 255.255.255.0
interface Loopback100
ip address 192.168.2.2 255.255.255.0
ip ospf network point-to-point
interface FastEthernet0/0
ip address 12.1.1.2 255.255.255.0
no shut
interface FastEthernet0/1
ip address 23.1.1.2 255.255.255.0
no shut
C.R3:
interface Loopback0
ip address 3.3.3.3 255.255.255.0
interface Loopback100
ip address 192.168.3.3 255.255.255.0
ip ospf network point-to-point
interface FastEthernet0/0
ip address 13.1.1.3 255.255.255.0
no shut     
interface FastEthernet0/1
ip address 23.1.1.3 255.255.255.0
no shut
五.静态路由配置:
A.R1:

ip route 192.168.2.0 255.255.255.0 12.1.1.2
ip route 192.168.2.0 255.255.255.0 13.1.1.3 10
ip route 192.168.3.0 255.255.255.0 13.1.1.3
ip route 192.168.3.0 255.255.255.0 12.1.1.2 10
----配置两条不同metric的路由,优先选择metric小的条目

----目标网络是相邻设备的直连网络,可以不用配置SLA,当直连线路出现故障时会自动选择metric大的那条路由。
B.R2:
ip route 192.168.1.0 255.255.255.0 12.1.1.1 (静态路由优先动态路由

C.R3:
ip route 192.168.1.0 255.255.255.0 13.1.1.1  静态路由优先动态路由
六.SLA及静态路由
A.R2:
ip sla 1
icmp-echo 13.1.1.1 source-interface FastEthernet0/0
frequency 10
ip sla schedule 1 life forever start-time now
track 1 rtr 1 reachability
ip route 192.168.3.0 255.255.255.0 12.1.1.1 track 1
ip route 13.1.1.1 255.255.255.255 12.1.1.1 tag 10
----配置主机路由是为了进行track,主机路由打tag是为了后面OSPF重分布时方便过滤

----选择的是绕行线路,需要配置监控,监控绕行的非直连链路上面的IP

B.R3:
ip sla 1
icmp-echo 12.1.1.1 source-interface FastEthernet0/0
frequency 10
ip sla schedule 1 life forever start-time now
track 1 rtr 1 reachability
ip route 12.1.1.1 255.255.255.255 13.1.1.1 tag 10
ip route 192.168.2.0 255.255.255.0 13.1.1.1 track 1
----配置主机路由是为了进行track,主机路由打tag是为了后面OSPF重分布时方便过滤

----选择的是绕行线路,需要配置监控,监控绕行的非直连链路上面的IP

七.动态路由OSPF配置:
A.R2:
route-map static deny 10
match tag 10
route-map static permit 20
router ospf 1
router-id 2.2.2.2
redistribute static subnets route-map static
passive-interface default
no passive-interface FastEthernet0/1
network 23.1.1.0 0.0.0.255 area 0
network 192.168.2.0 0.0.0.255 area 0
B.R3:
route-map static deny 10
match tag 10
route-map static permit 20
router ospf 1
router-id 3.3.3.3
redistribute static subnets route-map static
passive-interface default
no passive-interface FastEthernet0/1
network 23.1.1.0 0.0.0.255 area 0
network 192.168.3.0 0.0.0.255 area 0
八.测试:

A.正常情况下测试

----测试结果:所有流量都走两条8M的线路

①R1上traceroute

----R1去R2和R3身后网络,都走直连8M线路

R1#traceroute 192.168.2.2 source 192.168.1.1

Type escape sequence to abort.
Tracing the route to 192.168.2.2

 1 12.1.1.2 100 msec *  68 msec
R1#traceroute 192.168.3.3 source 192.168.1.1

Type escape sequence to abort.
Tracing the route to 192.168.3.3

 1 13.1.1.3 76 msec *  108 msec
②R2上traceroute

----R2去R3身后网络,从R1绕行,选择两跳都为8M的线路
R2#traceroute 192.168.1.1 source 192.168.2.2

Type escape sequence to abort.
Tracing the route to 192.168.1.1

 1 12.1.1.1 108 msec *  60 msec
R2#traceroute 192.168.3.3 source 192.168.2.2

Type escape sequence to abort.
Tracing the route to 192.168.3.3

 1 12.1.1.1 120 msec 92 msec 64 msec
 2 13.1.1.3 108 msec *  96 msec
③R3上traceroute

----R3去R2身后网络,从R1绕行,选择两跳都为8M的线路
R3#traceroute 192.168.1.1 source 192.168.3.3

Type escape sequence to abort.
Tracing the route to 192.168.1.1

 1 13.1.1.1 92 msec *  80 msec
R3#traceroute 192.168.2.2 source 192.168.3.3

Type escape sequence to abort.
Tracing the route to 192.168.2.2

 1 13.1.1.1 76 msec 80 msec 24 msec
 2 12.1.1.2 176 msec *  108 msec

B.R1和R3之间的8M链路出现故障:

----在GNS中必须把相连的两个接口都shutdown,实际情况只要链路出现故障,应该两个设备都能检测的到。

①R1上traceroute

----R1去R3身后网络,自动走R2绕行

R1#traceroute 192.168.2.2 source 192.168.1.1

Type escape sequence to abort.
Tracing the route to 192.168.2.2

 1 12.1.1.2 92 msec *  64 msec
R1#traceroute 192.168.3.3 source 192.168.1.1

Type escape sequence to abort.
Tracing the route to 192.168.3.3

 1 12.1.1.2 100 msec 80 msec 44 msec
 2 23.1.1.3 96 msec *  108 msec
②R2上traceroute

----R2去R1和R3身后网络,都走直连
R2#traceroute 192.168.1.1 source 192.168.2.2

Type escape sequence to abort.
Tracing the route to 192.168.1.1

 1 12.1.1.1 60 msec *  128 msec
R2#traceroute 192.168.3.3 source 192.168.2.2

Type escape sequence to abort.
Tracing the route to 192.168.3.3

 1 23.1.1.3 120 msec *  112 msec
③R3上traceroute

----R3去R1身后网络,自动走R2绕行
R3#traceroute 192.168.1.1 source 192.168.3.3

Type escape sequence to abort.
Tracing the route to 192.168.1.1

 1 23.1.1.2 100 msec 92 msec 68 msec
 2 12.1.1.1 84 msec *  112 msec
R3#traceroute 192.168.2.2 source 192.168.3.3

Type escape sequence to abort.
Tracing the route to 192.168.2.2

 1 23.1.1.2 120 msec *  80 msec
C.R1和R3之间的8M链路恢复,但R1和R2之间的8M链路出现故障:
①R1上traceroute

----R1去R2身后网络,自动走R3

R1#traceroute 192.168.2.2 source 192.168.1.1

Type escape sequence to abort.
Tracing the route to 192.168.2.2

 1 13.1.1.3 52 msec 88 msec 44 msec
 2 23.1.1.2 88 msec *  132 msec
R1#traceroute 192.168.3.3 source 192.168.1.1

Type escape sequence to abort.
Tracing the route to 192.168.3.3

 1 13.1.1.3 132 msec *  92 msec
②R2上traceroute

----R2去R1身后网络,自动走R3
R2#traceroute 192.168.1.1 source 192.168.2.2

Type escape sequence to abort.
Tracing the route to 192.168.1.1

 1 23.1.1.3 68 msec 112 msec 64 msec
 2 13.1.1.1 80 msec *  116 msec
R2#traceroute 192.168.3.3 source 192.168.2.2

Type escape sequence to abort.
Tracing the route to 192.168.3.3

 1 23.1.1.3 112 msec *  140 msec
③R3上traceroute

----R3去R1和R2身后网络,都走直连
R3#traceroute 192.168.1.1 source 192.168.3.3

Type escape sequence to abort.
Tracing the route to 192.168.1.1

 1 13.1.1.1 92 msec *  * 
R3#traceroute 192.168.2.2 source 192.168.3.3  

Type escape sequence to abort.
Tracing the route to 192.168.2.2

 1 23.1.1.2 84 msec *  116 msec




本文转自 碧云天 51CTO博客,原文链接:http://blog.51cto.com/333234/1231044,如需转载请自行联系原作者

相关文章
|
6月前
|
人工智能 数据可视化 测试技术
AI测试平台自动遍历:低代码也能玩转全链路测试
AI测试平台的自动遍历功能,通过低代码配置实现Web和App的自动化测试。用户只需提供入口链接或安装包及简单配置,即可自动完成页面结构识别、操作验证,并生成可视化报告,大幅提升测试效率,特别适用于高频迭代项目。
|
11月前
|
监控 测试技术 数据库连接
RunnerGo API 性能测试实战:从问题到解决的全链路剖析
API性能测试是保障软件系统稳定性与用户体验的关键环节。本文详细探讨了使用RunnerGo全栈测试平台进行API性能测试的全流程,涵盖测试计划创建、场景设计、执行分析及优化改进。通过电商平台促销活动的实际案例,展示了如何设置测试目标、选择压测模式并分析结果。针对发现的性能瓶颈,提出了代码优化、数据库调优、服务器资源配置和缓存策略等解决方案。最终,系统性能显著提升,满足高并发需求。持续关注与优化API性能,对系统稳定运行至关重要。
|
7月前
|
人工智能 缓存 监控
大模型性能测试实战指南:从原理到落地的全链路解析
本文系统解析大模型性能测试的核心方法,涵盖流式响应原理、五大关键指标(首Token延迟、吐字率等)及测试策略,提供基于Locust的压测实战方案,并深入性能瓶颈分析与优化技巧。针对多模态新挑战,探讨混合输入测试与资源优化
|
10月前
|
存储 算法 5G
可测多种时间频率信号精度的设备有哪些、标准时钟测试仪、gps时间校验仪
时间频率综合测试仪用于分析时间频率信号的精度与特性,支持多种标准,如B码、NTP、PTP等。其发展趋势包括:1. 高精度化,满足5G等新兴领域需求;2. 智能化,实现自动校准与故障诊断;3. 集成化多功能化,整合多参数测量功能;4. 小型化便携化,便于现场使用;5. 高速实时处理,提升数据处理能力;6. 网络化远程控制,支持远程操作与管理。例如SYN5104型设备,在多项指标上达到高精度,并具备网络接口和自动存储功能。
|
Web App开发 前端开发 安全
前端研发链路之测试
本文由前端徐徐撰写,介绍了前端测试的重要性及其主要类型,包括单元测试、E2E测试、覆盖率测试、安全扫描和自动化测试。文章详细讲解了每种测试的工具和应用场景,并提供了选择合适测试策略的建议,帮助开发者提高代码质量和用户体验。
377 3
前端研发链路之测试
|
Web App开发 定位技术 iOS开发
Playwright 是一个强大的工具,用于在各种浏览器上测试应用,并模拟真实设备如手机和平板。通过配置 `playwright.devices`,可以轻松模拟不同设备的用户代理、屏幕尺寸、视口等特性。此外,Playwright 还支持模拟地理位置、区域设置、时区、权限(如通知)和配色方案,使测试更加全面和真实。例如,可以在配置文件中设置全局的区域设置和时区,然后在特定测试中进行覆盖。同时,还可以动态更改地理位置和媒体类型,以适应不同的测试需求。
Playwright 是一个强大的工具,用于在各种浏览器上测试应用,并模拟真实设备如手机和平板。通过配置 `playwright.devices`,可以轻松模拟不同设备的用户代理、屏幕尺寸、视口等特性。此外,Playwright 还支持模拟地理位置、区域设置、时区、权限(如通知)和配色方案,使测试更加全面和真实。例如,可以在配置文件中设置全局的区域设置和时区,然后在特定测试中进行覆盖。同时,还可以动态更改地理位置和媒体类型,以适应不同的测试需求。
1201 1
|
测试技术 Linux Android开发
i2c总线及设备测试工具i2ctools:i2cdetect、i2cdump、i2cget、i2cset
本文介绍了i2ctools工具集的使用,包括i2cdetect、i2cdump、i2cget和i2cset,这些工具有助于I2C设备的开发和调试,通过检测设备、读写寄存器和数据块来提高开发效率。
4316 1
|
Java 测试技术
SpringBoot单元测试快速写法问题之区分链路环节是否应该被Mock如何解决
SpringBoot单元测试快速写法问题之区分链路环节是否应该被Mock如何解决
|
Java 测试技术 API
SpringBoot单元测试快速写法问题之确定链路上的Mock点如何解决
SpringBoot单元测试快速写法问题之确定链路上的Mock点如何解决
|
测试技术 索引 CDN
hyengine wasm业务性能测试问题之测试设备如何解决
hyengine wasm业务性能测试问题之测试设备如何解决
116 0