【原创】H3C路由器OSPF测试

网络拓扑图

路由器配置:

路由器1上接了4跟线,分别为这四个接口配置IP地址。

bash 复制代码
#
interface GigabitEthernet0/0/0
 port link-mode route
 combo enable copper
 ip address 2.1.1.2 255.255.255.0
#
interface GigabitEthernet0/0/1
 port link-mode route
 combo enable copper
 ip address 3.1.1.2 255.255.255.0
#
interface GigabitEthernet0/0/2
 port link-mode route
 combo enable copper
 ip address 4.1.1.2 255.255.255.0
#
interface GigabitEthernet0/0/10
 port link-mode route
 combo enable copper
 ip address 1.1.1.1 255.255.255.0

创建OSPF区域,并添加这四个接口对应的网络主机

bash 复制代码
ospf 100
 area 0.0.0.0
  network 1.1.1.0 0.0.0.255
  network 2.1.1.0 0.0.0.255
  network 3.1.1.0 0.0.0.255
  network 4.1.1.0 0.0.0.255

其它路由器,依葫芦画瓢。

测试

bash 复制代码
VPCS_7> ping 1.1.1.2
1.1.1.2 icmp_seq=1 timeout
1.1.1.2 icmp_seq=2 timeout
84 bytes from 1.1.1.2 icmp_seq=3 ttl=61 time=1.713 ms
84 bytes from 1.1.1.2 icmp_seq=4 ttl=61 time=2.708 ms
84 bytes from 1.1.1.2 icmp_seq=5 ttl=61 time=1.698 ms
bash 复制代码
VPCS_6> ping 5.1.1.2
84 bytes from 5.1.1.2 icmp_seq=1 ttl=61 time=1.760 ms
84 bytes from 5.1.1.2 icmp_seq=2 ttl=61 time=2.109 ms
84 bytes from 5.1.1.2 icmp_seq=3 ttl=61 time=1.806 ms
84 bytes from 5.1.1.2 icmp_seq=4 ttl=61 time=1.760 ms
84 bytes from 5.1.1.2 icmp_seq=5 ttl=61 time=1.737 ms

VPCS_7 与 VPCS_6之间是通的。

路由跟踪

bash 复制代码
VPCS_6> trace 5.1.1.2
trace to 5.1.1.2, 8 hops max, press Ctrl+C to stop
 1     *  *  *
 2     *  *  *
 3     *  *  *
 4   *5.1.1.2   1.893 ms (ICMP type:3, code:3, Destination port unreachable)

从这里可以看到,从 VPCS_6到VPCS_7之间经过了4个路由器。但是并没解析出路由器的IP。

解析经过的路由器

接下来,在每个路由器中执行如下指令

bash 复制代码
ip ttl-expires enable
ip unreachables enable

再执行跟踪

bash 复制代码
VPCS_6> trace 5.1.1.2
trace to 5.1.1.2, 8 hops max, press Ctrl+C to stop
 1   1.1.1.1   0.493 ms  0.437 ms  0.410 ms
 2   4.1.1.1   0.723 ms  0.623 ms  0.619 ms
 3   4.1.2.2   1.006 ms  0.872 ms  0.803 ms
 4   *5.1.1.2   1.014 ms (ICMP type:3, code:3, Destination port unreachable)
bash 复制代码
VPCS_6> trace 5.1.1.2 -P 1
trace to 5.1.1.2, 8 hops max (ICMP), press Ctrl+C to stop
 1   1.1.1.1   0.501 ms  0.361 ms  0.278 ms
 2   4.1.1.1   0.624 ms  0.641 ms  0.536 ms
 3   4.1.2.2   0.875 ms  0.882 ms  0.768 ms
 4   5.1.1.2   1.324 ms  1.255 ms  0.942 ms
bash 复制代码
VPCS_6> trace 5.1.1.2 -P 6
trace to 5.1.1.2, 8 hops max (TCP), press Ctrl+C to stop
 1   1.1.1.1   0.464 ms  0.442 ms  0.431 ms
 2   4.1.1.1   0.619 ms  0.634 ms  0.526 ms
 3   4.1.2.2   0.934 ms  0.854 ms  0.924 ms
 4   5.1.1.2   1.205 ms  1.068 ms  1.150 ms

经过的路由器都显示出来了,数据路线图如下

断路测试

手动关闭 路由器5的 G0/0/2端口

bash 复制代码
[H3C]int g0/0/2
[H3C-GigabitEthernet0/0/2]dis this
#
interface GigabitEthernet0/0/2
 port link-mode route
 combo enable copper
 ip address 4.1.2.2 255.255.255.0
#
return
[H3C-GigabitEthernet0/0/2]shutdown

再次跟踪路由

bash 复制代码
VPCS_6> trace 5.1.1.2 -P 6
trace to 5.1.1.2, 8 hops max (TCP), press Ctrl+C to stop
 1   1.1.1.1   0.459 ms  0.396 ms  0.358 ms
 2   2.1.1.1   0.681 ms  0.560 ms  0.465 ms
 3   3.1.4.2   1.064 ms  1.326 ms  0.978 ms
 4     *  *  *
 5   5.1.1.2   2.974 ms  4294966.730 ms  4294964.851 ms

VPCS_6> trace 5.1.1.2 -P 6
trace to 5.1.1.2, 8 hops max (TCP), press Ctrl+C to stop
 1   1.1.1.1   0.380 ms  0.341 ms  0.274 ms
 2   2.1.1.1   1.188 ms  0.662 ms  0.624 ms
 3     *  *  *
 4     *  *  *
 5     *  *  *
 6   5.1.1.2   1.903 ms  1.337 ms  1.454 ms

VPCS_6> trace 5.1.1.2 -P 6
trace to 5.1.1.2, 8 hops max (TCP), press Ctrl+C to stop
 1   1.1.1.1   0.420 ms  0.357 ms  0.417 ms
 2   2.1.1.1   0.733 ms  0.697 ms  0.630 ms
 3   3.1.4.2   1.446 ms  0.917 ms  1.029 ms
 4   5.1.1.2   1.155 ms  1.053 ms  1.007 ms

网络结构发生变化,OSPF需要一段事件完成路由变更。

现在经过的路线如下:

再把2.1.1.1关掉

bash 复制代码
[H3C]int g0/0/0
[H3C-GigabitEthernet0/0/0]dis thi
#
interface GigabitEthernet0/0/0
 port link-mode route
 combo enable copper
 ip address 2.1.1.2 255.255.255.0
#
return
[H3C-GigabitEthernet0/0/0]shutdown

ping测试

bash 复制代码
VPCS_6> trace 5.1.1.2 -P 6
trace to 5.1.1.2, 8 hops max (TCP), press Ctrl+C to stop
 1   1.1.1.1   0.467 ms  0.383 ms  0.316 ms
 2   3.1.1.1   0.782 ms  0.583 ms  0.636 ms
 3   3.1.3.2   1.002 ms  0.941 ms  0.826 ms
 4   5.1.1.2   1.155 ms  1.044 ms  1.345 ms

当前数据路径

相关推荐
嵌入式×边缘AI:打怪升级日志21 小时前
[特殊字符] USBX 学习笔记(基于 Azure® RTOS)
网络
米羊1211 天前
Linux 内核漏洞提权
网络·安全·web安全
运维行者_1 天前
2026 技术升级,OpManager 新增 AI 网络拓扑与带宽预测功能
运维·网络·数据库·人工智能·安全·web安全·自动化
Ar呐1 天前
软考网规篇之局域网——网关冗余技术VRRP
网络·计算机网络
头发还没掉光光1 天前
HTTP协议从基础到实战全解析
linux·服务器·网络·c++·网络协议·http
漂洋过海的鱼儿1 天前
设计模式——EIT构型(三)
java·网络·设计模式
数通工程师1 天前
企业级硬件防火墙基础配置实战:从初始化到规则上线全流程
运维·网络·网络协议·tcp/ip·华为
血色橄榄枝1 天前
03 基于Flutter集成网络请求On OpenHarmony
网络·flutter
Godspeed Zhao1 天前
现代智能汽车中的无线技术41——BT与BLE(0)
网络·汽车
那就回到过去1 天前
PIM-DM断言机制和剪枝否决机制
网络·tcp/ip·智能路由器·ensp