1.根据题意,由地址192.168.1.0/24 进行子网划分,
由题意可知,总共有六条干路和五个路由器空接口,所以首先划出六个网段,其中一个分配给干路,并将其再次划分为六个网段供干路使用,其余五个网段分别根据需求给路由器的环回接口。
192.168.1.0/24 | 192.168.1.0/27 | 192.168.1.0/30 | R1-R2 |
192.168.1.4/30 | R1-R3 | ||
192.168.1.8/30 | R2-R4 | ||
192.168.1.12/30 | R3-R4 | ||
192.168.1.16/30 | R4-R5 | ||
192.168.1.20/30 | R4-R5 | ||
192.168.1.32/27 | 192.168.1.32/28 | R1环回接口 | |
192.168.1.48/28 | |||
192.168.1.64/27 | 192.168.1.64/28 | R2环回接口 | |
192.168.1.80/28 | |||
192.168.1.96/27 | 192.168.1.96/27 | R3-LSW1 | |
192.168.1.128/27 | 192.168.1.128/28 | R4环回接口 | |
192.168.1.144/28 | |||
192.168.1.160/27 | 192.168.1.160/27 | R5环回接口 | |
56.1.1.0/24 | R5-R6 | ||
2分别按照图中端口信息所示,给路由器配置端口信息。配置路由器环回接口时,需要将划分好的网段再次划分,并且进行空接口的配置。
3.分别对路由器AR1、AR2、AR3、AR4、AR5配置静态路由。配置过程中,需要添加一条缺省路由。
4.对AR3路由器进行DHCP配置。
[aa]dhcp enable #开启DHCP服务# [aa]ip pool aa #创建地址池aa# [aa-ip-pool-aa]gateway-list 192.168.1.161 #配置网关信息# [aa-ip-pool-aa]network 192.168.1.160 mask 255.255.255.0 #给地址池中加入IP 地址# [aa-ip-pool-aa]dns-list 144.144.144.144 8.8.8.8 #配置DNS信息# [aa]interface GigabitEthernet0/0/2 #进入相应的接口下# [aa-GigabitEthernet0/0/2]dhcp select global #此端口下进行声明# |
1. 给交换机配置接口IP
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 30
[R1-GigabitEthernet0/0/0]q
[R1]q
[R1]
[R1]interface GigabitEthernet 0/0/1
[R1-GigabitEthernet0/0/1]ip address 192.168.1.5 30
[R1-GigabitEthernet0/0/1]q
[R1]
[R1]interface LoopBack 0
[R1-LoopBack0]ip address 192.168.1.33 28
[R1-LoopBack0]q
[R1]
[R1]interface LoopBack 1
[R1-LoopBack1]ip address 192.168.1.49 28
[R1-LoopBack1]q
[R1]
[R2-GigabitEthernet0/0/0]ip address 192.168.1.2 30
[R2-GigabitEthernet0/0/0]q
[R2]q
[R2]
[R2]interface GigabitEthernet 0/0/1
[R2-GigabitEthernet0/0/1]ip address 192.168.1.9 30
[R2-GigabitEthernet0/0/1]q
[R2]
[R2]interface LoopBack 0
[R2-LoopBack0]ip address 192.168.1.65 28
[R2-LoopBack0]q
[R2]
[R2]interface LoopBack 1
[R2-LoopBack1]ip address 192.168.1.81 28
[R2-LoopBack1]q
[R2]
[R3-GigabitEthernet0/0/0]ip address 192.168.1.6 30
[R3-GigabitEthernet0/0/0]q
[R3]q
[R3]
[R3]interface GigabitEthernet 0/0/1
[R3-GigabitEthernet0/0/1]ip address 192.168.1.13 30
[R3-GigabitEthernet0/0/1]q
[R3]
[R3]interface GigabitEthernet 0/0/1
[R3- GigabitEthernet 0/0/1]ip address 192.168.1.96 27
[R3- GigabitEthernet 0/0/1]q
[R3]
[R4]interface GigabitEthernet 0/0/0
[R4-GigabitEthernet0/0/0]ip address 192.168.1.10 30
[R4-GigabitEthernet0/0/0]q
[R4]q
[R4]
[R4]interface GigabitEthernet 0/0/1
[R4-GigabitEthernet0/0/1]ip address 192.168.1.14 30
[R4-GigabitEthernet0/0/1]q
[R4]
[R4]interface GigabitEthernet 0/0/2
[R4-GigabitEthernet0/0/2]ip address 192.168.1.17 30
[R4-GigabitEthernet0/0/2]q
[R4]q
[R4]
[R4]interface GigabitEthernet 4/0/0
[R4-GigabitEthernet4/0/0]ip address 192.168.1.21 30
[R4-GigabitEthernet4/0/0]q
[R4]
[R4]interface LoopBack 0
[R4-LoopBack0]ip address 192.168.1.129 28
[R4-LoopBack0]q
[R4]
[R4]interface LoopBack 1
[R4-LoopBack1]ip address 192.168.1.145 28
[R4-LoopBack1]q
[R4]
[R5-GigabitEthernet0/0/0]ip address 192.168.1.18 30
[R5-GigabitEthernet0/0/0]q
[R5]q
[R5]
[R5]interface GigabitEthernet 0/0/1
[R5-GigabitEthernet0/0/1]ip address 192.168.1.22 30
[R5-GigabitEthernet0/0/1]q
[R5]
[R5]interface GigabitEthernet 0/0/2
[R5-GigabitEthernet0/0/2]ip address 56.1.1.1 24
[R5-GigabitEthernet0/0/2]q
[R5]
[R5]interface LoopBack 0
[R5-LoopBack0]ip address 192.168.1.160 28
[R5-LoopBack0]q
[R5]
[R6-GigabitEthernet0/0/0]ip address 56.1.1.2 24
[R6-GigabitEthernet0/0/0]q
[R6]q
[R6]
[R6]interface LoopBack 0
[R6-LoopBack0]ip address 1.1.1.1 24
[R6-LoopBack0]q
[R6]
2.配置静态路由和空接口
[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.16 30 192.168.1.2
[R1]ip route-static 192.168.1.20 30 192.168.1.2
[R1]ip route-static 192.168.1.128 27 192.168.1.2
[R1]ip route-static 192.168.1.160 27 192.168.1.2
[R1]ip route-static 192.168.1.12 30 192.168.1.6
[R1]ip route-static 192.168.1.20 30 192.168.1.6
[R1]ip route-static 192.168.1.16 30 192.168.1.6
[R1]ip route-static 192.168.1.96 27 192.168.1.6
[R1]ip route-static 192.168.1.160 27 192.168.1.6
[R1]ip route-static 192.168.1.128 27 192.168.1.6
[R1]ip route-static 192.168.1.32 27 NULL 0
[R1]ip route-static 0.0.0.0 0 192.168.1.6
[R2]ip route-static 192.168.1.16 30 192.168.1.10
[R2]ip route-static 192.168.1.20 30 192.168.1.10
[R2]ip route-static 192.168.1.160 27 192.168.1.10
[R2]ip route-static 192.168.1.12 30 192.168.1.10
[R2]ip route-static 192.168.1.128 27 192.168.1.10
[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
[R2]ip route-static 192.168.1.64 27 NULL 0
[R2]ip route-static 0.0.0.0 0 192.168.1.10
[R3]ip route-static 192.168.1.64 27 192.168.1.14
[R3]ip route-static 192.168.1.8 30 192.168.1.14
[R3]ip route-static 192.168.1.128 27 192.168.1.14
[R3]ip route-static 192.168.1.16 30 192.168.1.14
[R3]ip route-static 192.168.1.20 30 192.168.1.14
[R3]ip route-static 192.168.1.160 27 192.168.1.14
[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 0.0.0.0 0 192.168.1.14
[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.32 27 192.168.1.13
[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.160 27 192.168.1.18
[R4]ip route-static 192.168.1.160 27 192.168.1.22 preference 61
[R4]ip route-static 192.168.1.128 27 NULL 0
[R4]ip route-static 0.0.0.0 0 192.168.1.18
[R4]ip route-static 0.0.0.0 0 192.168.1.22 preference 61
[R5]ip route-static 192.168.1.128 27 192.168.1.17
[R5]ip route-static 192.168.1.8 30 192.168.1.17
[R5]ip route-static 192.168.1.64 27 192.168.1.17
[R5]ip route-static 192.168.1.0 30 192.168.1.17
[R5]ip route-static 192.168.1.32 27 192.168.1.17
[R5]ip route-static 192.168.1.4 30 192.168.1.17
[R5]ip route-static 192.168.1.12 30 192.168.1.17
[R5]ip route-static 192.168.1.96 27 192.168.1.17
[R5]ip route-static 192.168.1.128 27 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.8 30 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.64 27 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.0 30 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.32 27 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.4 30 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.12 30 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.96 27 192.168.1.21 preference 61
[R5]ip route-static 0.0.0.0 0 56.1.1.2
3.对AR3路由器进行DHCP配置。
[R3]dhcp enable
[R3]ip pool aa
[R3-ip-pool-aa]gateway-list 192.168.1.97
[R3-ip-pool-aa]network 192.168.1.96 mask 255.255.255.224
[R3-ip-pool-aa]dns-list 144.144.144.144 8.8.8.8
[R3]interface GigabitEthernet0/0/2
[R3-GigabitEthernet0/0/2]dhcp select global
4.在R5路由器上开启端口映射
[R5]acl 2000
[R5-acl-basic-2000]rule permit source any
[R5-acl-basic-2000]q
[R5]
[R5]interface GigabitEthernet 0/0/2
[R5-GigabitEthernet0/0/2]nat outbound 2000
[R5-GigabitEthernet0/0/2]
[R5-GigabitEthernet0/0/2]nat static global 56.1.1.3 inside 192.168.1.1
[R5-GigabitEthernet0/0/2]q
[R5]
5.在R1路由器上开启远程
[R1]user-interface vty 0 4
[R1-ui-vty0-4]au
[R1-ui-vty0-4]authentication-mode pa
[R1-ui-vty0-4]authentication-mode password
Please configure the login password (maximum length 16):123
[R1-ui-vty0-4]q
[R1]q
![]() |
6. telnet 56.1.1.3