192.168.1.000 001 00/30 ------------192.168.1.4/30
192.168.1.000 010 00/30 ------------192.168.1.8/30
192.168.1.000 011 00/30 ------------192.168.1.12/30
192.168.1.000 100 00/30 ------------192.168.1.16/30
192.168.1.000 101 00/30 ------------192.168.1.20/30
用作保留
192.168.1.000 110 00/30
192.168.1.000 111 00/30
环回地址
192.168.1.001 00000/27 ----------R1 192.168.1.32/27
192.168.1.001 0 0000/28 192.168.1.32/28
192.168.1.001 1 0000/28 192.168.1.48/28
192.168.1.010 00000/27 -----------R2 192.168.1.64/27
192.168.1.010 0 0000/28 192.168.1.64/28
192.168.1.010 1 0000/28 192.168.1.80/28
192.168.1.011 00000/27 -------------R4 192.168.1.96/27
192.168.1.011 0 0000/28 192.168.1.96/28
192.168.1.011 1 0000/28 192.168.1.112/28
192.168.1.100 00000/27 ----------- --R5 192.168.1.128/27
192.168.1.100 0 0000/28 192.168.1.128/28
R3(用作DHCP)
192.168.1.101 00000/27 ----------192.168.1.160/27
用作保留
192.168.1.110 00000/27
192.168.1.111 00000/27
AR1:
[R!]inter g0/0/0
[R!-GigabitEthernet0/0/0]ip address 192.168.1.1 30
Jul 5 2022 21:18:24-08:00 R! %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state.
[R!-GigabitEthernet0/0/0]q
[R!]inter
[R!]interface g0/0/1
[R!-GigabitEthernet0/0/1]ip address 192.168.1.14 30
Jul 5 2022 21:18:45-08:00 R! %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface GigabitEthernet0/0/1 has entered the UP state.
[R!-GigabitEthernet0/0/1]q
[R!]interface LoopBack 0
[R!-LoopBack0]ip address 192.168.1.32 28
Error: The specified IP address is invalid.
[R!-LoopBack0]ip address 192.168.1.33 28
[R!-LoopBack0]quit
[R!]interface LoopBack 1
[R!-LoopBack1]ip address 192.168.1.49 28
[R!-LoopBack1]q
[R!]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 16 Routes : 16
Destination/Mask Proto Pre Cost Flags NextHop Interface
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
192.168.1.0/30 Direct 0 0 D 192.168.1.1 GigabitEthernet0/0/0
192.168.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
192.168.1.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
192.168.1.12/30 Direct 0 0 D 192.168.1.14 GigabitEthernet0/0/1
192.168.1.14/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/1
192.168.1.15/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/1
192.168.1.32/28 Direct 0 0 D 192.168.1.33 LoopBack0
192.168.1.33/32 Direct 0 0 D 127.0.0.1 LoopBack0
192.168.1.47/32 Direct 0 0 D 127.0.0.1 LoopBack0
192.168.1.48/28 Direct 0 0 D 192.168.1.49 LoopBack1
192.168.1.49/32 Direct 0 0 D 127.0.0.1 LoopBack1
192.168.1.63/32 Direct 0 0 D 127.0.0.1 LoopBack1
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
[R!]
AR2:
[R2]inter
[R2]interface g0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.1.2 30
Jul 5 2022 21:23:21-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 g0/0/1
[R2-GigabitEthernet0/0/1]ip address 192.168.1.5 30
Jul 5 2022 21:23:41-08:00 R2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface GigabitEthernet0/0/1 has entered the UP state.
[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
[R2]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 16 Routes : 16
Destination/Mask Proto Pre Cost Flags NextHop Interface
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
192.168.1.0/30 Direct 0 0 D 192.168.1.2 GigabitEthernet0/0/0
192.168.1.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
192.168.1.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
192.168.1.4/30 Direct 0 0 D 192.168.1.5 GigabitEthernet0/0/1
192.168.1.5/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/1
192.168.1.7/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/1
192.168.1.64/28 Direct 0 0 D 192.168.1.65 LoopBack0
192.168.1.65/32 Direct 0 0 D 127.0.0.1 LoopBack0
192.168.1.79/32 Direct 0 0 D 127.0.0.1 LoopBack0
192.168.1.80/28 Direct 0 0 D 192.168.1.81 LoopBack1
192.168.1.81/32 Direct 0 0 D 127.0.0.1 LoopBack1
192.168.1.95/32 Direct 0 0 D 127.0.0.1 LoopBack1
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
AR3:
[R3]inter
[R3]interface g0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.1.13 30
Jul 5 2022 21:26:11-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 g0/0/1
[R3-GigabitEthernet0/0/1]ip address 192.168.1.10 30
Jul 5 2022 21:26:25-08:00 R3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface GigabitEthernet0/0/1 has entered the UP state.
[R3-GigabitEthernet0/0/1]q
AR4:
[R4]interface g0/0/0
[R4-GigabitEthernet0/0/0]ip address 192.168.1.6 30
Jul 5 2022 21:28:32-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 g0/0/1
[R4-GigabitEthernet0/0/1]ip address 192.168.1.9 30
[R4-GigabitEthernet0/0/1]
Jul 5 2022 21:28:45-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-GigabitEthernet0/0/1]q
[R4]interface g0/0/2
[R4-GigabitEthernet0/0/2]ip address 192.168.1.22 30
[R4-GigabitEthernet0/0/2]
Jul 5 2022 21:29:04-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 g4/0/0
[R4-GigabitEthernet4/0/0]ip address 192.168.1.17 30
[R4-GigabitEthernet4/0/0]
Jul 5 2022 21:29:20-08:00 R4 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP on the interface GigabitEthernet4/0/0 has entered the UP state.
[R4-GigabitEthernet4/0/0]q
[R4]interface LoopBack 0
[R4-LoopBack0]ip address 192.168.1.97 28
[R4-LoopBack0]ip address 192.168.1.113 28
[R4-LoopBack0]undo ip address 192.168.1.113 28
[R4-LoopBack0]q
[R4]interface LoopBack 1
[R4-LoopBack1]ip address 192.168.1.113 28
[R4-LoopBack1]q
[R4]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 19 Routes : 19
Destination/Mask Proto Pre Cost Flags NextHop Interface
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
192.168.1.4/30 Direct 0 0 D 192.168.1.6 GigabitEthernet0/0/0
192.168.1.6/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
192.168.1.7/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
192.168.1.8/30 Direct 0 0 D 192.168.1.9 GigabitEthernet0/0/1
192.168.1.9/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/1
192.168.1.11/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/1
192.168.1.16/30 Direct 0 0 D 192.168.1.17 GigabitEthernet4/0/0
192.168.1.17/32 Direct 0 0 D 127.0.0.1 GigabitEthernet4/0/0
192.168.1.19/32 Direct 0 0 D 127.0.0.1 GigabitEthernet4/0/0
192.168.1.20/30 Direct 0 0 D 192.168.1.22 GigabitEthernet0/0/2
192.168.1.22/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/2
192.168.1.23/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/2
192.168.1.112/28 Direct 0 0 D 192.168.1.113 LoopBack1
192.168.1.113/32 Direct 0 0 D 127.0.0.1 LoopBack1
192.168.1.127/32 Direct 0 0 D 127.0.0.1 LoopBack1
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
[R4]
AR5:
[R5]interface g0/0/0
[R5-GigabitEthernet0/0/0]ip address 192.168.1.21 30
Jul 5 2022 21:32:25-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 g0/0/2
[R5-GigabitEthernet0/0/2]ip address 192.168.1.18 30
Jul 5 2022 21:32:41-08:00 R5 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface GigabitEthernet0/0/2 has entered the UP state.
[R5-GigabitEthernet0/0/2]q
[R5]interface LoopBack 0
[R5-LoopBack0]ip address 192.168.1.129 28
[R5-LoopBack0]q
[R5]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
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
192.168.1.16/30 Direct 0 0 D 192.168.1.18 GigabitEthernet0/0/2
192.168.1.18/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/2
192.168.1.19/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/2
192.168.1.20/30 Direct 0 0 D 192.168.1.21 GigabitEthernet0/0/0
192.168.1.21/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
192.168.1.23/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
192.168.1.128/28 Direct 0 0 D 192.168.1.129 LoopBack0
192.168.1.129/32 Direct 0 0 D 127.0.0.1 LoopBack0
192.168.1.143/32 Direct 0 0 D 127.0.0.1 LoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
[R5]
AR6:
[R6]interface g0/0/0
[R6-GigabitEthernet0/0/0]ip address 12.0.0.2 24
Jul 5 2022 21:34:06-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]q
[R6]int l0
[R6-LoopBack0]ip address 1.1.1.1 24
[R6-LoopBack0]q
[R6]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
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
12.0.0.0/24 Direct 0 0 D 12.0.0.2 GigabitEthernet0/0/0
12.0.0.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
12.0.0.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
[R6]
PC1如图所示:
PC2如图所示:
AR1:
ip route-static 0.0.0.0 0.0.0.0 192.168.1.2
ip route-static 0.0.0.0 0.0.0.0 192.168.1.13
ip route-static 192.168.1.4 255.255.255.252 192.168.1.2
ip route-static 192.168.1.8 255.255.255.252 192.168.1.13
ip route-static 192.168.1.32 255.255.255.224 NULL0
ip route-static 192.168.1.64 255.255.255.224 192.168.1.2
ip route-static 192.168.1.160 255.255.255.224 192.168.1.13
AR2:
ip route-static 0.0.0.0 0.0.0.0 192.168.1.6//同上,减少手工量
ip route-static 192.168.1.12 255.255.255.252 192.168.1.1
ip route-static 192.168.1.32 255.255.255.224 192.168.1.1
ip route-static 192.168.1.160 255.255.255.224 192.168.1.6
ip route-static 192.168.1.160 255.255.255.224 192.168.1.1
ip route-static 192.168.1.64 255.255.255.224 NULL0
AR3:
ip route-static 0.0.0.0 0.0.0.0 192.168.1.10//同上
ip route-static 192.168.1.0 255.255.255.252 192.168.1.13
ip route-static 192.168.1.32 255.255.255.224 192.168.1.13
ip route-static 192.168.1.64 255.255.255.224 192.168.1.13
ip route-static 192.168.1.64 255.255.255.224 192.168.1.10
AR4:
ip route-static 0.0.0.0 0.0.0.0 192.168.1.18
ip route-static 0.0.0.0 0.0.0.0 192.168.1.22 preference 70
ip route-static 192.168.1.0 255.255.255.252 192.168.1.5
ip route-static 192.168.1.12 255.255.255.252 192.168.1.9
ip route-static 192.168.1.32 255.255.255.224 192.168.1.9
ip route-static 192.168.1.32 255.255.255.224 192.168.1.5
ip route-static 192.168.1.64 255.255.255.224 192.168.1.5
ip route-static 192.168.1.160 255.255.255.224 192.168.1.9
ip route-static 192.168.1.96 255.255.255.224 NULL0
ip route-static 192.168.1.0 255.255.255.0 NULL0
ip route-static 192.168.1.128 255.255.255.224 192.168.1.18
ip route-static 192.168.1.128 255.255.255.224 192.168.1.22 preference 70
ip route-static 192.168.1.160 255.255.255.224 192.168.1.9
AR5:
ip route-static 0.0.0.0 0.0.0.0 12.0.0.2
ip route-static 192.168.1.0 255.255.255.0 192.168.1.17
ip route-static 192.168.1.0 255.255.255.0 192.168.1.21 preference 70
nat配置:
[r5]acl 2000
[r5-acl-basic-2000]rule p
[r5-acl-basic-2000]rule permit s
[r5-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r5-acl-basic-2000]int g0/0/1
[r5-GigabitEthernet0/0/1]nat ou
[r5-GigabitEthernet0/0/1]nat outbound 2000
[r1]aaa
[r1-aaa]loc
[r1-aaa]local-user adminp
[r1-aaa]local-user admin p
[r1-aaa]local-user admin pr
[r1-aaa]local-user admin privilege l
[r1-aaa]local-user admin privilege level 15 pa
[r1-aaa]local-user admin privilege level 15 password c
[r1-aaa]local-user admin privilege level 15 password cipher 123
[r1-aaa]loca
[r1-aaa]local-user admin s
[r1-aaa]local-user admin service-type telnet
[r1-aaa]q
[r1]us
[r1]user-group
[r1]user-interface vty 0 4
[r1-ui-vty0-4]au
[r1-ui-vty0-4]authentication-mode aaa
[r1-ui-vty0-4]
[r5]int g0/0/1
[r5-GigabitEthernet0/0/1]nat s
[r5-GigabitEthernet0/0/1]nat server p
[r5-GigabitEthernet0/0/1]nat server protocol tcp g
[r5-GigabitEthernet0/0/1]nat server protocol tcp global c
[r5-GigabitEthernet0/0/1]nat server protocol tcp global current-interface 23 in
[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