当前位置: 首页 > news >正文

OSPF实验-20250922

文章目录

  • 组网需求
  • 组网拓扑
  • 实验步骤
  • 测试结果
  • 配置文件

组网需求

公司网络拓扑如下图所示:OSPF基础配置已经完成,作为网络管理员,有如下几个问题需要解决:

  • 总公司与分公司A、B之间通信正常,但无法与办事处C通信。
  • 分公司A的设备性能较低,希望降低路由计算、存储压力,同时考虑网络扩展,需要保留引入外部路由的功能。
  • 办事处C外来人员较多,采用较安全的方式保证路由交互的安全性。
  • RTA引入外部路由时除了考虑外部开销之外,还需要考虑OSPF域内的开销

组网拓扑

在这里插入图片描述

实验步骤

  1. 配置接口IP、Loopback口IP
  2. 配置OSPF区域、宣告网段(实现区域0、1、2互通)
  3. RTC与RTE建立虚链接(实现区域3与其它区域互通)
  4. 区域1配置为totally nssa(减少LSA泛洪)
  5. RTE与RTF之间采用接口认证(Hello报文认证)
  6. 区域1引用外部路由开销类型为1(总开销=外部开销+域内开销)

测试结果

VPC ping RTF的0/0接口

VPCS> ping 10.1.56.684 bytes from 10.1.56.6 icmp_seq=1 ttl=60 time=32.382 ms
84 bytes from 10.1.56.6 icmp_seq=2 ttl=60 time=3.926 ms
84 bytes from 10.1.56.6 icmp_seq=3 ttl=60 time=5.196 ms
84 bytes from 10.1.56.6 icmp_seq=4 ttl=60 time=6.113 ms
84 bytes from 10.1.56.6 icmp_seq=5 ttl=60 time=4.314 ms

查看RTB路由表,发现外部路由的开销是21,这里已经经过了1跳,N1表示NSSA外部路由类型1

SW2#show ip route Codes:  C - Connected, L - Local, S - StaticR - RIP, O - OSPF, B - BGP, I - IS-IS, V - Overflow routeN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2SU - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2IA - Inter area, EV - BGP EVPN, A - Arp to hostLA - Local aggregate route* - candidate defaultGateway of last resort is no set
C     2.2.2.2/32 is local host. 
C     10.1.24.0/24 is directly connected, GigabitEthernet 0/1
C     10.1.24.2/32 is local host. 
O IA  10.1.35.0/24 [110/2] via 10.1.123.3, 00:59:53, GigabitEthernet 0/0
O IA  10.1.56.0/24 [110/3] via 10.1.123.3, 00:50:33, GigabitEthernet 0/0
C     10.1.123.0/24 is directly connected, GigabitEthernet 0/0
C     10.1.123.2/32 is local host. 
O N1  192.168.10.0/24 [110/21] via 10.1.24.4, 00:13:42, GigabitEthernet 0/1

查看RTF路由表,发现外部路由开销是24,从拓扑看出刚好经过3跳,如果引用时的开销类型为2,这里的开销值应该是固定为20

SW6#show ip route Codes:  C - Connected, L - Local, S - StaticR - RIP, O - OSPF, B - BGP, I - IS-IS, V - Overflow routeN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2SU - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2IA - Inter area, EV - BGP EVPN, A - Arp to hostLA - Local aggregate route* - candidate defaultGateway of last resort is no set
C     6.6.6.6/32 is local host. 
O IA  10.1.24.0/24 [110/4] via 10.1.56.5, 00:25:53, GigabitEthernet 0/0
O IA  10.1.35.0/24 [110/2] via 10.1.56.5, 00:25:53, GigabitEthernet 0/0
C     10.1.56.0/24 is directly connected, GigabitEthernet 0/0
C     10.1.56.6/32 is local host. 
O IA  10.1.123.0/24 [110/3] via 10.1.56.5, 00:25:53, GigabitEthernet 0/0
O E1  192.168.10.0/24 [110/24] via 10.1.56.5, 00:15:45, GigabitEthernet 0/0

查看区域3交互报文,报文头部包含了认证秘钥

在这里插入图片描述

配置文件

RTA

hostname SW1
!
interface GigabitEthernet 0/0no switchportip address 10.1.123.1 255.255.255.0
!
interface Loopback 0ip address 1.1.1.1 255.255.255.255
!
router ospf 1graceful-restartnetwork 10.1.123.0 0.0.0.255 area 0
!

RTB

hostname SW2
!
interface GigabitEthernet 0/0no switchportip address 10.1.123.2 255.255.255.0
!
interface GigabitEthernet 0/1no switchportip address 10.1.24.2 255.255.255.0
!
interface Loopback 0ip address 2.2.2.2 255.255.255.255
!
router ospf 1graceful-restartarea 1 nssa no-summarynetwork 10.1.24.0 0.0.0.255 area 1network 10.1.123.0 0.0.0.255 area 0
!

RTC

hostname SW3
!
interface GigabitEthernet 0/0no switchportip address 10.1.123.3 255.255.255.0
!
interface GigabitEthernet 0/1no switchportip address 10.1.35.3 255.255.255.0
!
interface Loopback 0ip address 3.3.3.3 255.255.255.255
!
router ospf 1graceful-restartnetwork 10.1.35.0 0.0.0.255 area 2network 10.1.123.0 0.0.0.255 area 0area 2 virtual-link 5.5.5.5
!

RTD

hostname SW4
!
interface GigabitEthernet 0/0no switchportip address 10.1.24.4 255.255.255.0
!
interface GigabitEthernet 0/1no switchportip address 192.168.10.254 255.255.255.0
!
interface Loopback 0ip address 4.4.4.4 255.255.255.255
!
router ospf 1graceful-restartredistribute connected metric-type 1area 1 nssa no-summarynetwork 10.1.24.0 0.0.0.255 area 1
!

RTE

hostname SW5
!
key chain ospf-keykey 1key-string ruijie 
!
interface GigabitEthernet 0/0no switchportip address 10.1.35.5 255.255.255.0
!
interface GigabitEthernet 0/1no switchportip address 10.1.56.5 255.255.255.0ip ospf authentication keychain ospf-key
!
interface Loopback 0ip address 5.5.5.5 255.255.255.255
!
router ospf 1graceful-restartnetwork 10.1.35.0 0.0.0.255 area 2network 10.1.56.0 0.0.0.255 area 3area 2 virtual-link 3.3.3.3
!

RTF

hostname SW6
!
key chain ospf-keykey 1key-string ruijie 
!
interface GigabitEthernet 0/0no switchportip address 10.1.56.6 255.255.255.0ip ospf authentication keychain ospf-key
!
interface Loopback 0ip address 6.6.6.6 255.255.255.255
!         
router ospf 1graceful-restartnetwork 10.1.56.0 0.0.0.255 area 3
!
http://www.dtcms.com/a/395932.html

相关文章:

  • Python控制流概述
  • 【LLM学习】【Ollama】四、MCP
  • 5G RedCap模组:轻量化5G技术的商业化实现
  • 深入探索卷积神经网络:从基础到高级架构(二)
  • 什么是DeepSeek-V3.1-Terminus版本?
  • 【C语言代码】堵车问题
  • A Survey of Zero-Shot Learning: Settings, Methods, and Applications
  • Windows连接Linux做开发的安装和配置
  • 【C++】lambda表达式类型相关问题
  • HTML应用指南:利用GET请求获取全国大疆限飞区域shp图层信息
  • Nginx进阶(二)
  • VSCode+WSL+cpolar:打造跨平台的随身Linux开发舱
  • Redis高可用方案:主从复制、哨兵与集群
  • STM32_03_库函数
  • SGP30气体传感器详解 (STM32)
  • stm32 BootLoader之检查栈顶地址是否合法(否则无法跳转到APP程序)
  • PyTorch 神经网络工具箱学习总结
  • 容器化 Spring Boot 应用程序
  • python 打包单个文件
  • Python自学21 - Python处理图像
  • 比特浏览器的IP适配性
  • LLHTTP测试
  • 2. 基于IniRealm的方式
  • 第三十四天:矩阵转置
  • MySQL执行计划:如何发现隐藏的性能瓶颈?
  • embedding多模态模型
  • ⚡ GitHub 热榜速报 | 2025 年 09 月 第 3 周
  • Synchronized的实现原理:深入理解Java线程同步机制
  • 初识C++、其中的引用、类(class)和结构体(struct)
  • Qt之常用控件之QWidget(四)