理论+实验:eNSP中配置静态路由

@[toc]

简单介绍命令

以太网工作在数据链路层

数据的三要素:1.语法2.语义3.同步(接口速率)

http://7n4.cn/或https://mac.51240.xom可以查询MAC地址厂商

display mac-address 查看mac地址表

sysname R1 改名为R1

dis version 查看系统版本

interface gigabitethernet0/0/1 进入g0/0/1接口

ip- subnet-vlan 查看接口vlan网段信息

speed 10 接口速率配置为10M

undo negotiation auto 关闭自动协商

dis vlan 查看vlan接口分布表

int g0/0/0 进入g0/0/0 接口

ip add 192.168.1.1. 24 配置接口ip地址为192.168.1.1 子网掩码24位

undo shutdown 启用

pre 优先级

cost 花销值

浮动路由

即备份一条优先级比当前路由低的路由

实验名称:

实现三台路由器的loop 接口互联互通

1.配置参数已设置,接下来就开始配置
在这里插入图片描述
2.思路:loop接口的ip地址相当于路由器自身的一个直连网段

配置各个路由器的接口ip就开始配置相应的路由条目

1.1.1.1 去ping 2.2.2.2,有两条路可走,分别是R1》》R2,和R1》》R3》》R2,可以分别配置,先配置的优先级最高,后配置的最备用,等待优先级高的路由失效后就会触发优先级低的路由,以免因为链路损坏而影响数据及时传输

同理,1.1.1.1ping3.3.3.3 也是同样的道理

2.2.2.2ping3.3.3.3也是

在这里详细解释1.1.1.1去ping2.2.2.2的过程,剩下的举一反三即可

R1》》R2

对于1.1.1.1而言,2.2.2.2是R1的非直连网段,所以数据过去的话需要去给R1配置一条2.2.2.0的静态路由,下一跳为12.0.0.2;数据回来就是从R2返回到R1,需要给R2配置一条1.1.1.0的静态路由,下一跳为12.0.0.1

R1》》R3》》R2

首先,值得注意的是,数据一来一回的优先级必须在同一链路上,不可以分开

R1的数据传到R2,经过R3,需要给R1配置一条2.2.2.0的条目,下一跳为13.0.0.3,因为这个条目是第二个配置,所以在12.0.0.0正常作用的情况下,第二个条目不会被触发,这里配置这一条目,仅作备用;2.2.2.0也并不是R3的直连网段,所以需要给R3配置一条2.2.2.0的静态路由,下一跳为23.0.0.2。数据过去了,也要回来,配置路由的思路跟过去的一致,这里就不赘述了,开始配置

3.开启设备,先配置ip

R1

The device is running!  '显示设备已运行'

<Huawei>sys 'systtem-view,进入系统视图'
Enter system view, return user view with Ctrl+Z.    '反馈已进入'
[Huawei]undo info-center enable '关掉信息中心'
Info: Information center is disabled.   '反馈已关掉'
[Huawei]int g0/0/0  '进入g0/0/0接口'
[Huawei-GigabitEthernet0/0/0]ip add 12.0.0.1 24 '配置ip地址'
[Huawei-GigabitEthernet0/0/0]undo shutdown  '启用'
Info: Interface GigabitEthernet0/0/0 is not shutdown.   '反馈已启用'
[Huawei-GigabitEthernet0/0/0]int g0/0/1     '进入g0/0/1接口'
[Huawei-GigabitEthernet0/0/1]ip add 13.0.0.1 24 '配置IP地址'
[Huawei-GigabitEthernet0/0/1]undo shutdown  '启用'
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[Huawei-GigabitEthernet0/0/1]q  '返回到系统视图'
[Huawei]int LoopBack 0  '进入Loopback 0 接口'
[Huawei-LoopBack0]ip address 1.1.1.1 24 '配置IP 地址'
[Huawei-LoopBack0]q '返回,不需要手动启用'
[Huawei]dis ip int brief    '查看接口ip信息'
*down: administratively down
!down: FIB overload down
^down: standby
(l): loopback
(s): spoofing
(d): Dampening Suppressed
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 8
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 8

Interface                         IP Address/Mask      Physical   Protocol  
Ethernet0/0/0                     unassigned           down       down      
Ethernet0/0/1                     unassigned           down       down      
GigabitEthernet0/0/0              12.0.0.1/24          up         up     '已配置,up已启用'
GigabitEthernet0/0/1              13.0.0.1/24          up         up      '已配置,up已启用'  
GigabitEthernet0/0/2              unassigned           down       down      
GigabitEthernet0/0/3              unassigned           down       down      
LoopBack0                         1.1.1.1/24           up         up(s)    '已配置,up已启用'
NULL0                             unassigned           up         up(s)     
Serial0/0/0                       unassigned           down       down      
Serial0/0/1                       unassigned           down       down      
Serial0/0/2                       unassigned           down       down      
Serial0/0/3                       unassigned           down       down      

R2的ip配置

[Huawei]sysname R2      '更名为R2'
[R2]
Nov  7 2019 19:37:53-08:00 R2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.
191.3.1 configurations have been changed. The current change number is 1, the ch
ange loop count is 0, and the maximum number of records is 4095.u       '没有及时关掉信息中心,就会出现这个信息'
[R2]undo info-center enable     '关掉信息中心'
Info: Information center is disabled. '反馈关掉'
[R2]int g0/0/0  '进入g0/0/0接口'
[R2-GigabitEthernet0/0/0]ip add 12.0.0.2 24 '配IP地址'
[R2-GigabitEthernet0/0/0]undo shutdown  '启用'
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R2-GigabitEthernet0/0/0]int g0/0/2 '进入g0/0/2接口'
[R2-GigabitEthernet0/0/2]ip add 23.0.0.2 24 '陪ip地址'
[R2-GigabitEthernet0/0/2]undo shutdown  '启用'
Info: Interface GigabitEthernet0/0/2 is not shutdown.
[R2-GigabitEthernet0/0/2]q  '返回上一层'
[R2]int LoopBack 0  '进入loopback接口'
[R2-LoopBack0]ip add 2.2.2.2 24 '配置ip地址'
[R2-LoopBack0]q '返回上一层'
[R2]dis ip int b    '查看接口ip信息表'
*down: administratively down
!down: FIB overload down
^down: standby
(l): loopback
(s): spoofing
(d): Dampening Suppressed
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 8
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 8

Interface                         IP Address/Mask      Physical   Protocol  
Ethernet0/0/0                     unassigned           down       down      
Ethernet0/0/1                     unassigned           down       down      
GigabitEthernet0/0/0              12.0.0.2/24          up         up   '已配置,Up已启用'     
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              23.0.0.2/24          up         up     '已配置,up已启用'   
GigabitEthernet0/0/3              unassigned           down       down      
LoopBack0                         2.2.2.2/24           up         up(s)  '已配置,up已启用'   
NULL0                             unassigned           up         up(s)     
Serial0/0/0                       unassigned           down       down      
Serial0/0/1                       unassigned           down       down      
Serial0/0/2                       unassigned           down       down      
Serial0/0/3                       unassigned           down       down      
[R2]

R3的ip 配置

<Huawei>
<Huawei>system-view     '进入系统视图'
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable     '关掉信息中心'
Info: Information center is disabled.
[Huawei]sysname R3  '更名为R3'
[R3]int g0/0/1  '进入g0/0/1接口'
[R3-GigabitEthernet0/0/1]ip add 13.0.0.3 24 '配置ip信息'
[R3-GigabitEthernet0/0/1]undo shutdown  '启用'
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[R3-GigabitEthernet0/0/1]int g0/0/2 '进入g0/0/2接口'
[R3-GigabitEthernet0/0/2]ip add 23.0.0.3 24 '配置ip地址'
[R3-GigabitEthernet0/0/2]undo shutdown  '启用'
Info: Interface GigabitEthernet0/0/2 is not shutdown.
[R3-GigabitEthernet0/0/2]q      '返回上一层'
[R3]int LoopBack 0      '进入loopback 0 接口'
[R3-LoopBack0]ip add 3.3.3.3 24     '配置ip地址'
[R3-LoopBack0]q     '返回上一层'
[R3]int LoopBack 1  
[R3-LoopBack1]ip add 4.4.4.4 24
[R3-LoopBack1]q
[R3]dis ip interface brief  '查看接口ip信息表'
*down: administratively down
!down: FIB overload down
^down: standby
(l): loopback
(s): spoofing
(d): Dampening Suppressed
The number of interface that is UP in Physical is 5
The number of interface that is DOWN in Physical is 8
The number of interface that is UP in Protocol is 5
The number of interface that is DOWN in Protocol is 8

Interface                         IP Address/Mask      Physical   Protocol  
Ethernet0/0/0                     unassigned           down       down      
Ethernet0/0/1                     unassigned           down       down      
GigabitEthernet0/0/0              unassigned           down       down      
GigabitEthernet0/0/1              13.0.0.3/24          up         up    '已配置,up已开启'      
GigabitEthernet0/0/2              23.0.0.3/24          up         up  '已配置,up已开启'      
GigabitEthernet0/0/3              unassigned           down       down      
LoopBack0                         3.3.3.3/24           up         up(s)     '已配置,uo已开启'   
LoopBack1                         4.4.4.4/24           up         up(s)   '已配置,up已开启'  
NULL0                             unassigned           up         up(s)     
Serial0/0/0                       unassigned           down       down      
Serial0/0/1                       unassigned           down       down      
Serial0/0/2                       unassigned           down       down      
Serial0/0/3                       unassigned           down       down      

ip配置完毕,接下来就开始配置路由,先从1.1.1.1去ping 2.2.2.2的思路去配置

R1

<Huawei>system-view     '进入系统视图'
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1  '改名为R1'
[R1]
Nov  7 2019 19:45:23-08:00 R1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.
191.3.1 configurations have been changed. The current change number is 5, the ch
ange loop count is 0, and the maximum number of records is 4095.    '出现信息中心的信息'
Info: Information center is disabled.       '关掉信息中心'
[R1]ip route-static 2.2.2.0 24 12.0.0.2 '配置静态路由,目标网段2.2.2.0,下一跳12.0.0.2'

R2

[R2]ip route-static 1.1.1.0 24 12.0.0.1     '配置静态路由,目标网段1.1.1.0 下一跳为12.0.0.1'

R1的1.1.1.1 去ping 2.2.2.2

[R1]ping -a 1.1.1.1 2.2.2.2   '-a指定源ip地址'
  PING 2.2.2.2: 56  data bytes, press CTRL_C to break
    Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=255 time=50 ms      '成功'
    Reply from 2.2.2.2: bytes=56 Sequence=2 ttl=255 time=20 ms
    Reply from 2.2.2.2: bytes=56 Sequence=3 ttl=255 time=50 ms
    Reply from 2.2.2.2: bytes=56 Sequence=4 ttl=255 time=30 ms
    Reply from 2.2.2.2: bytes=56 Sequence=5 ttl=255 time=20 ms

  --- 2.2.2.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/34/50 ms

接下来配置备用路由,即R1》》R3》》R2

R1

[R1]ip route-static 2.2.2.0 24 13.0.0.3 '配置静态路由'

R3

[R3]ip route-static 2.2.2.0 24 23.0.0.2 '配置静态路由'

再往回配

R2

[R2]ip route-static 1.1.1.0 24 23.0.0.3

R3

[R3]ip route-static 1.1.1.0 24 13.0.0.1

接下来可以把12.0.0.0/24的链路中断

在这里插入图片描述
R1操作方法

[R1]int g0/0/0  '进入对应网段接口'
[R1-GigabitEthernet0/0/0]shutdown   '关闭'
[R1-GigabitEthernet0/0/0]q

这个时候再ping一波

[R1]ping -a 1.1.1.1 2.2.2.2
  PING 2.2.2.2: 56  data bytes, press CTRL_C to break
    Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=254 time=80 ms
    Reply from 2.2.2.2: bytes=56 Sequence=2 ttl=254 time=60 ms
    Reply from 2.2.2.2: bytes=56 Sequence=3 ttl=254 time=60 ms
    Reply from 2.2.2.2: bytes=56 Sequence=4 ttl=254 time=60 ms
    Reply from 2.2.2.2: bytes=56 Sequence=5 ttl=254 time=50 ms

  --- 2.2.2.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 50/62/80 ms

查看一下此时R1的路由表

[R1]dis ip routing-table    '查看路由表'
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 7        Routes : 7        

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        1.1.1.0/24  Direct  0    0           D   1.1.1.1         LoopBack0
        1.1.1.1/32  Direct  0    0           D   127.0.0.1       LoopBack0
        2.2.2.0/24  Static  60   0          RD   13.0.0.3        GigabitEthernet    '注意这一条'
0/0/1
       13.0.0.0/24  Direct  0    0           D   13.0.0.1        GigabitEthernet
0/0/1
       13.0.0.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0

恢复12.0.0.1链路,再次查看路由表

[R1]int g0/0/0  
[R1-GigabitEthernet0/0/0]undo shutdown 
[R1-GigabitEthernet0/0/0]q
[R1]dis ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 9        Routes : 10       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        1.1.1.0/24  Direct  0    0           D   1.1.1.1         LoopBack0
        1.1.1.1/32  Direct  0    0           D   127.0.0.1       LoopBack0
        2.2.2.0/24  Static  60   0          RD   12.0.0.2        GigabitEthernet    '注意这一条'
0/0/0
                    Static  60   0          RD   13.0.0.3        GigabitEthernet
0/0/1
       12.0.0.0/24  Direct  0    0           D   12.0.0.1        GigabitEthernet
0/0/0
       12.0.0.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
       13.0.0.0/24  Direct  0    0           D   13.0.0.1        GigabitEthernet
0/0/1
       13.0.0.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0

接下来就主要按部就班把其余的以同样的形式配置好即可

1.1.1.1 ping 3.3.3.3

R1

[R1]ip route-static 3.3.3.0 24 13.0.0.3

R3

[R3]ip route-static 1.1.1.0 24 13.0.0.1
Error: The route already exists.    '显示之前已被配置过'

备用路由

R1

[R1]ip route-static 3.3.3.0 24 12.0.0.2

R2

[R2]ip route-static 3.3.3.0 24 23.0.0.3

R3

[R3]ip route-static 1.1.1.0 24 23.0.0.2

R2

[R2]ip route-static 1.1.1.0 24 12.0.0.1
Error: The route already exists.

2.2.2.2 ping 3.3.3.3

R2

[R2]ip route-static 3.3.3.0 24 23.0.0.3
Error: The route already exists.

R3

[R3]ip route-static 2.2.2.0 24 23.0.0.2
Error: The route already exists.

再去配置另一条备用路由

R2》》R1》》R3

R2

[R2]ip route-static 3.3.3.0 24 12.0.0.1

R1

[R1]ip route-static 3.3.3.0 24 13.0.0.3
Error: The route already exists.

R3

[R3]ip route-static 2.2.2.0 24 13.0.0.1

R1

[R1]ip route-static 2.2.2.0 24 12.0.0.2
Error: The route already exists.

完毕

接下来1.1.1.1 ping 3.3.3.3

[R1]ping -a 1.1.1.1 3.3.3.3
  PING 3.3.3.3: 56  data bytes, press CTRL_C to break
    Reply from 3.3.3.3: bytes=56 Sequence=1 ttl=255 time=40 ms
    Reply from 3.3.3.3: bytes=56 Sequence=2 ttl=255 time=40 ms
    Reply from 3.3.3.3: bytes=56 Sequence=3 ttl=255 time=50 ms
    Reply from 3.3.3.3: bytes=56 Sequence=4 ttl=255 time=30 ms
    Reply from 3.3.3.3: bytes=56 Sequence=5 ttl=255 time=50 ms

  --- 3.3.3.3 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 30/42/50 ms

2.2.2.2去ping 3.3.3.3

[R2]ping -a 2.2.2.2 3.3.3.3
  PING 3.3.3.3: 56  data bytes, press CTRL_C to break
    Reply from 3.3.3.3: bytes=56 Sequence=1 ttl=255 time=40 ms
    Reply from 3.3.3.3: bytes=56 Sequence=2 ttl=255 time=50 ms
    Reply from 3.3.3.3: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 3.3.3.3: bytes=56 Sequence=4 ttl=255 time=50 ms
    Reply from 3.3.3.3: bytes=56 Sequence=5 ttl=255 time=50 ms

  --- 3.3.3.3 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/42/50 ms

查看各个路由器的路由表

R1

[R1]dis ip routing-table    '查看路由表'
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 10       Routes : 12       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        1.1.1.0/24  Direct  0    0           D   1.1.1.1         LoopBack0
        1.1.1.1/32  Direct  0    0           D   127.0.0.1       LoopBack0
        2.2.2.0/24  Static  60   0          RD   12.0.0.2        GigabitEthernet
0/0/0
                    Static  60   0          RD   13.0.0.3        GigabitEthernet    '备用路由'
0/0/1
        3.3.3.0/24  Static  60   0          RD   13.0.0.3        GigabitEthernet
0/0/1
                    Static  60   0          RD   12.0.0.2        GigabitEthernet    '备用路由'
0/0/0
       12.0.0.0/24  Direct  0    0           D   12.0.0.1        GigabitEthernet
0/0/0
       12.0.0.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
       13.0.0.0/24  Direct  0    0           D   13.0.0.1        GigabitEthernet
0/0/1
       13.0.0.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0

R2

[R2]dis ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 10       Routes : 12       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        1.1.1.0/24  Static  60   0          RD   12.0.0.1        GigabitEthernet
0/0/0
                    Static  60   0          RD   23.0.0.3        GigabitEthernet    '备用路由'
0/0/2
        2.2.2.0/24  Direct  0    0           D   2.2.2.2         LoopBack0
        2.2.2.2/32  Direct  0    0           D   127.0.0.1       LoopBack0
        3.3.3.0/24  Static  60   0          RD   23.0.0.3        GigabitEthernet
0/0/2
                    Static  60   0          RD   12.0.0.1        GigabitEthernet    '备用路由'
0/0/0
       12.0.0.0/24  Direct  0    0           D   12.0.0.2        GigabitEthernet
0/0/0
       12.0.0.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
       23.0.0.0/24  Direct  0    0           D   23.0.0.2        GigabitEthernet
0/0/2
       23.0.0.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0

R3

[R3]dis ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 12       Routes : 14       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        1.1.1.0/24  Static  60   0          RD   13.0.0.1        GigabitEthernet
0/0/1
                    Static  60   0          RD   23.0.0.2        GigabitEthernet    '备用路由'
0/0/2
        2.2.2.0/24  Static  60   0          RD   23.0.0.2        GigabitEthernet
0/0/2
                    Static  60   0          RD   13.0.0.1        GigabitEthernet    '备用路由'
0/0/1
        3.3.3.0/24  Direct  0    0           D   3.3.3.3         LoopBack0
        3.3.3.3/32  Direct  0    0           D   127.0.0.1       LoopBack0
        4.4.4.0/24  Direct  0    0           D   4.4.4.4         LoopBack1
        4.4.4.4/32  Direct  0    0           D   127.0.0.1       LoopBack1
       13.0.0.0/24  Direct  0    0           D   13.0.0.3        GigabitEthernet
0/0/1
       13.0.0.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
       23.0.0.0/24  Direct  0    0           D   23.0.0.3        GigabitEthernet
0/0/2
       23.0.0.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0

```shell

可以发现各少了一个网段,但是并不影响loop间的互联互通

可以断掉一条链路,去测试备用链路

断掉R1的g0/0/1

```shell
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]shutdown 

再次ping一波

[R1]ping -a 1.1.1.1 2.2.2.2
  PING 2.2.2.2: 56  data bytes, press CTRL_C to break
    Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=254 time=80 ms
    Reply from 2.2.2.2: bytes=56 Sequence=2 ttl=254 time=60 ms
    Reply from 2.2.2.2: bytes=56 Sequence=3 ttl=254 time=80 ms
    Reply from 2.2.2.2: bytes=56 Sequence=4 ttl=254 time=60 ms
    Reply from 2.2.2.2: bytes=56 Sequence=5 ttl=254 time=60 ms

  --- 2.2.2.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 60/68/80 ms

[R1]ping -a 1.1.1.1 3.3.3.3
  PING 3.3.3.3: 56  data bytes, press CTRL_C to break
    Reply from 3.3.3.3: bytes=56 Sequence=1 ttl=255 time=10 ms
    Reply from 3.3.3.3: bytes=56 Sequence=2 ttl=255 time=50 ms
    Reply from 3.3.3.3: bytes=56 Sequence=3 ttl=255 time=50 ms
    Reply from 3.3.3.3: bytes=56 Sequence=4 ttl=255 time=40 ms
    Reply from 3.3.3.3: bytes=56 Sequence=5 ttl=255 time=30 ms

  --- 3.3.3.3 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 10/36/50 ms
[R2]ping -a 2.2.2.2 3.3.3.3
  PING 3.3.3.3: 56  data bytes, press CTRL_C to break
    Reply from 3.3.3.3: bytes=56 Sequence=1 ttl=255 time=20 ms
    Reply from 3.3.3.3: bytes=56 Sequence=2 ttl=255 time=10 ms
    Reply from 3.3.3.3: bytes=56 Sequence=3 ttl=255 time=50 ms
    Reply from 3.3.3.3: bytes=56 Sequence=4 ttl=255 time=40 ms
    Reply from 3.3.3.3: bytes=56 Sequence=5 ttl=255 time=50 ms

  --- 3.3.3.3 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 10/34/50 ms

并不影响

再次查看路由表

R1

[R1]dis ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 8        Routes : 8        

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        1.1.1.0/24  Direct  0    0           D   1.1.1.1         LoopBack0
        1.1.1.1/32  Direct  0    0           D   127.0.0.1       LoopBack0
        2.2.2.0/24  Static  60   0          RD   13.0.0.3        GigabitEthernet    '备用路由'
0/0/1
        3.3.3.0/24  Static  60   0          RD   13.0.0.3        GigabitEthernet
0/0/1
       13.0.0.0/24  Direct  0    0           D   13.0.0.1        GigabitEthernet
0/0/1
       13.0.0.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0

R2

[R2]dis ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 8        Routes : 8        

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        1.1.1.0/24  Static  60   0          RD   23.0.0.3        GigabitEthernet    '备用路由'
0/0/2
        2.2.2.0/24  Direct  0    0           D   2.2.2.2         LoopBack0
        2.2.2.2/32  Direct  0    0           D   127.0.0.1       LoopBack0
        3.3.3.0/24  Static  60   0          RD   23.0.0.3        GigabitEthernet
0/0/2
       23.0.0.0/24  Direct  0    0           D   23.0.0.2        GigabitEthernet
0/0/2
       23.0.0.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0

R3

[R3]dis ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 12       Routes : 14       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        1.1.1.0/24  Static  60   0          RD   13.0.0.1        GigabitEthernet
0/0/1
                    Static  60   0          RD   23.0.0.2        GigabitEthernet
0/0/2
        2.2.2.0/24  Static  60   0          RD   23.0.0.2        GigabitEthernet
0/0/2
                    Static  60   0          RD   13.0.0.1        GigabitEthernet
0/0/1
        3.3.3.0/24  Direct  0    0           D   3.3.3.3         LoopBack0
        3.3.3.3/32  Direct  0    0           D   127.0.0.1       LoopBack0
        4.4.4.0/24  Direct  0    0           D   4.4.4.4         LoopBack1
        4.4.4.4/32  Direct  0    0           D   127.0.0.1       LoopBack1
       13.0.0.0/24  Direct  0    0           D   13.0.0.3        GigabitEthernet
0/0/1
       13.0.0.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
       23.0.0.0/24  Direct  0    0           D   23.0.0.3        GigabitEthernet
0/0/2
       23.0.0.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0

跟12.0.0.0相关的都改用了备用链路,再次印证了之前说的一个原理

猜你喜欢

转载自blog.51cto.com/14558445/2448638