hcip 第九天

1)首先实验要求是将192.168.1.0/24的网段进行IP地址的划分。根据拓扑结构,我们得知需要划分出6个网段,划分的网段如下:

192.168.1.0/24

192.168.1.0/27

192.168.1.32/27

192.168.1.64/27

192.168.1.96/27

192.168.1.128/27

192.168.1.160/27

192.168.1.192/27

192.168.1.224/27

2)选其中6个网段作为实验所需网段,剩余2个网段作为保留网段,在将192.168.1.0/27作为我们的骨干链路的网段,根据拓扑得知我们需要6个网段,划分的网段如下:

192.168.1.0/27

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

选其中6个网段作为骨干链路的网段,其余网段作为保留网段。此类划分好是因为一个骨干链路刚好需要2个IP地址,此种划分刚好满足这种现象,以达到IP地址最大化节约。

3)将划分出的网段再次进行划分用作环回接口,划分结构如下:

192.168.1.32/28

192.168.1.48/28

192.168.1.64/28

192.168.1.80/28

192.168.1.96/28

192.168.1.112/28

192.168.1.128/28

192.168.1.144/28

192.168.1.160/28

192.168.1.176/28

192.168.1.192/28

192.168.1.208/28

192.168.1.224/28

192.168.1.240/28

以上此类的划分是为了可以更加方便的汇总。

2、配置:

1)对各个设备进行IP地址和环回接口的配置

AR1:

IP地址的配置:

r1-GigabitEthernet0/0/0ip a 192.168.1.1 30

r1-GigabitEthernet0/0/2ip a 192.168.1.9 30

环回接口的配置:

r1-LoopBack0ip a 192.168.1.33 28

r1-LoopBack1ip a 192.168.1.49 28

AR2:

IP地址的配置:

r2-GigabitEthernet0/0/0ip a 192.168.1.2 30

r2-GigabitEthernet0/0/1ip a 192.168.1.5 30

环回接口的配置:

r2-LoopBack0ip a 192.168.1.65 28

r2-LoopBack1ip a 192.168.1.81 28

AR3:

IP地址的配置:

r3-GigabitEthernet0/0/0ip a 192.168.1.10 30

r3-GigabitEthernet0/0/1ip a 192.168.1.13 30

r3-GigabitEthernet0/0/2ip a 192.168.1.97 27

AR4:

IP地址的配置:

r4-GigabitEthernet0/0/0ip a 192.168.1.6 30

r4-GigabitEthernet0/0/1ip a 192.168.1.14 30

r4-GigabitEthernet0/0/2ip a 192.168.1.21 30

r4-GigabitEthernet4/0/0ip a 192.168.1.17 30

环回接口的配置

r4-LoopBack0ip a 192.168.1.129 28

r4-LoopBack1ip a 192.168.1.145 28

AR5:

IP地址的配置:

r5-GigabitEthernet0/0/0ip a 192.168.1.22 30

r5-GigabitEthernet0/0/2ip a 192.168.1.18 30

r5-GigabitEthernet0/0/1ip a 12.0.0.1 24

环回接口的配置:

r5-LoopBack0ip a 192.168.1.161 28

AR6:

IP地址的配置:

isp-GigabitEthernet0/0/0ip a 12.0.0.2 24

环回接口的配置:

isp-LoopBack0ip a 1.1.1.1 24

2)配置路由和空接口

AR1:

r1ip route-static 0.0.0.0 0 192.168.1.2

r1ip route-static 0.0.0.0 0 192.168.1.10

r1ip route-static 192.168.1.96 27 192.168.1.10

r1ip route-static 192.168.1.4 30 192.168.1.2

r1ip route-static 192.168.1.12 30 192.168.1.10

r1ip route-static 192.168.1.32 27 NULL 0

AR2:

r2ip route-static 0.0.0.0 0 192.168.1.6

r2ip route-static 192.168.1.32 27 192.168.1.1

r2ip route-static 192.168.1.96 27 192.168.1.1

r2ip route-static 192.168.1.96 27 192.168.1.6

r2ip route-static 192.168.1.12 30 192.168.1.6

r2ip route-static 192.168.1.64 27 NULL 0

AR3:

r3ip route-static 0.0.0.0 0 192.168.1.14

r3ip route-static 192.168.1.32 27 192.168.1.9

r3ip route-static 192.168.1.64 27 192.168.1.9

r3ip route-static 192.168.1.64 27 192.168.1.14

r3ip route-static 192.168.1.4 30 192.168.1.14

r3ip route-static 192.168.1.0 30 192.168.1.9

AR4:

r4ip route-static 0.0.0.0 0 192.168.1.18

r4ip route-static 0.0.0.0 0 192.168.1.22 preference 61

r4ip route-static 192.168.1.96 27 192.168.1.13

r4ip route-static 192.168.1.8 30 192.168.1.13

r4ip route-static 192.168.1.32 27 192.168.1.13

r4ip route-static 192.168.1.32 27 192.168.1.5

r4ip route-static 192.168.1.0 30 192.168.1.5

r4ip route-static 192.168.1.64 27 192.168.1.5

r4ip route-static 192.168.1.0 24 NULL 0

r4ip route-static 192.168.1.160 27 192.168.1.18 --- 防止空接口讲数据包丢掉

r4ip route-static 192.168.1.160 27 192.168.1.22 preference 61 --- 浮动静态路由

AR5:

r5ip route-static 192.168.1.0 24 192.168.1.17

r5ip route-static 192.168.1.0 24 GigabitEthernet 0/0/0 192.168.1.21

r5ip route-static 0.0.0.0 0 12.0.0.2

3)在AR3上配置DHCP

r3dhcp enable

r3ip pool aaa

r3-ip-pool-aaanetwork 192.168.1.96 mask 27

r3-ip-pool-aaagateway-list 192.168.1.97

r3-ip-pool-aaaq

r3int g 0/0/2

r3-GigabitEthernet0/0/2dhcp select global

4)对AR5配置nat协议

r5acl 2000

r5-acl-basic-2000rule permit source 192.168.1.0 0.0.0.255

r5-acl-basic-2000q

r5int g 0/0/1

r5-GigabitEthernet0/0/1nat outbound 2000

5)对AR1启动telnet

r1aaa

r1-aaalocal-user xujialong privilege level 15 password cipher 123456

r1-aaaq

r1user-interface vty 0 4

r1-ui-vty0-4authentication-mode aaa

6)在AR5上启动nat的映射配置

r5int g0/0/1

r5-GigabitEthernet0/0/1nat server protocol tcp global current-interface 23 in

side 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

7)在AR6 上远程登陆

<isp>telnet 12.0.0.1

相关推荐
fb_123451 小时前
Linux三剑客超全精讲(grep+sed+awk)零基础入门|正则+实战面试题
linux·运维·服务器
HiDev_1 小时前
【非标自动化】2、认识元器件(节流阀)
运维·自动化
火车叼位2 小时前
Bash 实现 IDE 式补全的组件与配置
linux·运维
晓晓_za8986682 小时前
Geo 优化服务 CI/CD 流水线搭建:源码自动构建、测试与灰度发布
运维·服务器·tcp/ip·spring·缓存·ci/cd
潘正翔2 小时前
k8s高级_调度器Deployment
linux·运维·云原生·容器·kubernetes·jenkins·devops
风流 少年2 小时前
hutool
java·服务器·开发语言
Tangyuewei2 小时前
388 个 PR:AI 自主运维实测
运维·人工智能
H_oRIZoN_2 小时前
Linux入门DAY27(文件IO(系统调用)详解|open/read/write/lseek)
java·linux·服务器
xiamo@moment2 小时前
kafka学习笔记-概念总集
运维·kafka
格尔曼Noah2 小时前
iPhone共享网络给电脑的方式
网络·电脑·iphone