在了解TCP3次握手详细过程之前,我们首先需要了解 ACK SYN FIN这三个部分
首先由Client发出请求连接即 SYN=1 ACK=0 (请看头字段的介绍), TCP规定SYN=1时不能携带数据,但要消耗一个序号,因此声明自己的序号是 seq=x
然后 Server 进行回复确认,即 SYN=1 ACK=1 seq=y, ack=x+1,
再然后 Client 再进行一次确认,但不用SYN 了,这时即为 ACK=1, seq=x+1, ack=y+1.
然后连接建立。
进行三次握手的原因:主要是为了防止已失效的连接请求报文段突然又传送到了B,因而产生错误。
子网划分
第二步 配置各个接口的IP以及R3的DHCP服务
R1-接口IP配置
R2-接口IP配置
R3-接口IP配置
[Huawei-LoopBack0]ip address 192.168.1.65 28
[Huawei-LoopBack1]ip address 192.168.1.81 28
R4
[Huawei-LoopBack0]ip address 192.168.1.129 28`
[Huawei-LoopBack1]ip address 192.168.1.145 28
R5
[Huawei-LoopBack0]ip address 192.168.1.161 27
R6
[Huawei-LoopBack0]ip address 6.6.6.6 24
[Huawei]ip route-static 0.0.0.0 0 192.168.1.2
[Huawei]ip route-static 0.0.0.0 0 192.168.1.13
R2
[Huawei]ip route-static 0.0.0.0 0 192.168.1.6
R3
[Huawei]ip route-static 0.0.0.0 0 192.168.1.9
R4
[Huawei]ip route-static 0.0.0.0 0.0.0.0 192.168.1.18
R5
[Huawei]ip route-static 0.0.0.0 0.0.0.0 56.1.1.2
四、静态配置(下一跳)
R1
[Huawei]ip route-static 192.168.1.4 255.255.255.252 192.168.1.2
[Huawei]ip route-static 192.168.1.8 255.255.255.252 192.168.1.13
[Huawei]ip route-static 192.168.1.32 255.255.255.224 NULL0 #配置空环回,防止环路
[Huawei]ip route-static 192.168.1.64 255.255.255.224 192.168.1.2
[Huawei]ip route-static 192.168.1.96 255.255.255.224 192.168.1.13
R2
[Huawei]ip route-static 192.168.1.12 255.255.255.252 192.168.1.1
[Huawei]ip route-static 192.168.1.32 255.255.255.224 192.168.1.1
[Huawei]ip route-static 192.168.1.64 255.255.255.224 NULL0 #配置空环回,防止环路
[Huawei]ip route-static 192.168.1.96 255.255.255.224 192.168.1.1
[Huawei]ip route-static 192.168.1.96 255.255.255.224 192.168.1.6
R3
[Huawei]ip route-static 192.168.1.0 255.255.255.252 192.168.1.14
[Huawei]ip route-static 192.168.1.32 255.255.255.224 192.168.1.14
[Huawei]ip route-static 192.168.1.64 255.255.255.224 192.168.1.14
[Huawei]ip route-static 192.168.1.64 255.255.255.224 192.168.1.9
R4
[Huawei]ip route-static 0.0.0.0 0.0.0.0 192.168.1.22 preference 70 #设置优先级
[Huawei]ip route-static 192.168.1.128 27 NULL 0 #配置空环回,防止环路
[Huawei]ip route-static 192.168.1.0 255.255.255.252 192.168.1.5
[Huawei]ip route-static 192.168.1.12 255.255.255.252 192.168.1.10
[Huawei]ip route-static 192.168.1.32 255.255.255.224 192.168.1.5
[Huawei]ip route-static 192.168.1.32 255.255.255.224 192.168.1.10
[Huawei]ip route-static 192.168.1.64 255.255.255.224 192.168.1.5
[Huawei]ip route-static 192.168.1.96 255.255.255.224 192.168.1.10
R5
[Huawei]ip route-static 192.168.1.64 255.255.255.224 192.168.1.17
[Huawei]ip route-static 192.168.1.64 255.255.255.224 192.168.1.21 preference 70
[Huawei]ip route-static 192.168.1.96 255.255.255.224 192.168.1.17
[Huawei]ip route-static 192.168.1.96 255.255.255.224 192.168.1.21 preference 70
[Huawei]ip route-static 192.168.1.128 255.255.255.224 192.168.1.17
[Huawei]ip route-static 192.168.1.128 255.255.255.224 192.168.1.21 preference 70
[Huawei]ip route-static 192.168.1.4 255.255.255.252 192.168.1.17
[Huawei]ip route-static 192.168.1.4 255.255.255.252 192.168.1.21 preference 70
[Huawei]ip route-static 192.168.1.8 255.255.255.252 192.168.1.17
[Huawei]ip route-static 192.168.1.8 255.255.255.252 192.168.1.21 preference 70
[Huawei]ip route-static 192.168.1.12 255.255.255.252 192.168.1.17
[Huawei]ip route-static 192.168.1.12 255.255.255.252 192.168.1.21 preference 70
[Huawei]acl 2000
[Huawei-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[Huawei-acl-basic-2000]int g 0/0/0
[Huawei-GigabitEthernet0/0/0]nat outbound 2000