静态路由实验

实验要求:

r1:


<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys r1
[r1]user-i
[r1]user-interface c
[r1]user-interface console 0
[r1-ui-console0]id
[r1-ui-console0]idle-timeout 0 0
[r1-ui-console0]q
[r1]in g 0/0/0
[r1-GigabitEthernet0/0/0]ip add int 12.1.1.1 24
                                ^
Error: Wrong parameter found at '^' position.
[r1-GigabitEthernet0/0/0]ip add 12.1.1.1 24
[r1-GigabitEthernet0/0/0]
Jan  4 2023 21:49:57-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r1-GigabitEthernet0/0/0]q
[r1]int g 0/0/1
[r1-GigabitEthernet0/0/1]ip add 14.1.1.2 24
Jan  4 2023 21:51:31-08:00 r1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface GigabitEthernet0/0/1 has entered the UP state. 
[r1-GigabitEthernet0/0/1]q
[r1]int
[r1]interface l 
[r1]interface LoopBack 0
[r1-LoopBack0]ip add 1.1.1.1 24
[r1-LoopBack0]dis ip int bri
*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 1
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 1

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              12.1.1.1/24          up         up        
GigabitEthernet0/0/1              14.1.1.2/24          up         up        
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         1.1.1.1/24           up         up(s)     
NULL0                             unassigned           up         up(s)     
[r1-LoopBack0]q
[r1]ip r
[r1]ip ro       
[r1]ip route-static 2.2.2.2 24 12.1.1.2
Info: The destination address and mask of the configured static route mismatched, and the static route 2.2.2.0/24 was generated.
[r1]ping 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=255 time=100 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=30 ms
    Reply from 2.2.2.2: bytes=56 Sequence=4 ttl=255 time=20 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/38/100 ms

[r1]ip ro
[r1]ip route
[r1]ip route-static 23.1.1.0 24 12.1.1.2
[r1]ping 23.1.1.1
  PING 23.1.1.1: 56  data bytes, press CTRL_C to break
    Reply from 23.1.1.1: bytes=56 Sequence=1 ttl=255 time=30 ms
    Reply from 23.1.1.1: bytes=56 Sequence=2 ttl=255 time=30 ms
    Reply from 23.1.1.1: bytes=56 Sequence=3 ttl=255 time=30 ms
    Reply from 23.1.1.1: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 23.1.1.1: bytes=56 Sequence=5 ttl=255 time=20 ms

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

[r1]ip rou     
[r1]ip route
[r1]ip route        
[r1]ip route
[r1]ping 23.1.1.2  
  PING 23.1.1.2: 56  data bytes, press CTRL_C to break
    Request time out
    Reply from 23.1.1.2: bytes=56 Sequence=2 ttl=254 time=60 ms
    Reply from 23.1.1.2: bytes=56 Sequence=3 ttl=254 time=40 ms
    Reply from 23.1.1.2: bytes=56 Sequence=4 ttl=254 time=30 ms
    Reply from 23.1.1.2: bytes=56 Sequence=5 ttl=254 time=30 ms

  --- 23.1.1.2 ping statistics ---
    5 packet(s) transmitted
    4 packet(s) received
    20.00% packet loss
    round-trip min/avg/max = 30/40/60 ms

[r1]ip rou
[r1]ip route
[r1]ip route-static 3.3.3.3 24 12.1.1.2
Info: The destination address and mask of the configured static route mismatched, and the static route 3.3.3.0/24 was generated.
[r1]ping 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=254 time=30 ms
    Reply from 3.3.3.3: bytes=56 Sequence=2 ttl=254 time=30 ms
    Reply from 3.3.3.3: bytes=56 Sequence=3 ttl=254 time=40 ms
    Reply from 3.3.3.3: bytes=56 Sequence=4 ttl=254 time=30 ms
    Reply from 3.3.3.3: bytes=56 Sequence=5 ttl=254 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 = 30/32/40 ms

[r1]ip rou
[r1]ip route
[r1]ip route-static 4.4.4.4 24 14.1.1.1
Info: The destination address and mask of the configured static route mismatched, and the static route 4.4.4.0/24 was generated.
[r1]ping 4.4.4.4
  PING 4.4.4.4: 56  data bytes, press CTRL_C to break
    Reply from 4.4.4.4: bytes=56 Sequence=1 ttl=255 time=130 ms
    Reply from 4.4.4.4: bytes=56 Sequence=2 ttl=255 time=30 ms
    Reply from 4.4.4.4: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 4.4.4.4: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 4.4.4.4: bytes=56 Sequence=5 ttl=255 time=20 ms

  --- 4.4.4.4 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/44/130 ms

[r1]ip rou
[r1]ip route
[r1]ip route-static 34.1.1.0 24 14.1.1.1
[r1]ping 34.1.1.2
  PING 34.1.1.2: 56  data bytes, press CTRL_C to break
    Reply from 34.1.1.2: bytes=56 Sequence=1 ttl=255 time=30 ms
    Reply from 34.1.1.2: bytes=56 Sequence=2 ttl=255 time=30 ms
    Reply from 34.1.1.2: bytes=56 Sequence=3 ttl=255 time=30 ms
    Reply from 34.1.1.2: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 34.1.1.2: bytes=56 Sequence=5 ttl=255 time=30 ms

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

[r1]ping 34.1.1.1
  PING 34.1.1.1: 56  data bytes, press CTRL_C to break
    Request time out
    Reply from 34.1.1.1: bytes=56 Sequence=2 ttl=254 time=20 ms
    Reply from 34.1.1.1: bytes=56 Sequence=3 ttl=254 time=20 ms
    Reply from 34.1.1.1: bytes=56 Sequence=4 ttl=254 time=40 ms
    Reply from 34.1.1.1: bytes=56 Sequence=5 ttl=254 time=30 ms

  --- 34.1.1.1 ping statistics ---
    5 packet(s) transmitted
    4 packet(s) received
    20.00% packet loss
    round-trip min/avg/max = 20/27/40 ms

[r1]dis ip ro
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 18       Routes : 18       

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
      1.1.1.255/32  Direct  0    0           D   127.0.0.1       LoopBack0
        2.2.2.0/24  Static  60   0          RD   12.1.1.2        GigabitEthernet0/0/0
        3.3.3.0/24  Static  60   0          RD   12.1.1.2        GigabitEthernet0/0/0
        4.4.4.0/24  Static  60   0          RD   14.1.1.1        GigabitEthernet0/0/1
       12.1.1.0/24  Direct  0    0           D   12.1.1.1        GigabitEthernet0/0/0
       12.1.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0
     12.1.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0
       14.1.1.0/24  Direct  0    0           D   14.1.1.2        GigabitEthernet0/0/1
       14.1.1.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/1
     14.1.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/1
       23.1.1.0/24  Static  60   0          RD   12.1.1.2        GigabitEthernet0/0/0
       34.1.1.0/24  Static  60   0          RD   14.1.1.1        GigabitEthernet0/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
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[r1]

r2:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys r2
[r2]user-in
[r2]user-interface c
[r2]user-interface console 0
[r2-ui-console0]is
[r2-ui-console0]id
[r2-ui-console0]idle-timeout 0 0 
[r2-ui-console0]q
[r2]int g 0/0/1
[r2-GigabitEthernet0/0/1]ip add 12.1.1.2 24
Jan  4 2023 21:53:57-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface GigabitEthernet0/0/1 has entered the UP state. 
[r2-GigabitEthernet0/0/1]q
[r2]int g 0/0/0
[r2-GigabitEthernet0/0/0]ip add 23.1.1.1 24
Jan  4 2023 21:55:01-08:00 r2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r2-GigabitEthernet0/0/0]q
[r2]int l
[r2]int LoopBack 0
[r2-LoopBack0]ip add 2.2.2.2 24
[r2-LoopBack0]q
[r2]dis ip int b
*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 1
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 1

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              23.1.1.1/24          up         up        
GigabitEthernet0/0/1              12.1.1.2/24          up         up        
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         2.2.2.2/24           up         up(s)     
NULL0                             unassigned           up         up(s)     
[r2]ip rou
[r2]ip route
[r2]ip route-static 3.3.3.3 24 23.1.1.2
Info: The destination address and mask of the configured static route mismatched, and the static route 3.3.3.0/24 was generated.
[r2]ping 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=30 ms
    Reply from 3.3.3.3: bytes=56 Sequence=3 ttl=255 time=40 ms
    Reply from 3.3.3.3: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 3.3.3.3: bytes=56 Sequence=5 ttl=255 time=40 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/28/40 ms

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

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

[r2]ip rou
[r2]ip route
[r2]ip route-static 1.1.1.1 24 12.1.1.1
Info: The destination address and mask of the configured static route mismatched, and the static route 1.1.1.0/24 was generated.
[r2]ping 1.1.1.1
  PING 1.1.1.1: 56  data bytes, press CTRL_C to break
    Reply from 1.1.1.1: bytes=56 Sequence=1 ttl=255 time=30 ms
    Reply from 1.1.1.1: bytes=56 Sequence=2 ttl=255 time=30 ms
    Reply from 1.1.1.1: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 1.1.1.1: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 1.1.1.1: bytes=56 Sequence=5 ttl=255 time=20 ms

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

[r2]ip rou
[r2]ip route
[r2]ip route-static 34.1.1.0 24 23.1.1.2
[r2]ping 34.1.1.1
  PING 34.1.1.1: 56  data bytes, press CTRL_C to break
    Reply from 34.1.1.1: bytes=56 Sequence=1 ttl=255 time=10 ms
    Reply from 34.1.1.1: bytes=56 Sequence=2 ttl=255 time=20 ms
    Reply from 34.1.1.1: bytes=56 Sequence=3 ttl=255 time=30 ms
    Reply from 34.1.1.1: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 34.1.1.1: bytes=56 Sequence=5 ttl=255 time=20 ms

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

[r2]ping 34.1.1.2
  PING 34.1.1.2: 56  data bytes, press CTRL_C to break
    Reply from 34.1.1.2: bytes=56 Sequence=1 ttl=254 time=30 ms
    Reply from 34.1.1.2: bytes=56 Sequence=2 ttl=254 time=30 ms
    Reply from 34.1.1.2: bytes=56 Sequence=3 ttl=254 time=40 ms
    Reply from 34.1.1.2: bytes=56 Sequence=4 ttl=254 time=30 ms
    Reply from 34.1.1.2: bytes=56 Sequence=5 ttl=254 time=40 ms

  --- 34.1.1.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 30/34/40 ms

[r2]ip rou
[r2]ip route
[r2]ip route-static 4.4.4.4 24 23.1.1.2
Info: The destination address and mask of the configured static route mismatched, and the static route 4.4.4.0/24 was generated.
[r2]ping 4.4.4.4
  PING 4.4.4.4: 56  data bytes, press CTRL_C to break
    Request time out
    Request time out
    Request time out
    Request time out
    Request time out

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

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

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

[r2]ip r
[r2]ip ro       
[r2]ip route-static
[r2]ip route
[r2]ip route-static 14.1.1.0 24 12.1.1.1
[r2]ping 14.1.1.2
  PING 14.1.1.2: 56  data bytes, press CTRL_C to break
    Reply from 14.1.1.2: bytes=56 Sequence=1 ttl=255 time=20 ms
    Reply from 14.1.1.2: bytes=56 Sequence=2 ttl=255 time=20 ms
    Reply from 14.1.1.2: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 14.1.1.2: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 14.1.1.2: bytes=56 Sequence=5 ttl=255 time=20 ms

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

[r2]ping 14.1.1.1
  PING 14.1.1.1: 56  data bytes, press CTRL_C to break
    Reply from 14.1.1.1: bytes=56 Sequence=1 ttl=254 time=30 ms
    Reply from 14.1.1.1: bytes=56 Sequence=2 ttl=254 time=50 ms
    Reply from 14.1.1.1: bytes=56 Sequence=3 ttl=254 time=20 ms
    Reply from 14.1.1.1: bytes=56 Sequence=4 ttl=254 time=40 ms
    Reply from 14.1.1.1: bytes=56 Sequence=5 ttl=254 time=10 ms

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

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

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        1.1.1.0/24  Static  60   0          RD   12.1.1.1        GigabitEthernet0/0/1
        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
      2.2.2.255/32  Direct  0    0           D   127.0.0.1       LoopBack0
        3.3.3.0/24  Static  60   0          RD   23.1.1.2        GigabitEthernet0/0/0
        4.4.4.0/24  Static  60   0          RD   23.1.1.2        GigabitEthernet0/0/0
       12.1.1.0/24  Direct  0    0           D   12.1.1.2        GigabitEthernet0/0/1
       12.1.1.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/1
     12.1.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/1
       14.1.1.0/24  Static  60   0          RD   12.1.1.1        GigabitEthernet0/0/1
       23.1.1.0/24  Direct  0    0           D   23.1.1.1        GigabitEthernet0/0/0
       23.1.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0
     23.1.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0
       34.1.1.0/24  Static  60   0          RD   23.1.1.2        GigabitEthernet0/0/0
      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

[r2]

r3:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys r3
[r3]user-i
[r3]user-interface c
[r3]user-interface console 0
[r3-ui-console0]id
[r3-ui-console0]idle-timeout 0 0
[r3-ui-console0]q
[r3]int g 0/0/1
[r3-GigabitEthernet0/0/1]ip add 23.1.1.2 24
[r3-GigabitEthernet0/0/1]
Jan  4 2023 21:57:37-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface GigabitEthernet0/0/1 has entered the UP state. 
[r3-GigabitEthernet0/0/1]q
[r3]int g 0/0/0
[r3-GigabitEthernet0/0/0]ip add 34.1.1.1 24
[r3-GigabitEthernet0/0/0]
Jan  4 2023 21:58:17-08:00 r3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r3-GigabitEthernet0/0/0]q
[r3]int l
[r3]int LoopBack 0
[r3-LoopBack0]ip add 3.3.3.3 24 
[r3-LoopBack0]q
[r3]dis ip int b
*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 1
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 1

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              34.1.1.1/24          up         up        
GigabitEthernet0/0/1              23.1.1.2/24          up         up        
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         3.3.3.3/24           up         up(s)     
NULL0                             unassigned           up         up(s)     
[r3]ip ro
[r3]ip route
[r3]ip route-static 12.1.1.0 24 23.1.1.1
[r3]ip rou
[r3]ip route
[r3]ip route-static 14.1.1.0 24 34.1.1.2
[r3]ip rou
[r3]ip route
[r3]ip route-static 4.4.4.4 24 34.1.1.2
Info: The destination address and mask of the configured static route mismatched, and the static route 4.4.4.0/24 was generated.
[r3]ping 4.4.4.4
  PING 4.4.4.4: 56  data bytes, press CTRL_C to break
    Reply from 4.4.4.4: bytes=56 Sequence=1 ttl=255 time=40 ms
    Reply from 4.4.4.4: bytes=56 Sequence=2 ttl=255 time=20 ms
    Reply from 4.4.4.4: bytes=56 Sequence=3 ttl=255 time=30 ms
    Reply from 4.4.4.4: bytes=56 Sequence=4 ttl=255 time=30 ms
    Reply from 4.4.4.4: bytes=56 Sequence=5 ttl=255 time=30 ms

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

[r3]ip ro
[r3]ip route
[r3]ip route-static 14.1.1.0 24 34.1.1.2
Error: The route already exists.
[r3]ping 14.1.1.1
  PING 14.1.1.1: 56  data bytes, press CTRL_C to break
    Reply from 14.1.1.1: bytes=56 Sequence=1 ttl=255 time=30 ms
    Reply from 14.1.1.1: bytes=56 Sequence=2 ttl=255 time=20 ms
    Reply from 14.1.1.1: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 14.1.1.1: bytes=56 Sequence=4 ttl=255 time=30 ms
    Reply from 14.1.1.1: bytes=56 Sequence=5 ttl=255 time=20 ms

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

[r3]ip ro
[r3]ip route
[r3]ip route-static 2.2.2.2 24 23.1.1.1
Info: The destination address and mask of the configured static route mismatched, and the static route 2.2.2.0/24 was generated.
[r3]ping 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=255 time=20 ms
    Reply from 2.2.2.2: bytes=56 Sequence=2 ttl=255 time=30 ms
    Reply from 2.2.2.2: bytes=56 Sequence=3 ttl=255 time=30 ms
    Reply from 2.2.2.2: bytes=56 Sequence=4 ttl=255 time=20 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/24/30 ms

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

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

[r3]ip ro    
[r3]ip route
[r3]ip route-static 1.1.1.1 24 34.1.1.2
Info: The destination address and mask of the configured static route mismatched, and the static route 1.1.1.0/24 was generated.
[r3]ping 1.1.1.1
  PING 1.1.1.1: 56  data bytes, press CTRL_C to break
    Reply from 1.1.1.1: bytes=56 Sequence=1 ttl=254 time=40 ms
    Reply from 1.1.1.1: bytes=56 Sequence=2 ttl=254 time=30 ms
    Reply from 1.1.1.1: bytes=56 Sequence=3 ttl=254 time=30 ms
    Reply from 1.1.1.1: bytes=56 Sequence=4 ttl=254 time=30 ms
    Reply from 1.1.1.1: bytes=56 Sequence=5 ttl=254 time=30 ms

  --- 1.1.1.1 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 30/32/40 ms

[r3]ping 14.1.1.2
  PING 14.1.1.2: 56  data bytes, press CTRL_C to break
    Reply from 14.1.1.2: bytes=56 Sequence=1 ttl=254 time=30 ms
    Reply from 14.1.1.2: bytes=56 Sequence=2 ttl=254 time=30 ms
    Reply from 14.1.1.2: bytes=56 Sequence=3 ttl=254 time=30 ms
    Reply from 14.1.1.2: bytes=56 Sequence=4 ttl=254 time=50 ms
    Reply from 14.1.1.2: bytes=56 Sequence=5 ttl=254 time=30 ms

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

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

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

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

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

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

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        1.1.1.0/24  Static  60   0          RD   34.1.1.2        GigabitEthernet0/0/0
        2.2.2.0/24  Static  60   0          RD   23.1.1.1        GigabitEthernet0/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
      3.3.3.255/32  Direct  0    0           D   127.0.0.1       LoopBack0
        4.4.4.0/24  Static  60   0          RD   34.1.1.2        GigabitEthernet0/0/0
       12.1.1.0/24  Static  60   0          RD   23.1.1.1        GigabitEthernet0/0/1
       14.1.1.0/24  Static  60   0          RD   34.1.1.2        GigabitEthernet0/0/0
       23.1.1.0/24  Direct  0    0           D   23.1.1.2        GigabitEthernet0/0/1
       23.1.1.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/1
     23.1.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/1
       34.1.1.0/24  Direct  0    0           D   34.1.1.1        GigabitEthernet0/0/0
       34.1.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0
     34.1.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0
      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

[r3]

r4:

<r1>sys
Enter system view, return user view with Ctrl+Z.
[r1]sys r4
[r4]user-i
[r4]user-interface c
[r4]user-interface console 0
[r4-ui-console0]id
[r4-ui-console0]idle-timeout 0 0
[r4-ui-console0]q
[r4]int g 0/0/1
[r4-GigabitEthernet0/0/1]ip add 34.1.1.2 24
Jan  4 2023 22:00:22-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface GigabitEthernet0/0/1 has entered the UP state. 
[r4-GigabitEthernet0/0/1]q
[r4]int g 0/0/0
[r4-GigabitEthernet0/0/0]ip add 14.1.1.1 24
Jan  4 2023 22:00:58-08:00 r4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r4-GigabitEthernet0/0/0]q
[r4]int l
[r4]int LoopBack 0
[r4-LoopBack0]ip add 4.4.4.4 24
[r4-LoopBack0]q
[r4]dis ip int b
*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 1
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 1

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              14.1.1.1/24          up         up        
GigabitEthernet0/0/1              34.1.1.2/24          up         up        
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         4.4.4.4/24           up         up(s)     
NULL0                             unassigned           up         up(s)     
[r4]
[r4]ip rou
[r4]ip route
[r4]ip route-static 23.1.1.0 24 34.1.1.1 
[r4]ping 23.1.1.2
  PING 23.1.1.2: 56  data bytes, press CTRL_C to break
    Reply from 23.1.1.2: bytes=56 Sequence=1 ttl=255 time=20 ms
    Reply from 23.1.1.2: bytes=56 Sequence=2 ttl=255 time=30 ms
    Reply from 23.1.1.2: bytes=56 Sequence=3 ttl=255 time=40 ms
    Reply from 23.1.1.2: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 23.1.1.2: bytes=56 Sequence=5 ttl=255 time=20 ms

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

[r4]ip ro
[r4]ip route
[r4]ip route-static 12.1.1.0 24 14.1.1.2
[r4]ping 12.1.1.1
  PING 12.1.1.1: 56  data bytes, press CTRL_C to break
    Reply from 12.1.1.1: bytes=56 Sequence=1 ttl=255 time=20 ms
    Reply from 12.1.1.1: bytes=56 Sequence=2 ttl=255 time=20 ms
    Reply from 12.1.1.1: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 12.1.1.1: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 12.1.1.1: bytes=56 Sequence=5 ttl=255 time=30 ms

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

[r4]ping 1.1.1.1 24 14.1.1.2
                 ^
Error:Too many parameters found at '^' position.
[r4]ip rou
[r4]ip route
[r4]ip route-static 1.1.1.1 24 14.1.1.2
Info: The destination address and mask of the configured static route mismatched, and the static route 1.1.1.0/24 was generated.
[r4]ping 1.1.1.1
  PING 1.1.1.1: 56  data bytes, press CTRL_C to break
    Reply from 1.1.1.1: bytes=56 Sequence=1 ttl=255 time=20 ms
    Reply from 1.1.1.1: bytes=56 Sequence=2 ttl=255 time=30 ms
    Reply from 1.1.1.1: bytes=56 Sequence=3 ttl=255 time=30 ms
    Reply from 1.1.1.1: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 1.1.1.1: bytes=56 Sequence=5 ttl=255 time=20 ms

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

[r4]ip ro
[r4]ip route
[r4]ip route-static 2.2.2.2 24 14.1.1.2
Info: The destination address and mask of the configured static route mismatched, and the static route 2.2.2.0/24 was generated.
[r4]ping 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=40 ms
    Reply from 2.2.2.2: bytes=56 Sequence=2 ttl=254 time=40 ms
    Reply from 2.2.2.2: bytes=56 Sequence=3 ttl=254 time=30 ms
    Reply from 2.2.2.2: bytes=56 Sequence=4 ttl=254 time=30 ms
    Reply from 2.2.2.2: bytes=56 Sequence=5 ttl=254 time=30 ms

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

[r4]ip ro 
[r4]ip route
[r4]ip route-static 3.3.3.3 24 34.1.1.1
Info: The destination address and mask of the configured static route mismatched, and the static route 3.3.3.0/24 was generated.
[r4]ping 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=30 ms
    Reply from 3.3.3.3: bytes=56 Sequence=3 ttl=255 time=10 ms
    Reply from 3.3.3.3: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 3.3.3.3: bytes=56 Sequence=5 ttl=255 time=20 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/20/30 ms

[r4]ping 12.1.1.2
  PING 12.1.1.2: 56  data bytes, press CTRL_C to break
    Reply from 12.1.1.2: bytes=56 Sequence=1 ttl=254 time=30 ms
    Reply from 12.1.1.2: bytes=56 Sequence=2 ttl=254 time=30 ms
    Reply from 12.1.1.2: bytes=56 Sequence=3 ttl=254 time=30 ms
    Reply from 12.1.1.2: bytes=56 Sequence=4 ttl=254 time=30 ms
    Reply from 12.1.1.2: bytes=56 Sequence=5 ttl=254 time=40 ms

  --- 12.1.1.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 30/32/40 ms

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

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

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

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

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

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        1.1.1.0/24  Static  60   0          RD   14.1.1.2        GigabitEthernet0/0/0
        2.2.2.0/24  Static  60   0          RD   14.1.1.2        GigabitEthernet0/0/0
        3.3.3.0/24  Static  60   0          RD   34.1.1.1        GigabitEthernet0/0/1
        4.4.4.0/24  Direct  0    0           D   4.4.4.4         LoopBack0
        4.4.4.4/32  Direct  0    0           D   127.0.0.1       LoopBack0
      4.4.4.255/32  Direct  0    0           D   127.0.0.1       LoopBack0
       12.1.1.0/24  Static  60   0          RD   14.1.1.2        GigabitEthernet0/0/0
       14.1.1.0/24  Direct  0    0           D   14.1.1.1        GigabitEthernet0/0/0
       14.1.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0
     14.1.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0
       23.1.1.0/24  Static  60   0          RD   34.1.1.1        GigabitEthernet0/0/1
       34.1.1.0/24  Direct  0    0           D   34.1.1.2        GigabitEthernet0/0/1
       34.1.1.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/1
     34.1.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/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
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[r4]

每串代码最下面就是路由表,结果。

我的拓扑:

修改:r1,r2,r3,r4上配置其他地址改如r1配置r2地址:ip route-static 2.2.2.0 24 12.1.1.2其他同理

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值