HCIP静态综合实验1

1.TCP3次握手,4次挥手可靠机制详解:

第一次握手:客户端发送网络包,服务端收到了。这样服务端就能得出结论:客户端的发送能力、服务端的接收能力是正常的。
第二次握手:服务端发包,客户端收到了。这样客户端就能得出结论:服务端的接收、发送能力,客户端的接收、发送能力是正常的。不过此时服务器并不能确认客户端的接收能力是否正常。
第三次握手:客户端发包,服务端收到了。这样服务端就能得出结论:客户端的接收、发送能力正常,服务器自己的发送、接收能力也正常。

这里是引用 刚开始客户端处于 closed 的状态,服务端处于 listen 状态。然后
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 状态。

  4、服务器收到 ACK 报文之后,也处于 establised 状态,此时,双方以建立起了链接。
  Ps:
 (1)SYN=1 表示该报文不携带数据,但消耗一个序号 seq=x,seq=x是客户端的初始化序列号,因为tcp是面向字节流的
 (2)SYN=1 表示该报文不携带数据,但消耗一个序号 seq=y,seq=y是服务器的初始化序列号,ACK=1是一个确认号
ack=x+1,表示服务器下次接收到的序号希望是x+1。然后服务器进入到SYN-RCVD等待的状态
 (3)ACK=1是一个确认号,seq=x+1是上一次服务器回应的序号要求,ack=y+1表示客户下一次接收到的序号希望是y+1

在这里插入图片描述
1、第一次挥手:客户端发送一个 FIN 报文,报文中会指定一个序列号。此时客户端处于FIN_WAIT1状态。

2、第二次握手:服务端收到 FIN 之后,会发送 ACK 报文,且把客户端的序列号值 + 1 作为 ACK 报文的序列号值,表明已经收到客户端的报文了,此时服务端处于 CLOSE_WAIT状态。

3、第三次挥手:如果服务端也想断开连接了,和客户端的第一次挥手一样,发给 FIN 报文,且指定一个序列号。此时服务端处于 LAST_ACK 的状态。

4、第四次挥手:客户端收到 FIN 之后,一样发送一个 ACK 报文作为应答,且把服务端的序列号值 + 1 作为自己 ACK 报文的序列号值,此时客户端处于 TIME_WAIT 状态。需要过一阵子以确保服务端收到自己的 ACK 报文之后才会进入 CLOSED 状态

5、服务端收到 ACK 报文之后,就处于关闭连接了,处于 CLOSED 状态。
在这里插入图片描述

2.按要求完成以下实验:

1.r6为isp,接口ip地址均为公有地址;该设备只能配置ip地址,之后不能在对其进行任何配置
2.r1-r5为局域网,私有ip地址192.168.1.0/24,请合理分配
3.所有路由器上环回,均代表连接用户的接口
4.r3下的两台pc通过dhcp自动获取ip地址
5.选路最佳,路由表尽量小,避免环路
6.r1-r5均可访问r6的环回
7.r6 telnet r5的 公有ip地址时,实际登录到r1上
8.r4与r5正常通过1000兆链路,故障时通过100兆链路

在这里插入图片描述
网络部署思路:
在这里插入图片描述

规划IP:好汇总 ;便于管理 ,可以减少路由条目
骨干192.168.1.0/24 (子网划分最多借30位)可以看成一条,然后把他在进行划分:
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
地址还有预留,以便后期使用

每个路由器IP:
192.168.1.0 /24
把环回看成一个网段:
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

R3:
192.168.1.96 /27

R4:
192.168.1.128 /27

  • 192.168.1.128 /28
  • 192.168.1.144 /28

R5:
192.168.1.160 /27

预留IP:
192.168.1.192 /27
192.168.1.224 /27
在这里插入图片描述

配置环回地址

R1

[Huawei]sys R1
[R1]int LoopBack 0
[R1-LoopBack0]ip add 192.168.1.32 28
[R1-LoopBack0]int LoopBack 1
[R1-LoopBack1]ip add 192.168.1.48 28

R2

[Huawei]sys R2
[R2]int LoopBack 0
[R2-LoopBack0]ip add 192.168.1.65 28
[R2-LoopBack0]int LoopBack 1
[R2-LoopBack1]ip add 192.168.1.81 28

R4

[Huawei]sys R4
[R4]int LoopBack 0
[R4-LoopBack0] ip add 192.168.1.129 28
[R4-LoopBack0]int LoopBack 1
[R4-LoopBack1]ip add 192.168.1.145 28

R5

[Huawei]sys R5
[R5]int LoopBack 0
[R5-LoopBack0]ip add 192.168.1.161 27

R6

[Huawei]sys R6
[R6]int LoopBack 0
[R6-LoopBack0]ip add 6.6.6.6 24

配置路由

提示:缺省路由,防止环化
R1:
缺省

ip route-static 0.0.0.0 0 192.168.1.2
ip route-static 0.0.0.0 0 192.168.1.6
ip route-static 0.0.0.0 0 192.168.1.2
ip route-static 0.0.0.0 0 192.168.1.6
ip route-static 192.168.1.64 27 192.168.1.2
ip route-static 192.168.1.8 30 192.168.1.2
ip route-static 192.168.1.96 27 192.168.1.6
ip route-static 192.168.1.12 30 192.168.1.6

R2:

ip route-static 0.0.0.0 0 192.168.1.10
ip route-static 192.168.1.32 27 192.168.1.1
ip route-static 192.168.1.4 30 192.168.1.1
ip route-static 192.168.1.96 27 192.168.1.1
ip route-static 192.168.1.96 27 192.168.1.10

R3

ip route-static 0.0.0.0 0 192.168.1.14
ip route-static 192.168.1.32 27 192.168.1.5
ip route-static 192.168.1.0 30 192.168.1.5
ip route-static 192.168.1.64 27 192.168.1.5
ip route-static 192.168.1.64 27 192.168.1.14

R4

ip route-static 0.0.0.0 0 192.168.1.18
ip route-static 192.168.1.0 30 192.168.1.9
ip route-static 192.168.1.64 27 192.168.1.9
ip route-static 192.168.1.4 30 192.168.1.13
ip route-static 192.168.1.96 27 192.168.1.13
ip route-static 192.168.1.32 27 192.168.1.13
ip route-static 192.168.1.32 27 192.168.1.9

R5

ip route-static 0.0.0.0 0 56.1.1.2
ip route-static 192.168.1.128 27 192.168.1.17
ip route-static 192.168.1.64 27 192.168.1.17
ip route-static 192.168.1.96 27 192.168.1.17
ip route-static 192.168.1.32 27 192.168.1.17
ip route-static 192.168.1.0 30 192.168.1.17
ip route-static 192.168.1.4 30 192.168.1.17
ip route-static 192.168.1.8 30 192.168.1.17
ip route-static 192.168.1.12 30 192.168.1.17

配置骨干

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.5 30

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.9 30

R3骨干

[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 192.168.1.6 30
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 192.168.1.13 30

R4骨干

[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip add 192.168.1.10 30
[R4-GigabitEthernet0/0/0]int g0/0/1
[R4-GigabitEthernet0/0/1]ip add 192.168.1.14 30
[R4-GigabitEthernet0/0/1]int g4/0/0
[R4-GigabitEthernet4/0/0]ip add 192.168.1.17 30
[R4-GigabitEthernet4/0/0]int g0/0/2
[R4-GigabitEthernet0/0/2]ip add 192.168.1.21 30

R5骨干

[R5]int g0/0/2
[R5-GigabitEthernet0/0/2]ip add 192.168.1.18 30
[R5-GigabitEthernet0/0/2]int g0/0/0
[R5-GigabitEthernet0/0/0]ip add 192.168.1.22 30
[R5-GigabitEthernet0/0/0]int g0/0/1
[R5-GigabitEthernet0/0/1]ip add 56.1.1.1 24

R6骨干

[R6]int g0/0/0
[R6-GigabitEthernet0/0/0]ip add 56.1.1.2 24

R3配置DHCP

[Huawei]sy R3
[R3]int g 0/0/2
[R3-GigabitEthernet0/0/0]ip add 192.168.1.97 27
[R3]dhcp enable
[R3]ip pool a
[R3-ip-pool-a]network 192.168.1.96 mask 27
[R3-ip-pool-a]gateway-list 192.168.1.97
[R3-ip-pool-a]dns-list 114.114.114.114 8.8.8.8
[R3-ip-pool-a]display this

ip pool a
gateway-list 192.168.1.97
network 192.168.1.96 mask 255.255.255.224
dns-list 114.114.114.114 8.8.8.8
return
[R3]int g0/0/2
[R3-GigabitEthernet0/0/2]dhcp select global

为了访问外部网络,搭建一个NAT

R5的g0/0/1口:
[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

防环操作:

R1

ip route-static 192.168.1.32 27 NULL 0

R2

ip route-static 192.168.1.64 27 NULL 0

R4

ip route-static 192.168.1.128 27 NULL 0

要求8::4与5正常通过1000兆链路,故障时通过100兆链路

R4

ip route-static 0.0.0.0 0 192.168.1.22 preference 61

R5

ip route-static 0.0.0.0     0.0.0.0 56.1.1.2
ip route-static 192.168.1.0  255.255.255.252 192.168.1.21 pr 61
ip route-static 192.168.1.4 255.255.255.252 192.168.1.21 pr 61
ip route-static 192.168.1.8 255.255.255.252 192.168.1.21 pr 61
ip route-static 192.168.1.12 255.255.255.252 192.168.1.21 pr 61
ip route-static 192.168.1.32 255.255.255.224 192.168.1.21 pr 61
ip route-static 192.168.1.64 255.255.255.224 192.168.1.21 pr 61
ip route-static 192.168.1.96 255.255.255.224 192.168.1.21 pr 61
ip route-static 192.168.1.128 255.255.255.224 192.168.1.21 pr 61

测试

[R5]int g4/0/0
[R5-GigabitEthernet4/0/0]shutdown

要求7:远程登录R6 telnet R5的公有ip地址时,实际登录到R1上

R1开启telnet
[R1]aaa
[R1-aaa]local-user an password cipher 123
Info: Add a new user.
[R1-aaa]local-user an service-type telnet
[R1-aaa]q
[R1]user-interface vty 0 4
[R1-ui-vty0-4]authentication-mode aaa
R5端口映射
[R5]int g0/0/1
[R5-GigabitEthernet0/0/1]nat server protocol tcp global current-interface 23 ins
ide 192.168.1.1 23
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值