HCIP综合实验(1)

 一,实验作业要求

HCIP综合实验(1)_第1张图片

二,实验步骤

1,合理分配ip地址

192.168.1.0/24 借3位划分:
骨干链路 192.168.1.0/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

环回地址
R1 192.168.1.32/27
 192.168.1.32/28
 192.168.1.48/28
R2 192.168.1.64/27
 192.168.1.64/28
 192.168.1.80/28
R4 192.168.1.96/27
​  192.168.1.96/28
  192.168.1.112/28
R5 192.168.1.128/27
  192.168.1.128/28
R3(动态路由)192.168.1.160/27

2,配置IP地址

R1
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 30
[r1-GigabitEthernet0/0/0]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 192.168.1.13 30
[r1-GigabitEthernet0/0/1]int l0
[r1-LoopBack0]ip add 192.168.1.33 28
[r1-LoopBack0]int l1
[r1-LoopBack1]ip add 192.168.1.49 28
[r1-LoopBack1]
R2
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.1.2 30
[r2-GigabitEthernet0/0/0]int g0/0/1
[r2-GigabitEthernet0/0/1]ip add 192.168.1.5 30
[r2-GigabitEthernet0/0/1]int l0
[r2-LoopBack0]ip add 192.168.1.65 28
[r2-LoopBack0]int l1
[r2-LoopBack1]ip add 192.168.1.81 28
[r2-LoopBack1]
R3
[r3]int g0/0/1
[r3-GigabitEthernet0/0/1]ip add 192.168.1.14 30
[r3-GigabitEthernet0/0/1]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.1.9 30
[r3-GigabitEthernet0/0/0]int g0/0/2
[r3-GigabitEthernet0/0/2]ip add 192.168.1.161 27
[r3-GigabitEthernet0/0/2]
R4
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 192.168.1.6 30
[r4-GigabitEthernet0/0/0]int g0/0/1
[r4-GigabitEthernet0/0/1]ip add 192.168.1.10 30
[r4-GigabitEthernet0/0/1]int g0/0/2
[r4-GigabitEthernet0/0/2]ip add 192.168.1.17 30
[r4-GigabitEthernet0/0/2]int g4/0/0
[r4-GigabitEthernet4/0/0]ip add 192.168.1.21 30
[r4-GigabitEthernet4/0/0]int l0
[r4-LoopBack0]ip add 192.168.1.97 28
[r4-LoopBack0]int l1
[r4-LoopBack1]ip add 192.168.1.113 28
[r4-LoopBack1]
R5
[r5]int g0/0/0
[r5-GigabitEthernet0/0/0]ip add 192.168.1.18 30
[r5-GigabitEthernet0/0/0]int g0/0/1
[r5-GigabitEthernet0/0/1]ip add 12.0.0.1 24
[r5-GigabitEthernet0/0/1]int g0/0/2
[r5-GigabitEthernet0/0/2]ip add 192.168.1.22 30
[r5-GigabitEthernet0/0/2]int l0
[r5-LoopBack0]ip add 192.168.1.129 28
R6
[r6]int g0/0/0
[r6-GigabitEthernet0/0/0]ip add 12.0.0.2 24
[r6-GigabitEthernet0/0/0]int l0
[r6-LoopBack0]ip add 1.1.1.1 24
[r6-LoopBack0]
3,R3下面两台PC通过DHCP自动获取IP地址

在R3设备上创建池塘,dhcp下放ip地址,PC1和PC2自动获取ip地址
dhcp enable 先开启dhcp服务功能
ip pool dhcp创建名为dhcp的dhcp池塘
一台设备上可以创建多个dhcp池塘,但一个池塘只能为一个广播域服务

[r3]dhcp enable
[r3]ip pool dhcp
[r3-ip-pool-dhcp]network 192.168.1.160 mask 27
[r3-ip-pool-dhcp]gateway-list 192.168.1.161
[r3-ip-pool-dhcp]dns-list 114.114.114.114
[r3-ip-pool-dhcp]int g0/0/2
[r3-GigabitEthernet0/0/2]dhcp select global
[r3-GigabitEthernet0/0/2]

PC1:

PC2:

 4,配置静态路由和缺省

R1:
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.14
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.14
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.14
ip route-static 192.168.1.32 255.255.255.224 NULL0

R2:
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

R3:
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

R4:
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 GigabitEthernet0/0/2 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

R5:
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  浮动静态路由
5,nat配置和端口映射

nat配置:
[r5]acl 2000
[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 outbound 2000
端口映射:
[r5-acl-basic-2000]int g0/0/1
[r5-GigabitEthernet0/0/1]nat server 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
在R1上配置远程登陆:
[r1]aaa
[r1-aaa]local-user admin privilege level 15 password cipher 123
[r1-aaa]local-user admin service-type telnet
[r1]user-interface vty 0 4
[r1-ui-vty0-4]authentication-mode aaa

HCIP综合实验(1)_第2张图片

你可能感兴趣的:(网络)