IP相关问题2---静态路由综合实验

网络部署思路

1.拓扑设计 ip地址规划

2.拓扑搭建

3.配置

①底层所有节点有合法ip

②路由全网可达

③策略 --优化 规则 安全

④测试 --排错

⑤升级 --割接

1.ip地址规划

1.根据题目分析得出需要6个子网,要借三位

2.R1、R2、R4分别有两个环回需要再分

3.骨干需要再分6个

192.168.1.0/24

192.168.1.000 00000/27 192.168.1.0/27 骨干

192.168.1.000000 00/30 192.168.1.0/30

192.168.1.000001 00/30 192.168.1.4/30

192.168.1.000010 00/30 192.168.1.8/30

192.168.1.000011 00/30 192.168.1.12/30

192.168.1.000100 00/30 192.168.1.16/30

192.168.1.000101 00/30 192.168.1.20/30

192.168.1.000110 00/30 192.168.1.24/30

192.168.1.000111 00/30 192.168.1.28/30

192.168.1.001 00000/27 192.168.1.32/27 R1

192.168.1.0010 0000/28 192.168.1.32/28

192.168.1.0011 0000/28 192.168.1.48/28

192.168.1.010 00000/27 192.168.1.64/27 R2

192.168.1.0100 0000/28 192.168.1.64/28

192.168.1.0101 0000/28 192.168.1.80/28

192.168.1.011 00000/27 192.168.1.96/27 R3

192.168.1.100 00000/27 192.168.1.128/27 R4

192.168.1.1000 0000/27 192.168.1.128/28

192.168.1.1001 0000/27 192.168.1.144/28

192.168.1.101 00000/27 192.168.1.160/27 R5

192.168.1.110 00000/27 192.168.1.192/27

192.168.1.111 00000/27 192.168.1.224/27

2.配置ip

1.配置所有环回的ip

1.R1的环回

<Huawei>system-view 
[Huawei]sysname r1
[r1]interface LoopBack 0
[r1-LoopBack0]ip add 192.168.1.33 28
[r1]interface  LoopBack 1
[r1-LoopBack1]ip add 192.168.1.29 28

2.R2的环回

<Huawei>system-view 	
[Huawei]sysname r2
[r2]interface LoopBack 0
[r2-LoopBack0]ip add 192.168.1.65 28
[r2-LoopBack0]q
[r2]interface LoopBack 1
[r2-LoopBack1]ip add 192.168.1.81 28

3.R3的地址

<Huawei>system-view 
[Huawei]sysname r3
[r3]interface GigabitEthernet 0/0/2
[r3-GigabitEthernet0/0/2]ip add 192.168.1.97 27
Aug  3 2023 21:14:18-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/2 has entered the UP state. 

4.R4的环回

<Huawei>system-view 
[Huawei]sysname r4	
[r4]interface LoopBack 0
[r4-LoopBack0]ip add 192.168.1.129 28
[r4-LoopBack0]q	
[r4]interface LoopBack 1
[r4-LoopBack1]ip add 192.168.1.145 28

5.R5的环回

<Huawei>system-view 	
[Huawei]sysname r5	
[r5]interface LoopBack 0
[r5-LoopBack0]ip add 192.168.1.161 27

6.R6的环回

<Huawei>system-view 	
[Huawei]sysname r6	
[r6]interface LoopBack 0
[r6-LoopBack0]ip add 6.6.6.6 24

2.配置所有骨干的ip

1.R1的ip

<r1>system-view 
[r1]interface GigabitEthernet 0/0/1
[r1-GigabitEthernet0/0/1]ip add 192.168.1.5 30
Aug  3 2023 21:34:36-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[r1-GigabitEthernet0/0/1]q
[r1]interface GigabitEthernet 0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 30
Aug  3 2023 21:36:12-08:00 r1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 

2.R2的ip

<r2>system-view 
Enter system view, return user view with Ctrl+Z.
[r2]interface GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.1.2 30
Aug  3 2023 21:39:49-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r2-GigabitEthernet0/0/0]q
[r2]interface GigabitEthernet 0/0/1
[r2-GigabitEthernet0/0/1]ip add 192.168.1.9 30
Aug  3 2023 21:40:54-08:00 r2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 

3.R3的ip

<r3>system-view 
Enter system view, return user view with Ctrl+Z.
[r3]interface GigabitEthernet 0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.1.6 30
Aug  3 2023 21:42:54-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r3-GigabitEthernet0/0/0]q
[r3]interface GigabitEthernet 0/0/1
[r3-GigabitEthernet0/0/1]ip add 192.168.1.13 30
Aug  3 2023 21:43:30-08:00 r3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 

4.R4的ip

<r4>system-view 
Enter system view, return user view with Ctrl+Z.
[r4]interface GigabitEthernet 0/0/0
[r4-GigabitEthernet0/0/0]ip add 192.168.1.10 30
Aug  3 2023 21:45:19-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r4-GigabitEthernet0/0/0]q
[r4]interface GigabitEthernet 0/0/1
[r4-GigabitEthernet0/0/1]ip add 192.168.1.14 30
Aug  3 2023 21:45:55-08:00 r4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[r4]interface GigabitEthernet 0/0/2
[r4-GigabitEthernet0/0/2]ip add 192.168.1.21 30
Aug  3 2023 21:49:23-08:00 r4 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP 
on the interface GigabitEthernet0/0/2 has entered the UP state. 
[r4-GigabitEthernet0/0/2]q
[r4]interface Ethernet 4/0/0
[r4-Ethernet4/0/0]ip add 192.168.1.17 30
Aug  3 2023 21:52:33-08:00 r4 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP 
on the interface Ethernet4/0/0 has entered the UP state. 
[r4-Ethernet4/0/0]

5.R5的ip

<r5>system-view 
Enter system view, return user view with Ctrl+Z.
[r5]interface GigabitEthernet 0/0/0
[r5-GigabitEthernet0/0/0]ip address 192.168.1.22 30
Aug  3 2023 22:03:21-08:00 r5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r5-GigabitEthernet0/0/0]q
[r5]interface GigabitEthernet 0/0/1 
[r5-GigabitEthernet0/0/1]ip add 192.168.1.18 30
Aug  3 2023 22:04:57-08:00 r5 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[r5-GigabitEthernet0/0/1]q
[r5]interface GigabitEthernet 0/0/2
[r5-GigabitEthernet0/0/2]ip add 56.1.1.1 24
Aug  3 2023 22:05:55-08:00 r5 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP 
on the interface GigabitEthernet0/0/2 has entered the UP state. 

6.R6的ip

<r6>system-view 
[r6]interface GigabitEthernet 0/0/0
[r6-GigabitEthernet0/0/0]ip add 56.1.1.2 24
Aug  3 2023 22:08:21-08:00 r6 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 

3.用dhcp给pc1和pc2配置ip

[r3]dhcp enable 
Info: The operation may take a few seconds. Please wait for a moment.done.
[r3]ip pool a
Info: It's successful to create an IP address pool.
[r3-ip-pool-a]network 192.168.1.96 mask 27
[r3-ip-pool-a]gateway-list 192.168.1.97
[r3-ip-pool-a]dns-list 114.114.114.114 8.8.8.8
[r3-ip-pool-a]q
[r3]interface GigabitEthernet 0/0/2
[r3-GigabitEthernet0/0/2]dhcp select global

1.pc1的配置

2.pc2的配置

3.检验设备是否出错

1.R1pingR2 R3

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.1.1/30       up         up        
GigabitEthernet0/0/1              192.168.1.5/30       up         up        
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         192.168.1.33/28      up         up(s)     
LoopBack1                         192.168.1.49/28      up         up(s)     
NULL0                             unassigned           up         up(s) 

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

  --- 192.168.1.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 1/36/120 ms

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

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

  

2.R4 ping R2 R3 R5

Interface                         IP Address/Mask      Physical   Protocol  
Ethernet4/0/0                     192.168.1.17/30      up         up        
Ethernet4/0/1                     unassigned           down       down      
GigabitEthernet0/0/0              192.168.1.10/30      up         up        
GigabitEthernet0/0/1              192.168.1.14/30      up         up        
GigabitEthernet0/0/2              192.168.1.21/30      up         up        
LoopBack0                         192.168.1.129/28     up         up(s)     
LoopBack1                         192.168.1.145/28     up         up(s)     
NULL0                             unassigned           up         up(s)    

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

  --- 192.168.1.18 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 30/62/180 ms

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

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

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

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

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

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

3.R5 ping R6

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.1.22/30      up         up        
GigabitEthernet0/0/1              192.168.1.18/30      up         up        
GigabitEthernet0/0/2              56.1.1.1/24          up         up        
LoopBack0                         192.168.1.161/27     up         up(s)     
NULL0                             unassigned           up         up(s)     
[r5]ping 56.1.1.2
  PING 56.1.1.2: 56  data bytes, press CTRL_C to break
    Reply from 56.1.1.2: bytes=56 Sequence=1 ttl=255 time=160 ms
    Reply from 56.1.1.2: bytes=56 Sequence=2 ttl=255 time=20 ms
    Reply from 56.1.1.2: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 56.1.1.2: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 56.1.1.2: bytes=56 Sequence=5 ttl=255 time=30 ms

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

4.配置路由 --全网可达

1.配置缺省路由(先写缺省,路由可变得更少)

<r5>system-view 
Enter system view, return user view with Ctrl+Z.
[r5]ip route-static 0.0.0.0 0 56.1.1.2

	
<r4>system-view 
Enter system view, return user view with Ctrl+Z.
[r4]ip route-static 0.0.0.0 0 192.168.1.22

<r3>system-view 
Enter system view, return user view with Ctrl+Z.
[r3]ip rou	
[r3]ip route-static 0.0.0.0 0 192.168.1.14

<r2>system-view 
Enter system view, return user view with Ctrl+Z..
[r2]ip route-static 0.0.0.0 0 192.168.1.10

<r1>system-view 
Enter system view, return user view with Ctrl+Z.
[r1]ip route-static 0.0.0.0 0 192.168.1.2
[r1]ip route-static 0.0.0.0 0 192.168.1.6

2.配置静态路路由

1.R1配置静态路由

<r1>system-view 
Enter system view, return user view with Ctrl+Z.
[r1]ip route-static 192.168.1.64 27 192.168.1.2
[r1]ip route-static 192.168.1.8 30 192.168.1.2
[r1]ip route-static 192.168.1.96 27 192.168.1.6
[r1]ip route-static 192.168.1.12 30 192.168.1.6

2.R2配置静态路由

<r2>system-view 
Enter system view, return user view with Ctrl+Z.
[r2]ip route-static 192.168.1.32 27 192.168.1.1
[r2]ip route-static 192.168.1.4 30 192.168.1.1
[r2]ip route-static 192.168.1.96 27 192.168.1.1
[r2]ip route-static 192.168.1.96 27 192.168.1.10

3.R3配置静态路由

<r3>system-view 
Enter system view, return user view with Ctrl+Z.
[r3]ip route-static 192.168.1.32 27 192.168.1.5
[r3]ip route-static 192.168.1.0 30 192.168.1.5
[r3]ip route-static 192.168.1.64 27 192.168.1.5
[r3]ip route-static 192.168.1.64 27 192.168.1.14

4.R4配置静态路由

<r4>system-view 
Enter system view, return user view with Ctrl+Z.
[r4]ip route-static 192.168.1.64 27 192.168.1.9
[r4]ip route-static 192.168.1.0 30 192.168.1.9
[r4]ip route-static 192.168.1.32 27 192.168.1.9
[r4]ip route-static 192.168.1.32 27 192.168.1.13
[r4]ip route-static 192.168.1.4 30 192.168.1.13
[r4]ip route-static 192.168.1.96 27 192.168.1.13

5.R5配置静态路由

<r5>system-view 
Enter system view, return user view with Ctrl+Z.
[r5]ip route-static 192.168.1.32 27 192.168.1.21
[r5]ip route-static 192.168.1.64 27 192.168.1.21
[r5]ip route-static 192.168.1.96 27 192.168.1.21
[r5]ip route-static 192.168.1.128 27 192.168.1.21
[r5]ip route-static 192.168.1.0 30 192.168.1.21
[r5]ip route-static 192.168.1.4 30 192.168.1.21
[r5]ip route-static 192.168.1.8 30 192.168.1.21
[r5]ip route-static 192.168.1.12 30 192.168.1.21

 5.检验是否联通

1.R1 ping R5

<r1>ping 192.168.1.161
  PING 192.168.1.161: 56  data bytes, press CTRL_C to break
    Reply from 192.168.1.161: bytes=56 Sequence=1 ttl=253 time=60 ms
    Reply from 192.168.1.161: bytes=56 Sequence=2 ttl=253 time=30 ms
    Reply from 192.168.1.161: bytes=56 Sequence=3 ttl=253 time=40 ms
    Reply from 192.168.1.161: bytes=56 Sequence=4 ttl=253 time=30 ms
    Reply from 192.168.1.161: bytes=56 Sequence=5 ttl=253 time=30 ms

  --- 192.168.1.161 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 30/38/60 ms


 2.R1以指定的源ip ping R5

<r1>ping -a 192.168.1.33 192.168.1.161
  PING 192.168.1.161: 56  data bytes, press CTRL_C to break
    Reply from 192.168.1.161: bytes=56 Sequence=1 ttl=253 time=50 ms
    Reply from 192.168.1.161: bytes=56 Sequence=2 ttl=253 time=20 ms
    Reply from 192.168.1.161: bytes=56 Sequence=3 ttl=253 time=30 ms
    Reply from 192.168.1.161: bytes=56 Sequence=4 ttl=253 time=30 ms
    Reply from 192.168.1.161: bytes=56 Sequence=5 ttl=253 time=30 ms

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

 3.R1 ping pc1和pc2

<r1>ping 192.168.1.126
  PING 192.168.1.126: 56  data bytes, press CTRL_C to break
    Request time out
    Reply from 192.168.1.126: bytes=56 Sequence=2 ttl=127 time=50 ms
    Reply from 192.168.1.126: bytes=56 Sequence=3 ttl=127 time=50 ms
    Reply from 192.168.1.126: bytes=56 Sequence=4 ttl=127 time=50 ms
    Reply from 192.168.1.126: bytes=56 Sequence=5 ttl=127 time=40 ms

  --- 192.168.1.126 ping statistics ---
    5 packet(s) transmitted
    4 packet(s) received
    20.00% packet loss
    round-trip min/avg/max = 40/47/50 ms

<r1>ping 192.168.1.125
  PING 192.168.1.125: 56  data bytes, press CTRL_C to break
    Request time out
    Reply from 192.168.1.125: bytes=56 Sequence=2 ttl=127 time=50 ms
    Reply from 192.168.1.125: bytes=56 Sequence=3 ttl=127 time=40 ms
    Reply from 192.168.1.125: bytes=56 Sequence=4 ttl=127 time=60 ms
    Reply from 192.168.1.125: bytes=56 Sequence=5 ttl=127 time=70 ms

  --- 192.168.1.125 ping statistics ---
    5 packet(s) transmitted
    4 packet(s) received
    20.00% packet loss
    round-trip min/avg/max = 40/55/70 ms

4.R1 ping 骨干 ip

<r1>ping 192.168.1.10
  PING 192.168.1.10: 56  data bytes, press CTRL_C to break
    Reply from 192.168.1.10: bytes=56 Sequence=1 ttl=254 time=30 ms
    Reply from 192.168.1.10: bytes=56 Sequence=2 ttl=254 time=20 ms
    Reply from 192.168.1.10: bytes=56 Sequence=3 ttl=254 time=30 ms
    Reply from 192.168.1.10: bytes=56 Sequence=4 ttl=254 time=40 ms
    Reply from 192.168.1.10: bytes=56 Sequence=5 ttl=254 time=30 ms

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

5.R1 ping R2 环回

r1>ping 192.168.1.81
  PING 192.168.1.81: 56  data bytes, press CTRL_C to break
    Reply from 192.168.1.81: bytes=56 Sequence=1 ttl=255 time=40 ms
    Reply from 192.168.1.81: bytes=56 Sequence=2 ttl=255 time=30 ms
    Reply from 192.168.1.81: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 192.168.1.81: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 192.168.1.81: bytes=56 Sequence=5 ttl=255 time=20 ms

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

 6.避免环路,配置空接口

1.R1配置空接口

<r1>system-view 
Enter system view, return user view with Ctrl+Z.	
[r1]ip route-static 192.168.1.32 27 NULL 0

2.R2配置空接口

<r2>system-view 
Enter system view, return user view with Ctrl+Z.
[r2]ip route-static 192.168.1.64 27 NULL  0

 3.R4配置空接口

<r4>system-view 
Enter system view, return user view with Ctrl+Z.
[r4]ip route-static 192.168.1.128 27 NULL 0

7.R1-R5均可访问R6的环回

 1.配置R1-R5均可访问R6的环回

<r5>system-view 
Enter system view, return user view with Ctrl+Z.
[r5]acl 2000
[r5-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r5-acl-basic-2000]q
[r5]interface GigabitEthernet 0/0/2
[r5-GigabitEthernet0/0/2]nat outbound 2000

2.检验是否可访问

<r1>ping 6.6.6.6
  PING 6.6.6.6: 56  data bytes, press CTRL_C to break
    Reply from 6.6.6.6: bytes=56 Sequence=1 ttl=252 time=60 ms
    Reply from 6.6.6.6: bytes=56 Sequence=2 ttl=252 time=40 ms
    Reply from 6.6.6.6: bytes=56 Sequence=3 ttl=252 time=40 ms
    Reply from 6.6.6.6: bytes=56 Sequence=4 ttl=252 time=30 ms
    Reply from 6.6.6.6: bytes=56 Sequence=5 ttl=252 time=30 ms

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

8.R4与R5正常时通过1000G链路,故障时通过100G链路 

<r4>system-view 
Enter system view, return user view with Ctrl+Z.
[r4]ip route-static 0.0.0.0 0 192.168.1.18 preference 61
[r5]display this
#
ip route-static 0.0.0.0 0.0.0.0 56.1.1.2
ip route-static 192.168.1.0 255.255.255.252 192.168.1.21
ip route-static 192.168.1.4 255.255.255.252 192.168.1.21
ip route-static 192.168.1.8 255.255.255.252 192.168.1.21
ip route-static 192.168.1.12 255.255.255.252 192.168.1.21
ip route-static 192.168.1.32 255.255.255.224 192.168.1.21
ip route-static 192.168.1.64 255.255.255.224 192.168.1.21
ip route-static 192.168.1.96 255.255.255.224 192.168.1.21
ip route-static 192.168.1.128 255.255.255.224 192.168.1.21
#
return
[r5]ip route-static 192.168.1.0 255.255.255.252 192.168.1.17 pr 61
[r5]ip route-static 192.168.1.4 255.255.255.252 192.168.1.17 pr 61
[r5]ip route-static 192.168.1.8 255.255.255.252 192.168.1.17 pr 61
[r5]ip route-static 192.168.1.12 255.255.255.252 192.168.1.17 pr 61
[r5]ip route-static 192.168.1.32 255.255.255.224 192.168.1.17 pr 61
[r5]ip route-static 192.168.1.64 255.255.255.224 192.168.1.17 pr 61
[r5]ip route-static 192.168.1.96 255.255.255.224 192.168.1.17 pr 61
[r5]ip route-static 192.168.1.128 255.255.255.224 192.168.1.17 pr 61

#
ip route-static 0.0.0.0 0.0.0.0 56.1.1.2
ip route-static 192.168.1.0 255.255.255.252 192.168.1.21
ip route-static 192.168.1.0 255.255.255.252 192.168.1.17 preference 61
ip route-static 192.168.1.4 255.255.255.252 192.168.1.21
ip route-static 192.168.1.4 255.255.255.252 192.168.1.17 preference 61
ip route-static 192.168.1.8 255.255.255.252 192.168.1.21
ip route-static 192.168.1.8 255.255.255.252 192.168.1.17 preference 61
ip route-static 192.168.1.12 255.255.255.252 192.168.1.21
ip route-static 192.168.1.12 255.255.255.252 192.168.1.17 preference 61

9.R6 telnet R5的公有ip时,实际访问到R1

1. 配置使R6 telnet R5的公有ip时,实际访问到R1

[r1]aaa	
[r1-aaa]local-user ww privilege level 15 password cipher 123456
Info: Add a new user.
[r1-aaa]local-user  ww service-type telnet
[r1-aaa]q
[r1]user-interface vty 0 4
[r1-ui-vty0-4]authentication-mode aaa
<r5>system-view 
Enter system view, return user view with Ctrl+Z.
[r5]interface GigabitEthernet 0/0/2
[r5-GigabitEthernet0/0/2]nat static protocol tcp global current-interface 23 ins
ide 192.168.1.33 23
Warning:The port 23 is well-known port. If you continue it may cause function fa
ilure.
Are you sure to continue?[Y/N]:y

 2.验证是否成功

<r6>system-view 
Enter system view, return user view with Ctrl+Z.	
[r6]interface GigabitEthernet 0/0/0
[r6-GigabitEthernet0/0/0]ip add 56.1.1.2 24
Aug  3 2023 22:08:21-08:00 r6 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r6-GigabitEthernet0/0/0]

  Please check whether system data has been changed, and save data in time

  Configuration console time out, please press any key to log on

<r6>telnet 56.1.1.1
  Press CTRL_] to quit telnet mode
  Trying 56.1.1.1 ...
  Connected to 56.1.1.1 ...

Login authentication


Username:ww
Password:
<r1>

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值