实验要求及拓扑图如下
192.168.1.0/24
192.168.1.000 00000/27——192.168.1.0/27——骨干链路
192.168.1.0/30
192.168.1.4/30
192.168.1.8/30
192.168.1.12/30
192.168.1.16/30
192.168.1.20/30
192.168.1.24/30
192.168.1.28/30
192.168.1.001 00000/27——192.168.1.32/27——AR1环回
192.168.1.32/28
192.168.1.48/28
192.168.1.010 00000/27——192.168.1.64/27——AR2环回
192.168.1.64/28
192.168.1.80/28
192.168.1.011 00000/27——192.168.1.96/27——AR3下网段
192.168.1.100 00000/27——192.168.1.128/27——AR4环回
192.168.1.128/28
192.168.1.144/28
192.168.1.101 00000/27——192.168.1.160/27——AR5环回
192.168.1.110 00000/27——192.168.1.192/27
192.168.1.111 00000/27——192.168.1.224/27
如下图:
AR1
[r1]interface GigabitEthernet 0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 30
[r1-GigabitEthernet0/0/0]q
[r1]interface GigabitEthernet 0/0/1
[r1-GigabitEthernet0/0/1]ip address 192.168.1.5 30
[r1-GigabitEthernet0/0/1]q
[r1]interface loopback 0
[r1-LoopBack0]ip address 192.168.1.33 28
[r1-LoopBack0]q
[r1]interface loopback 1
[r1-LoopBack1]ip address 192.168.1.49 28
[r1-LoopBack1]q
AR2
[r2]interface GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/0]ip address 192.168.1.2 30
[r2-GigabitEthernet0/0/0]q
[r2]interface GigabitEthernet 0/0/1
[r2-GigabitEthernet0/0/1]ip address 192.168.1.9 30
[r2-GigabitEthernet0/0/1]q
[r2]interface loopback 0
[r2-LoopBack0]ip address 192.168.1.65 28
[r2-LoopBack0]q
[r2]interface loopback 1
[r2-LoopBack1]ip address 192.168.1.81 28
[r2-LoopBack1]q
AR3
[r3]interface GigabitEthernet 0/0/0
[r3-GigabitEthernet0/0/0]ip address 192.168.1.6 30
[r3-GigabitEthernet0/0/0]q
[r3]interface GigabitEthernet 0/0/1
[r3-GigabitEthernet0/0/1]ip address 192.168.1.13 30
[r3-GigabitEthernet0/0/1]q
[r3]interface GigabitEthernet 0/0/2
[r3-GigabitEthernet0/0/2]ip address 192.168.1.97 27
[r3-GigabitEthernet0/0/2]q
AR4
[r4]interface GigabitEthernet 0/0/0
[r4-GigabitEthernet0/0/0]ip address 192.168.1.10 30
[r4-GigabitEthernet0/0/0]q
[r4]interface GigabitEthernet 0/0/1
[r4-GigabitEthernet0/0/1]ip address 192.168.1.14 30
[r4-GigabitEthernet0/0/1]q
[r4]interface GigabitEthernet 0/0/2
[r4-GigabitEthernet0/0/2]ip address 192.168.1.17 30
[r4-GigabitEthernet0/0/2]q
[r4]interface GigabitEthernet 4/0/0
[r4-GigabitEthernet4/0/0]ip address 192.168.1.21 30
[r4-GigabitEthernet4/0/0]q
[r4]interface loopback 0
[r4-LoopBack0]ip address 192.168.1.129 28
[r4-LoopBack0]q
[r4]interface loopback 1
[r4-LoopBack1]ip address 192.168.1.145 28
[r4-LoopBack1]q
AR5
[r5]interface GigabitEthernet 0/0/0
[r5-GigabitEthernet0/0/0]ip address 192.168.1.18 30
[r5-GigabitEthernet0/0/0]q
[r5]interface GigabitEthernet 0/0/1
[r5-GigabitEthernet0/0/1]ip address 12.0.0.1 24
[r5-GigabitEthernet0/0/1]q
[r5]interface GigabitEthernet 0/0/2
[r5-GigabitEthernet0/0/2]ip address 192.168.1.22 30
[r5-GigabitEthernet0/0/2]q
[r5]interface loopback 0
[r5-LoopBack0]ip address 192.168.1.161 27
[r5-LoopBack0]q
AR6
[r6]interface GigabitEthernet 0/0/0
[r6-GigabitEthernet0/0/0]ip address 12.0.0.2 24
[r6-GigabitEthernet0/0/0]q
[r6]interface loopback 0
[r6-LoopBack0]ip address 1.1.1.1 24
[r6-LoopBack0]q
[r3]dhcp enable
[r3]ip pool abc
[r3-ip-pool-abc]
[r3-ip-pool-abc]network 192.168.1.96 mask 27
[r3-ip-pool-abc]gateway-list 192.168.1.97
[r3-ip-pool-abc]q
[r3]interface GigabitEthernet 0/0/2
[r3-GigabitEthernet0/0/2]dhcp select global
[r3-GigabitEthernet0/0/2]q
AR1
[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
[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.12 30 192.168.1.6
[r1]ip route-static 192.168.1.96 27 192.168.1.6
AR2
[r2]ip route-static 0.0.0.0 0 192.168.1.10
[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
[r2]ip route-static 192.168.1.4 30 192.168.1.1
[r2]ip route-static 192.168.1.32 27 192.168.1.1
AR3
[r3]ip route-static 0.0.0.0 0 192.168.1.14
[r3]ip route-static 192.168.1.64 27 192.168.1.14
[r3]ip route-static 192.168.1.64 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.32 27 192.168.1.5
AR4
[r4]ip route-static 0.0.0.0 0 GigabitEthernet 0/0/2 192.168.1.18 //浮动静态
[r4]ip route-static 0.0.0.0 0 192.168.1.22 preference 61
[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.0 30 192.168.1.9
[r4]ip route-static 192.168.1.64 27 192.168.1.9
[r4]ip route-static 192.168.1.96 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.160 27 192.168.1.18
AR5
[r5]ip route-static 0.0.0.0 0 12.0.0.2
[r5]ip route-static 192.168.1.0 24 192.168.1.17
[r5]ip route-static 192.168.1.0 24 192.168.1.21 pre
[r5]ip route-static 192.168.1.0 24 192.168.1.21 preference 61
AR1
[r1]ip route-static 192.168.1.32 27 NULL 0
AR2
[r2]ip route-static 192.168.1.64 27 NULL 0
AR4
[r4]ip route-static 192.168.1.128 27 NULL 0
[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 g
[r5]interface GigabitEthernet 0/0/1
[r5-GigabitEthernet0/0/1]nat outbound 2000
[r5-GigabitEthernet0/0/1]q
AR1开启服务
[r1]aaa
[r1-aaa]local-user admin privilege level 15 password cipher 123456
[r1-aaa]local-user admin service-type telnet
[r1-aaa]q
[r1]user-interface vty 0 4
[r1-ui-vty0-4]authentication-mode aaa
[r1-ui-vty0-4]q
AR5
[r5-GigabitEthernet0/0/1]nat server protocol tcp global current-interface 23 ins
ide 192.168.1.1 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