HCIA-Datacom 网络技术实验指南 第2章 构建互联互通的IP网络

  • 静态路由,PC1与PC2之间的通信使用AR1-AR2-AR3链路。
  • 浮动静态路由,PC1与PC2之间的通信使用主链路AR1-AR2-AR3,备用链路AR1-AR4-AR3。
  • 静态路由负载分担,使用两台路径实现PC1与PC2之间的通信。
  • 默认路由。
     

静态路由,PC1与PC2之间的通信使用AR1-AR2-AR3链路

AR1 的初始配置

The device is running!

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname AR1
[AR1]interface G	
[AR1]interface GigabitEthernet 0/0/0
[AR1-GigabitEthernet0/0/0]ip addr 172.16.10.1 24
Sep 18 2022 13:41:51-08:00 AR1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/0 has entered the UP state. 
[AR1-GigabitEthernet0/0/0]q
[AR1]interface G	
[AR1]interface GigabitEthernet 0/0/1
[AR1-GigabitEthernet0/0/1]ip addr 10.10.14.1 24
Sep 18 2022 13:42:25-08:00 AR1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
 on the interface GigabitEthernet0/0/1 has entered the UP state. 
[AR1-GigabitEthernet0/0/1]q
[AR1]interface G	
[AR1]interface GigabitEthernet 0/0/2
[AR1-GigabitEthernet0/0/2]ip addr 10.10.12.1 24
[AR1-GigabitEthernet0/0/2]
Sep 18 2022 13:42:49-08:00 AR1 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
 on the interface GigabitEthernet0/0/2 has entered the UP state. 
[AR1-GigabitEthernet0/0/2]q
[AR1]user-inter	
[AR1]user-interface cons	
[AR1]user-interface console 0
[AR1-ui-console0]idle-timeout 0 0
[AR1-ui-console0]q
[AR1]

AR2 的初始配置

The device is running!

<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname AR2
[AR2]int g0/0/1
[AR2-GigabitEthernet0/0/1]ip addr 10.10.12.2 24
Sep 18 2022 13:56:29-08:00 AR2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/1 has entered the UP state. 
[AR2-GigabitEthernet0/0/1]q
[AR2]int g0/0/2
[AR2-GigabitEthernet0/0/2]ip addr 10.10.23.2 24
Sep 18 2022 13:56:59-08:00 AR2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
 on the interface GigabitEthernet0/0/2 has entered the UP state. 
[AR2-GigabitEthernet0/0/2]q
[AR2]int cons	
[AR2]user-in	
[AR2]user-interface conso	
[AR2]user-interface console 0
[AR2-ui-console0]idle-timeout 0 0
[AR2-ui-console0]q
[AR2]

AR3 的初始配置

The device is running!

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname AR3
[AR3]int g0/0/0
[AR3-GigabitEthernet0/0/0]ip addr 172.16.30.3 24
Sep 18 2022 13:59:29-08:00 AR3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/0 has entered the UP state. 
[AR3-GigabitEthernet0/0/0]q
[AR3]int g0/0/1
[AR3-GigabitEthernet0/0/1]ip addr 10.10.34.3 24
Sep 18 2022 14:00:52-08:00 AR3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
 on the interface GigabitEthernet0/0/1 has entered the UP state. 
[AR3-GigabitEthernet0/0/1]q
[AR3]int g0/0/2
[AR3-GigabitEthernet0/0/2]ip addr 10.10.23.3 24
Sep 18 2022 14:01:22-08:00 AR3 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
 on the interface GigabitEthernet0/0/2 has entered the UP state. 
[AR3-GigabitEthernet0/0/2]1
                          ^
Error: Unrecognized command found at '^' position.
[AR3-GigabitEthernet0/0/2]q
[AR3]user-inter	
[AR3]user-interface consol	
[AR3]user-interface console 0 
[AR3-ui-console0]idle-timeout 0 0
[AR3-ui-console0]1
                 ^
Error: Unrecognized command found at '^' position.
[AR3-ui-console0]q
[AR3]

AR4 的初始配置

The device is running!

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname AR4
[AR4]int g0/0/1
[AR4-GigabitEthernet0/0/1]ip addr 10.10.14.4 24
Sep 18 2022 14:03:16-08:00 AR4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/1 has entered the UP state. 
[AR4-GigabitEthernet0/0/1]q
[AR4]int g0/0/2
[AR4-GigabitEthernet0/0/2]ip addr 10.10.34.4 24
Sep 18 2022 14:03:52-08:00 AR4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
 on the interface GigabitEthernet0/0/2 has entered the UP state. 
[AR4-GigabitEthernet0/0/2]q
[AR4]user-inter	
[AR4]user-interface consol	
[AR4]user-interface console 0
[AR4-ui-console0]idle-timeout 0 0
[AR4-ui-console0]q
[AR4]

查看接口配置:      display ip interface brief

<AR1>display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 0
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 0

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              172.16.10.1/24       up         up        
GigabitEthernet0/0/1              10.10.14.1/24        up         up        
GigabitEthernet0/0/2              10.10.12.1/24        up         up        
NULL0                             unassigned           up         up(s)     
<AR1>

[AR2]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 1

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              unassigned           down       down      
GigabitEthernet0/0/1              10.10.12.2/24        up         up        
GigabitEthernet0/0/2              10.10.23.2/24        up         up        
NULL0                             unassigned           up         up(s)     
[AR2]


[AR3]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 0
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 0

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              172.16.30.3/24       up         up        
GigabitEthernet0/0/1              10.10.34.3/24        up         up        
GigabitEthernet0/0/2              10.10.23.3/24        up         up        
NULL0                             unassigned           up         up(s)     
[AR3]


[AR4]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 1

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              unassigned           down       down      
GigabitEthernet0/0/1              10.10.14.4/24        up         up        
GigabitEthernet0/0/2              10.10.34.4/24        up         up        
NULL0                             unassigned           up         up(s)     
[AR4]




测试直连连通性

<AR1>ping 172.16.10.10
  PING 172.16.10.10: 56  data bytes, press CTRL_C to break
    Reply from 172.16.10.10: bytes=56 Sequence=1 ttl=128 time=70 ms
    Reply from 172.16.10.10: bytes=56 Sequence=2 ttl=128 time=10 ms
    Reply from 172.16.10.10: bytes=56 Sequence=3 ttl=128 time=10 ms
    Reply from 172.16.10.10: bytes=56 Sequence=4 ttl=128 time=20 ms
    Reply from 172.16.10.10: bytes=56 Sequence=5 ttl=128 time=10 ms

  --- 172.16.10.10 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 10/24/70 ms

<AR1>ping 10.10.12.2
  PING 10.10.12.2: 56  data bytes, press CTRL_C to break
    Reply from 10.10.12.2: bytes=56 Sequence=1 ttl=255 time=70 ms
    Reply from 10.10.12.2: bytes=56 Sequence=2 ttl=255 time=20 ms
    Reply from 10.10.12.2: bytes=56 Sequence=3 ttl=255 time=10 ms
    Reply from 10.10.12.2: bytes=56 Sequence=4 ttl=255 time=10 ms
    Reply from 10.10.12.2: bytes=56 Sequence=5 ttl=255 time=10 ms

  --- 10.10.12.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 10/24/70 ms

<AR1>ping 10.10.14.4
  PING 10.10.14.4: 56  data bytes, press CTRL_C to break
    Reply from 10.10.14.4: bytes=56 Sequence=1 ttl=255 time=100 ms
    Reply from 10.10.14.4: bytes=56 Sequence=2 ttl=255 time=30 ms
    Reply from 10.10.14.4: bytes=56 Sequence=3 ttl=255 time=10 ms
    Reply from 10.10.14.4: bytes=56 Sequence=4 ttl=255 time=10 ms
    Reply from 10.10.14.4: bytes=56 Sequence=5 ttl=255 time=30 ms

  --- 10.10.14.4 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 10/36/100 ms

<AR1>


[AR2]ping 10.10.12.1
  PING 10.10.12.1: 56  data bytes, press CTRL_C to break
    Reply from 10.10.12.1: bytes=56 Sequence=1 ttl=255 time=20 ms
    Reply from 10.10.12.1: bytes=56 Sequence=2 ttl=255 time=20 ms
    Reply from 10.10.12.1: bytes=56 Sequence=3 ttl=255 time=30 ms
    Reply from 10.10.12.1: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 10.10.12.1: bytes=56 Sequence=5 ttl=255 time=30 ms

  --- 10.10.12.1 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/24/30 ms

[AR2]ping 10.10.23.3
  PING 10.10.23.3: 56  data bytes, press CTRL_C to break
    Reply from 10.10.23.3: bytes=56 Sequence=1 ttl=255 time=70 ms
    Reply from 10.10.23.3: bytes=56 Sequence=2 ttl=255 time=20 ms
    Reply from 10.10.23.3: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 10.10.23.3: bytes=56 Sequence=4 ttl=255 time=30 ms
    Reply from 10.10.23.3: bytes=56 Sequence=5 ttl=255 time=20 ms

  --- 10.10.23.3 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/32/70 ms

[AR2]


[AR3]ping 172.16.30.10
  PING 172.16.30.10: 56  data bytes, press CTRL_C to break
    Reply from 172.16.30.10: bytes=56 Sequence=1 ttl=128 time=150 ms
    Reply from 172.16.30.10: bytes=56 Sequence=2 ttl=128 time=20 ms
    Reply from 172.16.30.10: bytes=56 Sequence=3 ttl=128 time=10 ms
    Reply from 172.16.30.10: bytes=56 Sequence=4 ttl=128 time=10 ms
    Reply from 172.16.30.10: bytes=56 Sequence=5 ttl=128 time=10 ms

  --- 172.16.30.10 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 10/40/150 ms

[AR3]ping 10.10.34.4
  PING 10.10.34.4: 56  data bytes, press CTRL_C to break
    Reply from 10.10.34.4: bytes=56 Sequence=1 ttl=255 time=40 ms
    Reply from 10.10.34.4: bytes=56 Sequence=2 ttl=255 time=10 ms
    Reply from 10.10.34.4: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 10.10.34.4: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 10.10.34.4: bytes=56 Sequence=5 ttl=255 time=20 ms

  --- 10.10.34.4 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 10/22/40 ms

[AR3]ping 10.10.23.2
  PING 10.10.23.2: 56  data bytes, press CTRL_C to break
    Reply from 10.10.23.2: bytes=56 Sequence=1 ttl=255 time=20 ms
    Reply from 10.10.23.2: bytes=56 Sequence=2 ttl=255 time=30 ms
    Reply from 10.10.23.2: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 10.10.23.2: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 10.10.23.2: bytes=56 Sequence=5 ttl=255 time=20 ms

  --- 10.10.23.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/22/30 ms

[AR3]

[AR4]ping 10.10.14.1
  PING 10.10.14.1: 56  data bytes, press CTRL_C to break
    Reply from 10.10.14.1: bytes=56 Sequence=1 ttl=255 time=40 ms
    Reply from 10.10.14.1: bytes=56 Sequence=2 ttl=255 time=30 ms
    Reply from 10.10.14.1: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 10.10.14.1: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 10.10.14.1: bytes=56 Sequence=5 ttl=255 time=30 ms

  --- 10.10.14.1 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/28/40 ms

[AR4]ping 10.10.12.2
  PING 10.10.12.2: 56  data bytes, press CTRL_C to break
    Request time out
    Request time out
    Request time out
    Request time out
    Request time out

  --- 10.10.12.2 ping statistics ---
    5 packet(s) transmitted
    0 packet(s) received
    100.00% packet loss

[AR4]ping 10.10.34.3
  PING 10.10.34.3: 56  data bytes, press CTRL_C to break
    Reply from 10.10.34.3: bytes=56 Sequence=1 ttl=255 time=20 ms
    Reply from 10.10.34.3: bytes=56 Sequence=2 ttl=255 time=30 ms
    Reply from 10.10.34.3: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 10.10.34.3: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 10.10.34.3: bytes=56 Sequence=5 ttl=255 time=20 ms

  --- 10.10.34.3 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/22/30 ms

[AR4]





PC1 ping / tracert  PC2

Welcome to use PC Simulator!

PC>ping 172.16.30.10

Ping 172.16.30.10: 32 data bytes, Press Ctrl_C to break
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!

--- 172.16.30.10 ping statistics ---
  5 packet(s) transmitted
  0 packet(s) received
  100.00% packet loss

PC>tracert 172.16.30.10

traceroute to 172.16.30.10, 8 hops max
(ICMP), press Ctrl+C to stop
 1    *  *  *
 2    *  *  *
 3    *  *  *
 4    *  *  *
 5    *  *  *
 6    *  *  *
 7    *  *  *
 8    *  *  *

PC>

[AR1]display ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 13       Routes : 13       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     10.10.12.0/24  Direct  0    0           D   10.10.12.1      GigabitEthernet
0/0/2
     10.10.12.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
   10.10.12.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
     10.10.14.0/24  Direct  0    0           D   10.10.14.1      GigabitEthernet
0/0/1
     10.10.14.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
   10.10.14.255/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
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    172.16.10.0/24  Direct  0    0           D   172.16.10.1     GigabitEthernet
0/0/0
    172.16.10.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
  172.16.10.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[AR1]

AR1 添加 静态路由  ]ip route-static 172.16.30.0 24 10.10.12.2

[AR1]ip route-static 172.16.30.0 24 10.10.12.2
[AR1]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 14       Routes : 14       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     10.10.12.0/24  Direct  0    0           D   10.10.12.1      GigabitEthernet
0/0/2
     10.10.12.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
   10.10.12.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
     10.10.14.0/24  Direct  0    0           D   10.10.14.1      GigabitEthernet
0/0/1
     10.10.14.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
   10.10.14.255/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
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    172.16.10.0/24  Direct  0    0           D   172.16.10.1     GigabitEthernet
0/0/0
    172.16.10.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
  172.16.10.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
    172.16.30.0/24  Static  60   0          RD   10.10.12.2      GigabitEthernet
0/0/2
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[AR1]

AR2 添加静态路由      [AR2]ip route-static 172.16.30.0 24 10.10.23.3

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

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     10.10.12.0/24  Direct  0    0           D   10.10.12.2      GigabitEthernet
0/0/1
     10.10.12.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
   10.10.12.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
     10.10.23.0/24  Direct  0    0           D   10.10.23.2      GigabitEthernet
0/0/2
     10.10.23.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
   10.10.23.255/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
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[AR2]ip rout	
[AR2]ip route
[AR2]ip route-static 172.16.30.0 24 10.10.23.3
[AR2]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 11       Routes : 11       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     10.10.12.0/24  Direct  0    0           D   10.10.12.2      GigabitEthernet
0/0/1
     10.10.12.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
   10.10.12.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
     10.10.23.0/24  Direct  0    0           D   10.10.23.2      GigabitEthernet
0/0/2
     10.10.23.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
   10.10.23.255/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
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    172.16.30.0/24  Static  60   0          RD   10.10.23.3      GigabitEthernet
0/0/2
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[AR2]

PC1 ping PC2, 对AR3 g0/0/0 抓包可以发现 Echo(ping)Request和Reply

 

PC1 ping PC2, 对AR3 g0/0/2 抓包可以发现 Echo(ping)Request但没有Reply

 

AR3 添加静态路由     [AR3]ip route-static 172.16.10.0 24 10.10.23.2

[AR3]display ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 13       Routes : 13       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     10.10.23.0/24  Direct  0    0           D   10.10.23.3      GigabitEthernet
0/0/2
     10.10.23.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
   10.10.23.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
     10.10.34.0/24  Direct  0    0           D   10.10.34.3      GigabitEthernet
0/0/1
     10.10.34.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
   10.10.34.255/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
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    172.16.30.0/24  Direct  0    0           D   172.16.30.3     GigabitEthernet
0/0/0
    172.16.30.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
  172.16.30.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[AR3]ip route-static 172.16.10.0 24 10.10.23.2
[AR3]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 14       Routes : 14       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     10.10.23.0/24  Direct  0    0           D   10.10.23.3      GigabitEthernet
0/0/2
     10.10.23.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
   10.10.23.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
     10.10.34.0/24  Direct  0    0           D   10.10.34.3      GigabitEthernet
0/0/1
     10.10.34.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
   10.10.34.255/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
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    172.16.10.0/24  Static  60   0          RD   10.10.23.2      GigabitEthernet
0/0/2
    172.16.30.0/24  Direct  0    0           D   172.16.30.3     GigabitEthernet
0/0/0
    172.16.30.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
  172.16.30.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[AR3]

AR2 添加静态路由。   [AR2]ip route-static 172.16.10.0 24 10.10.12.1

[AR2]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 11       Routes : 11       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     10.10.12.0/24  Direct  0    0           D   10.10.12.2      GigabitEthernet
0/0/1
     10.10.12.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
   10.10.12.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
     10.10.23.0/24  Direct  0    0           D   10.10.23.2      GigabitEthernet
0/0/2
     10.10.23.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
   10.10.23.255/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
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    172.16.30.0/24  Static  60   0          RD   10.10.23.3      GigabitEthernet
0/0/2
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[AR2]ip route-static 172.16.10.0 24 10.10.12.1
[AR2]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 12       Routes : 12       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     10.10.12.0/24  Direct  0    0           D   10.10.12.2      GigabitEthernet
0/0/1
     10.10.12.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
   10.10.12.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
     10.10.23.0/24  Direct  0    0           D   10.10.23.2      GigabitEthernet
0/0/2
     10.10.23.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
   10.10.23.255/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
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    172.16.10.0/24  Static  60   0          RD   10.10.12.1      GigabitEthernet
0/0/1
    172.16.30.0/24  Static  60   0          RD   10.10.23.3      GigabitEthernet
0/0/2
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[AR2]

PC1 ping tracert PC2

PC>ping 172.16.30.10

Ping 172.16.30.10: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 172.16.30.10: bytes=32 seq=2 ttl=125 time=31 ms
From 172.16.30.10: bytes=32 seq=3 ttl=125 time=16 ms
From 172.16.30.10: bytes=32 seq=4 ttl=125 time=31 ms
From 172.16.30.10: bytes=32 seq=5 ttl=125 time=16 ms

--- 172.16.30.10 ping statistics ---
  5 packet(s) transmitted
  4 packet(s) received
  20.00% packet loss
  round-trip min/avg/max = 0/23/31 ms

PC>tracert 172.16.30.10

traceroute to 172.16.30.10, 8 hops max
(ICMP), press Ctrl+C to stop
 1  172.16.10.1   <1 ms  16 ms  <1 ms
 2  10.10.12.2   31 ms  <1 ms  16 ms
 3  10.10.23.3   15 ms  32 ms  15 ms
 4  172.16.30.10   16 ms  15 ms  32 ms

PC>

AR1 浮动路由设置    [AR1]ip route-static 172.16.30.0 24 10.10.14.4 preference 65

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

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     10.10.12.0/24  Direct  0    0           D   10.10.12.1      GigabitEthernet
0/0/2
     10.10.12.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
   10.10.12.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
     10.10.14.0/24  Direct  0    0           D   10.10.14.1      GigabitEthernet
0/0/1
     10.10.14.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
   10.10.14.255/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
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    172.16.10.0/24  Direct  0    0           D   172.16.10.1     GigabitEthernet
0/0/0
    172.16.10.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
  172.16.10.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
    172.16.30.0/24  Static  60   0          RD   10.10.12.2      GigabitEthernet
0/0/2
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[AR1]ip route-static 172.16.30.0 24 10.10.14.4 preference 65
[AR1]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 14       Routes : 14       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     10.10.12.0/24  Direct  0    0           D   10.10.12.1      GigabitEthernet
0/0/2
     10.10.12.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
   10.10.12.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
     10.10.14.0/24  Direct  0    0           D   10.10.14.1      GigabitEthernet
0/0/1
     10.10.14.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
   10.10.14.255/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
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    172.16.10.0/24  Direct  0    0           D   172.16.10.1     GigabitEthernet
0/0/0
    172.16.10.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
  172.16.10.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
    172.16.30.0/24  Static  60   0          RD   10.10.12.2      GigabitEthernet
0/0/2
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[AR1]int g0/0/2
[AR1-GigabitEthernet0/0/2]shutdown
Sep 18 2022 17:33:58-08:00 AR1 %%01IFPDT/4/IF_STATE(l)[3]:Interface GigabitEther
net0/0/2 has turned into DOWN state.
[AR1-GigabitEthernet0/0/2]
[AR1-GigabitEthernet0/0/2]
Sep 18 2022 17:33:58-08:00 AR1 %%01IFNET/4/LINK_STATE(l)[4]:The line protocol IP
 on the interface GigabitEthernet0/0/2 has entered the DOWN state. 
[AR1-GigabitEthernet0/0/2]q
[AR1]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 11       Routes : 11       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     10.10.14.0/24  Direct  0    0           D   10.10.14.1      GigabitEthernet
0/0/1
     10.10.14.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
   10.10.14.255/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
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    172.16.10.0/24  Direct  0    0           D   172.16.10.1     GigabitEthernet
0/0/0
    172.16.10.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
  172.16.10.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
    172.16.30.0/24  Static  65   0          RD   10.10.14.4      GigabitEthernet
0/0/1
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[AR1]

R4 配置静态路由  

[AR4]ip route-static 172.16.10.0 24 10.10.14.1
[AR4]ip route-static 172.16.30.0 24 10.10.34.3

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

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     10.10.14.0/24  Direct  0    0           D   10.10.14.4      GigabitEthernet
0/0/1
     10.10.14.4/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
   10.10.14.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
     10.10.34.0/24  Direct  0    0           D   10.10.34.4      GigabitEthernet
0/0/2
     10.10.34.4/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
   10.10.34.255/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
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[AR4]ip route-static 172.16.10.0 24 10.10.14.1
[AR4]ip route-static 172.16.30.0 24 10.10.34.3
[AR4]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 12       Routes : 12       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     10.10.14.0/24  Direct  0    0           D   10.10.14.4      GigabitEthernet
0/0/1
     10.10.14.4/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
   10.10.14.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
     10.10.34.0/24  Direct  0    0           D   10.10.34.4      GigabitEthernet
0/0/2
     10.10.34.4/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
   10.10.34.255/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
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    172.16.10.0/24  Static  60   0          RD   10.10.14.1      GigabitEthernet
0/0/1
    172.16.30.0/24  Static  60   0          RD   10.10.34.3      GigabitEthernet
0/0/2
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[AR4]

R3 配置浮动静态路由

[AR3]ip route-static 172.16.10.0 24 10.10.34.4 preference 65

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

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     10.10.23.0/24  Direct  0    0           D   10.10.23.3      GigabitEthernet
0/0/2
     10.10.23.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
   10.10.23.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
     10.10.34.0/24  Direct  0    0           D   10.10.34.3      GigabitEthernet
0/0/1
     10.10.34.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
   10.10.34.255/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
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    172.16.10.0/24  Static  60   0          RD   10.10.23.2      GigabitEthernet
0/0/2
    172.16.30.0/24  Direct  0    0           D   172.16.30.3     GigabitEthernet
0/0/0
    172.16.30.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
  172.16.30.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[AR3]ip route-static 172.16.10.0 24 10.10.34.4 preference 65
[AR3]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 14       Routes : 14       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     10.10.23.0/24  Direct  0    0           D   10.10.23.3      GigabitEthernet
0/0/2
     10.10.23.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
   10.10.23.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
     10.10.34.0/24  Direct  0    0           D   10.10.34.3      GigabitEthernet
0/0/1
     10.10.34.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
   10.10.34.255/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
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    172.16.10.0/24  Static  60   0          RD   10.10.23.2      GigabitEthernet
0/0/2
    172.16.30.0/24  Direct  0    0           D   172.16.30.3     GigabitEthernet
0/0/0
    172.16.30.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
  172.16.30.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[AR3]display ip routing-table protocol static
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : Static
         Destinations : 1        Routes : 2        Configured Routes : 2

Static routing table status : <Active>
         Destinations : 1        Routes : 1

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

    172.16.10.0/24  Static  60   0          RD   10.10.23.2      GigabitEthernet
0/0/2

Static routing table status : <Inactive>
         Destinations : 1        Routes : 1

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

    172.16.10.0/24  Static  65   0          R    10.10.34.4      GigabitEthernet
0/0/1

[AR3]int g0/0/2
[AR3-GigabitEthernet0/0/2]shutdown
Sep 18 2022 18:27:16-08:00 AR3 %%01IFPDT/4/IF_STATE(l)[3]:Interface GigabitEther
net0/0/2 has turned into DOWN state.
[AR3-GigabitEthernet0/0/2]
Sep 18 2022 18:27:16-08:00 AR3 %%01IFNET/4/LINK_STATE(l)[4]:The line protocol IP
 on the interface GigabitEthernet0/0/2 has entered the DOWN state. 
[AR3-GigabitEthernet0/0/2]q
[AR3]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 11       Routes : 11       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     10.10.34.0/24  Direct  0    0           D   10.10.34.3      GigabitEthernet
0/0/1
     10.10.34.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
   10.10.34.255/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
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    172.16.10.0/24  Static  65   0          RD   10.10.34.4      GigabitEthernet
0/0/1
    172.16.30.0/24  Direct  0    0           D   172.16.30.3     GigabitEthernet
0/0/0
    172.16.30.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
  172.16.30.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[AR3]

PC1 ping tracert PC2,浮动路由

PC>tracert 172.16.30.10

traceroute to 172.16.30.10, 8 hops max
(ICMP), press Ctrl+C to stop
 1  172.16.10.1   <1 ms  16 ms  <1 ms
 2  10.10.12.2   31 ms  <1 ms  16 ms
 3  10.10.23.3   15 ms  32 ms  15 ms
 4  172.16.30.10   16 ms  15 ms  32 ms

PC>tracert 172.16.30.10

traceroute to 172.16.30.10, 8 hops max
(ICMP), press Ctrl+C to stop
 1  172.16.10.1   <1 ms  15 ms  16 ms
 2  10.10.14.4   16 ms  15 ms  31 ms
 3  10.10.34.3   16 ms  31 ms  16 ms
 4    *172.16.30.10   31 ms  16 ms

PC>ping 172.16.30.10

Ping 172.16.30.10: 32 data bytes, Press Ctrl_C to break
From 172.16.30.10: bytes=32 seq=1 ttl=125 time=16 ms
From 172.16.30.10: bytes=32 seq=2 ttl=125 time=31 ms
From 172.16.30.10: bytes=32 seq=3 ttl=125 time=16 ms
From 172.16.30.10: bytes=32 seq=4 ttl=125 time=31 ms
From 172.16.30.10: bytes=32 seq=5 ttl=125 time=16 ms

--- 172.16.30.10 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 16/22/31 ms

PC>

重新打开AR1的G0/0/2接口,查看路由表。

路由表的浮动路由65下去,静态路由60上来

[AR1]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 11       Routes : 11       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     10.10.14.0/24  Direct  0    0           D   10.10.14.1      GigabitEthernet
0/0/1
     10.10.14.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
   10.10.14.255/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
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    172.16.10.0/24  Direct  0    0           D   172.16.10.1     GigabitEthernet
0/0/0
    172.16.10.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
  172.16.10.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
    172.16.30.0/24  Static  65   0          RD   10.10.14.4      GigabitEthernet
0/0/1
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[AR1]int g0/0/2
[AR1-GigabitEthernet0/0/2]undo shutdown
[AR1-GigabitEthernet0/0/2]q
[AR1]undo shutdown
Sep 18 2022 18:40:21-08:00 AR1 %%01IFPDT/4/IF_STATE(l)[5]:Interface GigabitEther
net0/0/2 has turned into UP state.
[AR1]undo shutdown
Sep 18 2022 18:40:21-08:00 AR1 %%01IFNET/4/LINK_STATE(l)[6]:The line protocol IP
 on the interface GigabitEthernet0/0/2 has entered the UP state. 
[AR1]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 14       Routes : 14       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     10.10.12.0/24  Direct  0    0           D   10.10.12.1      GigabitEthernet
0/0/2
     10.10.12.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
   10.10.12.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
     10.10.14.0/24  Direct  0    0           D   10.10.14.1      GigabitEthernet
0/0/1
     10.10.14.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
   10.10.14.255/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
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    172.16.10.0/24  Direct  0    0           D   172.16.10.1     GigabitEthernet
0/0/0
    172.16.10.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
  172.16.10.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
    172.16.30.0/24  Static  60   0          RD   10.10.12.2      GigabitEthernet
0/0/2
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[AR1]

AR3  开启G0/0/2接口,查看路由表。

路由表的浮动路由65下去,静态路由60上来

[AR3]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 11       Routes : 11       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     10.10.34.0/24  Direct  0    0           D   10.10.34.3      GigabitEthernet
0/0/1
     10.10.34.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
   10.10.34.255/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
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    172.16.10.0/24  Static  65   0          RD   10.10.34.4      GigabitEthernet
0/0/1
    172.16.30.0/24  Direct  0    0           D   172.16.30.3     GigabitEthernet
0/0/0
    172.16.30.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
  172.16.30.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[AR3]int g0/0/2
[AR3-GigabitEthernet0/0/2]undo shutdown
[AR3-GigabitEthernet0/0/2]
Sep 18 2022 18:43:33-08:00 AR3 %%01IFPDT/4/IF_STATE(l)[5]:Interface GigabitEther
net0/0/2 has turned into UP state.
[AR3-GigabitEthernet0/0/2]
Sep 18 2022 18:43:33-08:00 AR3 %%01IFNET/4/LINK_STATE(l)[6]:The line protocol IP
 on the interface GigabitEthernet0/0/2 has entered the UP state. 
[AR3-GigabitEthernet0/0/2]q
[AR3]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 14       Routes : 14       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     10.10.23.0/24  Direct  0    0           D   10.10.23.3      GigabitEthernet
0/0/2
     10.10.23.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
   10.10.23.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
     10.10.34.0/24  Direct  0    0           D   10.10.34.3      GigabitEthernet
0/0/1
     10.10.34.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
   10.10.34.255/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
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    172.16.10.0/24  Static  60   0          RD   10.10.23.2      GigabitEthernet
0/0/2
    172.16.30.0/24  Direct  0    0           D   172.16.30.3     GigabitEthernet
0/0/0
    172.16.30.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
  172.16.30.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[AR3]

PC1 ping tracert PC2

#  浮动静态路由
PC>tracert 172.16.30.10

traceroute to 172.16.30.10, 8 hops max
(ICMP), press Ctrl+C to stop
 1  172.16.10.1   <1 ms  15 ms  16 ms
 2  10.10.14.4   16 ms  15 ms  31 ms
 3  10.10.34.3   16 ms  31 ms  16 ms
 4    *172.16.30.10   31 ms  16 ms

# 静态路由
PC>ping 172.16.30.10

Ping 172.16.30.10: 32 data bytes, Press Ctrl_C to break
Request timeout!
Request timeout!
Request timeout!
From 172.16.30.10: bytes=32 seq=4 ttl=125 time=15 ms
From 172.16.30.10: bytes=32 seq=5 ttl=125 time=32 ms

--- 172.16.30.10 ping statistics ---
  5 packet(s) transmitted
  2 packet(s) received
  60.00% packet loss
  round-trip min/avg/max = 0/23/32 ms

PC>tracert 172.16.30.10

traceroute to 172.16.30.10, 8 hops max
(ICMP), press Ctrl+C to stop
 1  172.16.10.1   <1 ms  15 ms  16 ms
 2  10.10.12.2   <1 ms  15 ms  32 ms
 3  10.10.23.3   15 ms  16 ms  16 ms
 4  172.16.30.10   31 ms  15 ms  16 ms

PC>

静态路由负载分担

[AR1]undo ip route-static 172.16.30.0 24 10.10.14.4 preference 65
[AR1]ip route-static 172.16.30.0 24 10.10.14.4
[AR1]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 14       Routes : 15       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     10.10.12.0/24  Direct  0    0           D   10.10.12.1      GigabitEthernet
0/0/2
     10.10.12.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
   10.10.12.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
     10.10.14.0/24  Direct  0    0           D   10.10.14.1      GigabitEthernet
0/0/1
     10.10.14.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
   10.10.14.255/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
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    172.16.10.0/24  Direct  0    0           D   172.16.10.1     GigabitEthernet
0/0/0
    172.16.10.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
  172.16.10.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
    172.16.30.0/24  Static  60   0          RD   10.10.12.2      GigabitEthernet
0/0/2
                    Static  60   0          RD   10.10.14.4      GigabitEthernet
0/0/1
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[AR1]


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

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     10.10.12.0/24  Direct  0    0           D   10.10.12.2      GigabitEthernet
0/0/1
     10.10.12.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
   10.10.12.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
     10.10.23.0/24  Direct  0    0           D   10.10.23.2      GigabitEthernet
0/0/2
     10.10.23.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
   10.10.23.255/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
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    172.16.10.0/24  Static  60   0          RD   10.10.12.1      GigabitEthernet
0/0/1
    172.16.30.0/24  Static  60   0          RD   10.10.23.3      GigabitEthernet
0/0/2
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[AR2]


[AR3]undo ip route-static 172.16.10.0 24 10.10.34.4 preference 65
[AR3]ip route-static 172.16.10.0 24 10.10.34.4
[AR3]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 14       Routes : 15       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     10.10.23.0/24  Direct  0    0           D   10.10.23.3      GigabitEthernet
0/0/2
     10.10.23.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
   10.10.23.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
     10.10.34.0/24  Direct  0    0           D   10.10.34.3      GigabitEthernet
0/0/1
     10.10.34.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
   10.10.34.255/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
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    172.16.10.0/24  Static  60   0          RD   10.10.23.2      GigabitEthernet
0/0/2
                    Static  60   0          RD   10.10.34.4      GigabitEthernet
0/0/1
    172.16.30.0/24  Direct  0    0           D   172.16.30.3     GigabitEthernet
0/0/0
    172.16.30.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
  172.16.30.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[AR3]


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

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     10.10.14.0/24  Direct  0    0           D   10.10.14.4      GigabitEthernet
0/0/1
     10.10.14.4/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
   10.10.14.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
     10.10.34.0/24  Direct  0    0           D   10.10.34.4      GigabitEthernet
0/0/2
     10.10.34.4/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
   10.10.34.255/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
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    172.16.10.0/24  Static  60   0          RD   10.10.14.1      GigabitEthernet
0/0/1
    172.16.30.0/24  Static  60   0          RD   10.10.34.3      GigabitEthernet
0/0/2
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[AR4]



PC1 tracert PC2,分别关闭R2,R4


PC>tracert 172.16.30.10

traceroute to 172.16.30.10, 8 hops max
(ICMP), press Ctrl+C to stop
 1  172.16.10.1   <1 ms  16 ms  16 ms
 2    *  *10.10.12.2   15 ms
 3  10.10.23.3   31 ms  32 ms  31 ms
 4  172.16.30.10   16 ms  31 ms  15 ms

PC>tracert 172.16.30.10

traceroute to 172.16.30.10, 8 hops max
(ICMP), press Ctrl+C to stop
 1  172.16.10.1   16 ms  16 ms  <1 ms
 2    *10.10.14.4   47 ms  <1 ms
 3    *10.10.34.3   31 ms  15 ms
 4    *172.16.30.10   16 ms  31 ms

PC>

书上的结果,PC1去PC2是AR1-AR2-AR3和AR1-AR4-AR3交替进行

AR1 和 AR3 取消静态路由,配置默认路由。

AR1-AR2-AR3

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]undo ip route-static 172.16.30.0 24
[Huawei]display ip rout	
[Huawei]display ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 13       Routes : 13       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     10.10.12.0/24  Direct  0    0           D   10.10.12.1      GigabitEthernet
0/0/2
     10.10.12.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
   10.10.12.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
     10.10.14.0/24  Direct  0    0           D   10.10.14.1      GigabitEthernet
0/0/1
     10.10.14.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
   10.10.14.255/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
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    172.16.10.0/24  Direct  0    0           D   172.16.10.1     GigabitEthernet
0/0/0
    172.16.10.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
  172.16.10.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[Huawei]ip route-static 0.0.0.0 0 10.10.12.2
[Huawei]display ip routing-table pr	
[Huawei]display ip routing-table protocol s	
[Huawei]display ip routing-table protocol static 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : Static
         Destinations : 1        Routes : 1        Configured Routes : 1

Static routing table status : <Active>
         Destinations : 1        Routes : 1

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        0.0.0.0/0   Static  60   0          RD   10.10.12.2      GigabitEthernet
0/0/2

Static routing table status : <Inactive>
         Destinations : 0        Routes : 0

[Huawei]



<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]undo ip route-sta	
[Huawei]undo ip route-static 172.16.10.0 24 
[Huawei]displ	
[Huawei]display ip r	
[Huawei]display ip rd-filter
[Huawei]display ip rout	
[Huawei]display ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 13       Routes : 13       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     10.10.23.0/24  Direct  0    0           D   10.10.23.3      GigabitEthernet
0/0/2
     10.10.23.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
   10.10.23.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
     10.10.34.0/24  Direct  0    0           D   10.10.34.3      GigabitEthernet
0/0/1
     10.10.34.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
   10.10.34.255/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
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    172.16.30.0/24  Direct  0    0           D   172.16.30.3     GigabitEthernet
0/0/0
    172.16.30.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
  172.16.30.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[Huawei]display ip routing-table pro	
[Huawei]display ip routing-table protocol static
[Huawei]ip route-stat	
[Huawei]ip route-static 0.0.0.0 0 10.10.23.2
[Huawei]

AR1-AR4-AR3

# AR1
[Huawei]ip route-static 0.0.0.0 0 10.10.14.4
[Huawei]display ip routing-table protocol static
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : Static
         Destinations : 1        Routes : 2        Configured Routes : 2

Static routing table status : <Active>
         Destinations : 1        Routes : 2

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        0.0.0.0/0   Static  60   0          RD   10.10.12.2      GigabitEthernet
0/0/2
                    Static  60   0          RD   10.10.14.4      GigabitEthernet
0/0/1

Static routing table status : <Inactive>
         Destinations : 0        Routes : 0

[Huawei]

# AR3

[Huawei]ip route-static 0.0.0.0 0 10.10.34.4 
[Huawei]display ip routing-able protocol static
                   ^
Error: Unrecognized command found at '^' position.
[Huawei]display ip routing-table protocol static
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : Static
         Destinations : 1        Routes : 2        Configured Routes : 2

Static routing table status : <Active>
         Destinations : 1        Routes : 2

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        0.0.0.0/0   Static  60   0          RD   10.10.23.2      GigabitEthernet
0/0/2
                    Static  60   0          RD   10.10.34.4      GigabitEthernet
0/0/1

Static routing table status : <Inactive>
         Destinations : 0        Routes : 0

[Huawei]


PC2 tracert PC1


# AR2 AR4 都开着
PC>tracert 172.16.10.10

traceroute to 172.16.10.10, 8 hops max
(ICMP), press Ctrl+C to stop
 1  172.16.30.3   31 ms  <1 ms  16 ms
 2  10.10.23.2   31 ms  31 ms  16 ms
 3  10.10.12.1   31 ms  16 ms  31 ms
 4  172.16.10.10   16 ms  31 ms  16 ms

# 关闭AR2

PC>tracert 172.16.10.10

traceroute to 172.16.10.10, 8 hops max
(ICMP), press Ctrl+C to stop
 1  172.16.30.3   16 ms  <1 ms  16 ms
 2  10.10.34.4   15 ms  16 ms  15 ms
 3  10.10.14.1   16 ms  31 ms  16 ms
 4    *172.16.10.10   31 ms  31 ms

PC>

  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
HCIA-Datacom网络技术学习指南是华为网络学院提供的一份指导学习HCIA-Datacom网络技术的资料。HCIA-Datacom是华为认证的网络技术专业认证之一,通过该认证可以证明学员掌握了网络数据通信的基本知识和技能。 该指南内容主要包括以下几个方面: 1. 学习目标:明确学习HCIA-Datacom的目标,帮助学员了解认证的意义和用途,激发学员的学习动机。 2. 学习路径:提供合理的学习路径,帮助学员规划学习时间和学习资源,让学员能够系统地学习网络数据通信的相关知识。 3. 学习内容:详细介绍网络数据通信的基本原理、网络技术的分类和应用场景等内容,帮助学员建立起整体的网络数据通信知识体系。 4. 实践环节:通过设计实际案例和实验,让学员通过实践来巩固和应用所学的知识,提高学员的实践能力。 5. 学习资源:提供大量的学习资源,包括教学视频、教材、案例分析等,帮助学员在学习过程中深入理解网络数据通信的概念和技术。 6. 学习评估:通过测试和测评,及时发现学员的学习进度和水平,帮助学员巩固知识并及时调整学习计划。 学习HCIA-Datacom网络技术需要一定的基础知识,如计算机基础、网络基础等,但指南也鼓励初学者根据自身情况进行学习。同时,指南强调学习网络技术不只是为了获得证书,更是为了提高自己的能力和就业竞争力。 总之,该指南是一份非常有价值的学习资料,可以帮助学员系统地学习和掌握HCIA-Datacom网络技术,为以后的职业发展奠定坚实的基础。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值