HCIA回顾

Posted 小茗,你好

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HCIA回顾相关的知识,希望对你有一定的参考价值。

一、静态综合实验配置

实验要求:

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兆链路

配置:

1、R6为ISP,接口IP地址均为公有地址;该设备只能配置IP地址,之后不能在对其进行任何配置

[ISP]int g0/0/0
[ISP-GigabitEthernet0/0/0]ip add 56.1.1.6 24
[ISP-GigabitEthernet0/0/0]int lo0
[ISP-LoopBack0]ip add 6.6.6.6 24

2、R1-R5为局域网,私有IP地址192.168.1.0/24,请合理分配

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

R3:

[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.1.18 30
[r3-GigabitEthernet0/0/0]int g0/0/1            
[r3-GigabitEthernet0/0/1]ip add 192.168.1.21 30

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.9 30
[r4-GigabitEthernet0/0/1]int g0/0/2           
[r4-GigabitEthernet0/0/2]ip add 192.168.1.14 30
[r4-GigabitEthernet0/0/2]int g4/0/0            
[r4-GigabitEthernet4/0/0]ip add 192.168.1.17 30

R5:

[r5]int g0/0/0
[r5-GigabitEthernet0/0/0]ip add 192.168.1.10 30
[r5-GigabitEthernet0/0/0]int g0/0/1            
[r5-GigabitEthernet0/0/1]ip add 192.168.1.13 30
[r5-GigabitEthernet0/0/1]int g0/0/2            
[r5-GigabitEthernet0/0/2]ip add 56.1.1.5 24环回

3、所有路由器上环回,均代表连接用户的接口(R1、R2、R4均2个环回,R5有1个)

R1:

[r1]int lo0        
[r1-LoopBack0]ip add 192.168.1.33 28
[r1-LoopBack0]int lo1
[r1-LoopBack1]ip add 192.168.1.49 28

R2:

[r2]int lo0
[r2-LoopBack0]ip add 192.168.1.65 28
[r2-LoopBack0]int lo1
[r2-LoopBack1]ip add 192.168.1.81 28

R4:

[r4]int lo0
[r4-LoopBack0]ip add 192.168.1.97 28
[r4-LoopBack0]int lo1
[r4-LoopBack1]ip add 192.168.1.113 28

R5:

[r5]int lo0
[r5-LoopBack0]ip add 192.168.1.129 27

4、R3下的两台PC通过DHCP自动获取IP地址

先创建VLAN,然后划分到 2 台PC上

[LSW]vlan batch 2 3

[LSW]int e0/0/1           
[LSW-Ethernet0/0/1]port link-type access 
[LSW-Ethernet0/0/1]port default vlan 2
[LSW]int e0/0/2
[LSW-Ethernet0/0/2]port link-type access 
[LSW-Ethernet0/0/2]port default vlan 3

R3创建虚拟子接口:

[r3]int g0/0/2.1
[r3-GigabitEthernet0/0/2.1]ip add 192.168.1.161 28
[r3-GigabitEthernet0/0/2.1]dot1q termination vid 2
[r3-GigabitEthernet0/0/2.1]arp broadcast enable 
[r3]int g0/0/2.2
[r3-GigabitEthernet0/0/2.2]ip add 192.168.1.177 28
[r3-GigabitEthernet0/0/2.2]dot1q termination vid 3
[r3-GigabitEthernet0/0/2.2]arp broadcast enable 

R3创建地址池

[r3]ip pool class_A
Info: It's successful to create an IP address pool.  
[r3-ip-pool-class_A]network 192.168.1.160 mask 28
[r3-ip-pool-class_A]gateway-list 192.168.1.161
[r3-ip-pool-class_A]dns-list 8.8.8.8  
[r3]dhcp enable 
[r3]int g0/0/2.1
[r3-GigabitEthernet0/0/2.1]dhcp select global 
[r3]ip pool class_B 
Info: It's successful to create an IP address pool.
[r3-ip-pool-class_B]network 192.168.1.176 mask 28
[r3-ip-pool-class_B]gateway-list 192.168.1.177
[r3-ip-pool-class_B]dns-list 8.8.8.8 
[r3]int g0/0/2.2
[r3-GigabitEthernet0/0/2.2]dhcp select global 

实现R3和交换机LSW通信:

[LSW]int e0/0/3
[LSW-Ethernet0/0/3]port link-type trunk 
[LSW-Ethernet0/0/3]port trunk allow-pass vlan all 

然后点击 2 台PC的DHCP查看:

5、选路最佳,路由表尽量少,避免环路(局域网内静态路由配置)

R1:

[r1]ip route-static 192.168.1.64 27 192.168.1.2
[r1]ip route-static 192.168.1.96 27 192.168.1.2
[r1]ip route-static 192.168.1.128 27 192.168.1.2
[r1]ip route-static 192.168.1.128 27 192.168.1.21
[r1]ip route-static 192.168.1.160 27 192.168.1.21
[r1]ip route-static 192.168.1.4 30 192.168.1.2
[r1]ip route-static 192.168.1.8 30 192.168.1.2
[r1]ip route-static 192.168.1.12 30 192.168.1.21
[r1]ip route-static 192.168.1.16 30 192.168.1.21

R2:

[r2]ip route-static 192.168.1.32 27 192.168.1.1
[r2]ip route-static 192.168.1.96 27 192.168.1.6  
[r2]ip route-static 192.168.1.128 27 192.168.1.6
[r2]ip route-static 192.168.1.160 27 192.168.1.1
[r2]ip route-static 192.168.1.8 30 192.168.1.6  
[r2]ip route-static 192.168.1.12 30 192.168.1.6
[r2]ip route-static 192.168.1.16 30 192.168.1.6
[r2]ip route-static 192.168.1.20 30 192.168.1.1

R3:

[r3]ip route-static 192.168.1.32 27 192.168.1.22
[r3]ip route-static 192.168.1.64 27 192.168.1.22
[r3]ip route-static 192.168.1.64 27 192.168.1.17
[r3]ip route-static 192.168.1.96 27 192.168.1.17
[r3]ip route-static 192.168.1.128 27 192.168.1.17
[r3]ip route-static 192.168.1.0 30 192.168.1.22  
[r3]ip route-static 192.168.1.4 30 192.168.1.17
[r3]ip route-static 192.168.1.8 30 192.168.1.17
[r3]ip route-static 192.168.1.12 30 192.168.1.17

R4:

[r4]ip route-static 192.168.1.32 27 192.168.1.5
[r4]ip route-static 192.168.1.32 27 192.168.1.18
[r4]ip route-static 192.168.1.64 27 192.168.1.5 
[r4]ip route-static 192.168.1.128 27 192.168.1.10
[r4]ip route-static 192.168.1.128 27 192.168.1.13
[r4]ip route-static 192.168.1.160 27 192.168.1.18
[r4]ip route-static 192.168.1.0 30 192.168.1.5   
[r4]ip route-static 192.168.1.20 30 192.168.1.18

R5:

[r5]ip route-static 192.168.1.32 27 192.168.1.9
[r5]ip route-static 192.168.1.32 27 192.168.1.14
[r5]ip route-static 192.168.1.64 27 192.168.1.9 
[r5]ip route-static 192.168.1.96 27 192.168.1.9
[r5]ip route-static 192.168.1.96 27 192.168.1.14
[r5]ip route-static 192.168.1.160 27 192.168.1.14
[r5]ip route-static 192.168.1.0 30 192.168.1.9
[r5]ip route-static 192.168.1.0 30 192.168.1.14
[r5]ip route-static 192.168.1.4 30 192.168.1.14
[r5]ip route-static 192.168.1.4 30 192.168.1.9 
[r5]ip route-static 192.168.1.16 30 192.168.1.14
[r5]ip route-static 192.168.1.20 30 192.168.1.14

6、R1-R5均可访问R6的环回

路由缺省配置:

[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.21

[r2]ip route-static 0.0.0.0 0 192.168.1.6  

[r3]ip route-static 0.0.0.0 0 192.168.1.17

[r4]ip route-static 0.0.0.0 0 192.168.1.10    

[r4]ip route-static 0.0.0.0 0 192.168.1.13

空接口防环路由配置:

[r1]ip route-static 192.168.1.32 27 NULL 0

[r2]ip route-static 192.168.1.64 27 NULL 0

[r3]ip route-static 192.168.1.160 27 NULL 0

[r4]ip route-static 192.168.1.96 27 NULL 0

[r5]ip route-static 192.168.1.128 27 NULL 0

[r5]ip route-static 0.0.0.0 0 192.168.1.9

R5的外网接口能给运营商ISP发送数据包:

[r5]ip route-static 0.0.0.0 0 56.1.1.2  

网络地址转换:

[r5]acl 2000
[r5-acl-basic-2000]rule permit source any 
[r5]int g0/0/2
[r5-GigabitEthernet0/0/2]nat outbound 2000

7、R6 telnet R5的公有IP地址时,实际登录到R1上

给R1配置远程登录:

[r1]user-interface vty 0 4
[r1-ui-vty0-4]authentication-mode aaa
[r1-ui-vty0-4]aaa
[r1-aaa]local-user huawei password cipher huawei
Info: Add a new user.
[r1-aaa]local-user huawei privilege level 15
[r1-aaa]local-user huawei service-type telnet

静态NAT配置:

[r5]nat static global 56.1.1.1 inside 192.168.1.1

8、R4与R5正常通过1000兆链路,故障时通过100兆链路

修改优先级:

[r4]ip route-static 192.168.1.128 27 192.168.1.13 preference 80

二、Windows下查看端口号与进程号关系的命令

在windows控制台窗口下执行:

netstat -nao | findstr "9010"
TCP 127.0.0.1:9010 0.0.0.0:0 LISTENING 3017

你看到是PID为3017的进程占用了9010端口,如果进一步你想知道它的进程名称,你可以使用如下命令:

tasklist | findstr "3017"

三、TCP三次握手详解 

TCP三次握手

整个流程为:

  1. 客户端主动打开,发送连接请求报文段,将SYN标识位置为1,Sequence Number置为x(TCP规定SYN=1时不能携带数据,x为随机产生的一个值),然后进入SYN_SEND状态
  2. 服务器收到SYN报文段进行确认,将SYN标识位置为1,ACK置为1,Sequence Number置为y,Acknowledgment Number置为x+1,然后进入SYN_RECV状态,这个状态被称为半连接状态
  3. 客户端再进行一次确认,将ACK置为1(此时不用SYN),Sequence Number置为x+1,Acknowledgment Number置为y+1发向服务器,最后客户端与服务器都进入ESTABLISHED状态

以上是关于HCIA回顾的主要内容,如果未能解决你的问题,请参考以下文章

HCIA-AI_机器学习_波士顿房价预测

HCIA-AI_机器学习_波士顿房价预测

HCIA笔记

华为datacom-HCIA学习之路

7天零基础能考证HCIA吗?华为认证系统学习路线分享

HCIA知识点总结大纲