【原创】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

当前数据路径

相关推荐
九河云7 小时前
华为云 GaussDB:金融级高可用数据库,为核心业务保驾护航
网络·数据库·科技·金融·华为云·gaussdb
独行soc7 小时前
2025年渗透测试面试题总结-66(题目+回答)
java·网络·python·安全·web安全·adb·渗透测试
码农101号7 小时前
运维安全05 - iptables规则保存与恢复
运维·网络·安全
sukalot9 小时前
window显示驱动开发—视频呈现网络的术语
网络
千鼎数字孪生-可视化10 小时前
WebSocket实时推送技术:PLC状态监控大屏的高效实现路径
网络·websocket·网络协议
李白你好10 小时前
这是一个用于扫描Zabbix系统中常见漏洞的工具,提供了图形界面(GUI)和命令行(CLI)两种使用方式。
网络·安全·zabbix
蒋星熠10 小时前
破壁者指南:内网穿透技术的深度解构与实战方法
网络·数据库·redis·python·websocket·网络协议·udp
monster_风铃13 小时前
BFD原理与配置
服务器·网络·tcp/ip·信息安全管理与评估
武汉唯众智创15 小时前
云数据中心网络优化实训系统:构建新一代云计算人才实训平台
网络·云计算·php·数字孪生·云数据中心网络优化实训系统·云计算孪生
狐小粟同学15 小时前
JavaEE--8.网络编程
运维·服务器·网络