【原创】H3C路由器OSPF测试

网络拓扑图

在这里插入图片描述

路由器配置:

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

#
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区域,并添加这四个接口对应的网络主机

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

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

测试

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

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之间是通的。

路由跟踪

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。

解析经过的路由器

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

ip ttl-expires enable
ip unreachables enable

再执行跟踪

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)
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

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端口

[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

再次跟踪路由

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关掉

[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测试

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

当前数据路径
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/u013667796/article/details/132624762