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

当前数据路径

相关推荐
密码小丑1 小时前
玄机-apache日志分析
网络·笔记·apache
学习2年半1 小时前
+++++背到厌倦。持续更新
网络·网络协议·rpc
冰滚水1 小时前
网络建设与运维神州数码DCN sFlow网络流量信息协议
运维·网络·sflow·网络建设与运维·网络搭建·神州数码
Reggie_L2 小时前
网络初识 - Java
java·网络
茶茶只知道学习3 小时前
(2)网络学习之堡垒机
网络·学习
Brandon汐3 小时前
Linux文件传输:让数据飞起来!
linux·运维·网络
计算机鬼才~3 小时前
网络安全·第二天·ARP协议安全分析
网络·安全·web安全·arp
菌菌巧乐兹6 小时前
电脑知识 | TCP通俗易懂详解 <一>
服务器·网络·tcp/ip
无名之逆6 小时前
[特殊字符] 超轻高性能的 Rust HTTP 服务器 —— Hyperlane [特殊字符][特殊字符]
java·服务器·开发语言·前端·网络·http·rust
稳联技术7 小时前
玻璃厂退火炉“温度智囊”:Profinet转ModbusRTU网关
运维·服务器·网络