HCIP作业

TCP 3次握手4次断开

三次握手过程:
在这里插入图片描述
(1)第一次握手
客户端给服务端发一个 SYN 报文,并指明客户端的初始化序列号 ISN(c)。此时客户端处于 SYN_Send 状态。
(2)第二次握手
服务器收到客户端的 SYN 报文之后,会以自己的 SYN 报文作为应答,并且也是指定了自己的初始化序列号 ISN(s),同时会把客户端的 ISN + 1 作为 ACK 的值,表示自己已经收到了客户端的 SYN,此时服务器处于 SYN_REVD 的状态。
(3)第三次握手
客户端收到 SYN 报文之后,会发送一个 ACK 报文,当然,也是一样把服务器的 ISN + 1 作为 ACK 的值,表示已经收到了服务端的 SYN 报文,此时客户端处于 establised 状态。

四次挥手过程:
在这里插入图片描述
TCP断开连接得过程分为4步,我们称之为四次挥手。
(1)客户端发送一个 FIN 报文,报文中会指定一个序列号。此时客户端处于FIN_WAIT1状态。
(2)服务端收到 FIN 之后,会发送 ACK 报文,且把客户端的序列号值 + 1 作为 ACK 报文的序列号值,表明已经收到客户端的报文了,此时服务端处于 CLOSE_WAIT状态。
(3)如果服务端也想断开连接了,和客户端的第一次挥手一样,发给 FIN 报文,且指定一个序列号。此时服务端处于 LAST_ACK 的状态。
(4)客户端收到 FIN 之后,一样发送一个 ACK 报文作为应答,且把服务端的序列号值 + 1 作为自己 ACK 报文的序列号值,此时客户端处于 TIME_WAIT 状态。需要过一阵子以确保服务端收到自己的 ACK 报文之后才会进入 CLOSED 状态
*

静态综合实验

在这里插入图片描述
分析:192.168.1.0/24
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.32/27 R1环回可以再划分为 192.168.1.32/28 192.168.1.48/28
192.168.1.64/27 R2环回可以再划分为 192.168.1.64/28 192.168.1.80/28
192.168.1.96/27 R3
192.168.1.128/27 R4环回可以再划分为 192.168.1.128/28 192.168.1.144/28
192.168.1.160/27 R5

地址规划之后:
在这里插入图片描述
配IP地址:
R1
[R1]interface LoopBack 0
[R1-LoopBack0]ip address 192.168.1.33 28
[R1-LoopBack0]int lo1
[R1-LoopBack1]ip address 192.168.1.49 28
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 3
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip address 192.168.1.5 30
//缺省路由
[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.8 30 192.168.1.2
[R1]ip route-static 192.168.1.96 27 192.168.1.6
[R1]ip route-static 192.168.1.12 30 192.168.1.6

[R1]ip route-static 192.168.1.32 27 null 0

[R1]aaa
[R1-aaa]local-user kimi privilege level 15 password cipher 123456
Info: Add a new user.
[R1-aaa]local-user kimi service-type telnet
[R1-aaa]q
[R1]user-interface vty 0
[R1-ui-vty0]au
[R1-ui-vty0]authentication-mode aaa
在这里插入图片描述

R2
[R2]int lo0
[R2-LoopBack0]ip address 192.168.1.65 28
[R2-LoopBack0]int lo1
[R2-LoopBack1]ip address 192.168.1.81 28
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.1.2 30
[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]ip address 192.168.1.9 30
//缺省路由
[R2]ip route-static 0.0.0.0 0 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

R3
[R3]int g0/0/2
[R3-GigabitEthernet0/0/2]ip address 192.168.1.97 27
[R3-GigabitEthernet0/0/2]int g0/0/1
[R3-GigabitEthernet0/0/1]ip address 192.168.1.6 30
//缺省路由
[R3]ip route-static 0.0.0.0 0 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 192.168.1.64 27 192.168.1.14

R4
[R4]int lo0
[R4-LoopBack0]ip address 192.168.1.129 28
[R4-LoopBack0]int lo1
[R4-LoopBack1]ip address 192.168.1.145 28
[R4-LoopBack1]int g0/0/0
[R4-GigabitEthernet0/0/0]ip address 192.168.1.10 30
[R4-GigabitEthernet0/0/0]int g0/0/1
[R4-GigabitEthernet0/0/1]ip address 192.168.1.14 30
[R4-GigabitEthernet0/0/1]int g0/0/2
[R4-GigabitEthernet0/0/2]ip address 192.168.1.17 30
[R4-GigabitEthernet0/0/2]int g4/0/0
[R4-GigabitEthernet4/0/0]ip address 192.168.1.21 30
//缺省路由
[R4]ip route-static 0.0.0.0 0 192.168.1.18

[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.4 30 192.168.1.13
[R4]ip route-static 192.168.1.96 27 192.168.1.13
[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 0.0.0.0 0 192.168.1.22 preference 61

[R4]ip route-static 192.168.1.128 27 null 0

R5
[R5]int lo0
[R5-LoopBack0]ip address 192.168.1.161 27
[R5]int g0/0/0
[R5-GigabitEthernet0/0/0]ip address 192.168.1.18 30
[R5-GigabitEthernet0/0/0]int g0/0/2
[R5-GigabitEthernet0/0/2]ip address 192.168.1.22 30
[R5-GigabitEthernet0/0/2]int g0/0/1
[R5-GigabitEthernet0/0/1]ip address 56.1.1.1 24
//缺省路由
[R5]ip route-static 0.0.0.0 0 56.1.1.2

[R5]IP route-static 192.168.1.32 27 192.168.1.17
[R5]IP route-static 192.168.1.64 27 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.17
[R5]IP route-static 192.168.1.0 30 192.168.1.17
[R5]IP route-static 192.168.1.4 30 192.168.1.17
[R5]IP route-static 192.168.1.8 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.32 27 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.96 27 192.168.1.21 preference 61
[R5]IP route-static 192.168.1.128 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.4 30 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.12 30 192.168.1.21 preference 61

[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]INT G0/0/1
[R5-GigabitEthernet0/0/1]nat server protocol tcp global current-interface 23 inside 192.168.1.1 23
Are you sure to continue?[Y/N]:y
在这里插入图片描述
R6
[R6]int lo0
[R6-LoopBack0]ip address 6.6.6.6 24
[R6]int g0/0/0
[R6-GigabitEthernet0/0/0]ip address 56.1.1.2 24

在这里插入图片描述
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值