当前位置:网站首页>HCIP 交换实验
HCIP 交换实验
2022-08-04 09:54:00 【科目三考了六次.】
实验要求及拓扑

实验配置
分别进入SW1与SW2的G0/0/23与G0/0/24接口配置eth-trunk
[SW1]interface Eth-Trunk 0
[SW1]interface g0/0/23
[SW1-GigabitEthernet0/0/23]eth-trunk 0
[SW1-GigabitEthernet0/0/23]int g0/0/24
[SW1-GigabitEthernet0/0/24]eth-trunk 0
[SW2]int Eth-Trunk 0
[SW2]int g0/0/23
[SW2-GigabitEthernet0/0/23]eth-trunk 0
[SW2]int g0/0/24
[SW2-GigabitEthernet0/0/24]eth-trunk 0
将交换机互连的链路类型调为trunk
[SW1]port-group group-member GigabitEthernet 0/0/3 GigabitEthernet 0/0/4 Eth-
Trunk 0
[SW1-port-group]port link-type trunk
[SW1-GigabitEthernet0/0/3]port link-type trunk
[SW1-GigabitEthernet0/0/4]port link-type trunk
[SW1-Eth-Trunk0]port link-type trunk
[SW1-port-group]port trunk allow-pass vlan 2
[SW1-GigabitEthernet0/0/3]port trunk allow-pass vlan 2
[SW1-GigabitEthernet0/0/4]port trunk allow-pass vlan 2
[SW1-Eth-Trunk0]port trunk allow-pass vlan 2
[SW2]port-group group-member GigabitEthernet 0/0/3 GigabitEthernet 0/0/5 Eth-Tru
nk 0
[SW2-port-group]port link-type trunk
[SW2-GigabitEthernet0/0/3]port link-type trunk
[SW2-GigabitEthernet0/0/5]port link-type trunk
[SW2-Eth-Trunk0]port link-type trunk
[SW2-port-group]port trunk allow-pass vlan 2
[SW2-GigabitEthernet0/0/3]port trunk allow-pass vlan 2
[SW2-GigabitEthernet0/0/5]port trunk allow-pass vlan 2
[SW2-Eth-Trunk0]port trunk allow-pass vlan 2
[SW3]port-group group-member GigabitEthernet 0/0/3 GigabitEthernet 0/0/5
[SW3-port-group]port link-type trunk
[SW3-GigabitEthernet0/0/3]port link-type trunk
[SW3-GigabitEthernet0/0/5]port link-type trunk
[SW3-port-group]port trunk allow-pass vlan 2
[SW3-GigabitEthernet0/0/3]port trunk allow-pass vlan 2
[SW3-GigabitEthernet0/0/5]port trunk allow-pass vlan 2
[SW4]port-group group-member GigabitEthernet 0/0/3 GigabitEthernet 0/0/4
[SW4-port-group]port link-type trunk
[SW4-GigabitEthernet0/0/3]port link-type trunk
[SW4-GigabitEthernet0/0/4]port link-type trunk
[SW4-port-group]port trunk allow-pass vlan 2
[SW4-GigabitEthernet0/0/3]port trunk allow-pass vlan 2
[SW4-GigabitEthernet0/0/4]port trunk allow-pass vlan 2
VLAN的创建和划分
[SW3]int g0/0/2
[SW3-GigabitEthernet0/0/2]port link-type access
[SW3-GigabitEthernet0/0/2]port default vlan 2
[SW4]int g0/0/2
[SW4-GigabitEthernet0/0/2]port link-type access
[SW4-GigabitEthernet0/0/2]port default vlan 2
在各台交换机上配置MSTP(各台交换机配置相同)
[SW4]stp mode mstp
[SW4]stp enable
[SW4]stp region-configuration
[SW4-mst-region]region-name klpk
[SW4-mst-region]instance 1 vlan 1
[SW4-mst-region]instance 2 vlan 2
[SW4-mst-region]active region-configuration
在各台交换机上查看STP brief发现SW4为根
接入层设备SW4为根,先需将根调整到汇聚层设备SW1上,根据分流需要,将组1的根调整到SW1,备根调整到SW2;将组2的根调整到SW2,备根调整到SW1;
[SW1]stp instance 1 root primary
[SW1]stp instance 2 root secondary
[SW2]stp instance 1 root secondary
[SW2]stp instance 2 root primary
配置完成后查看SW3与SW4的STP brief观察被阻塞接口
配置SVI
[SW1]interface vlan 1
[SW1-Vlanif1]ip add 172.16.1.1 25
[SW1-Vlanif1]int vlan 2
[SW1-Vlanif2]ip add 172.16.1.129 25
[SW2]int vlan 1
[SW2-Vlanif1]ip add 172.16.1.2 25
[SW2-Vlanif1]int vlan 2
[SW2-Vlanif2]ip add 172.16.1.130 25
配置VRRP(网关冗余)
[SW1]int vlan 1
[SW1-Vlanif1]vrrp vrid 1 virtual-ip 172.16.1.126
[SW1-Vlanif1]vrrp vrid 1 priority 120
[SW1-Vlanif1]vrrp vrid 1 track interface GigabitEthernet 0/0/1 reduced 30
[SW1]int vlan 2
[SW1-Vlanif2]vrrp vrid 1 virtual-ip 172.16.1.254
[SW2]int vlan 1
[SW2-Vlanif1]vrrp vrid 1 virtual-ip 172.16.1.126
[SW2]int vlan 2
[SW2-Vlanif2]vrrp vrid 1 virtual-ip 172.16.1.254
[SW2-Vlanif2]vrrp vrid 1 priority 120
[SW2-Vlanif2]vrrp vrid 1 track interface GigabitEthernet 0/0/2 reduced 30
VRRP配置完成
配置DHCP
[SW1]dhcp enable
[SW1]ip pool v1
[SW1-ip-pool-v1]network 172.16.1.0 mask 25
[SW1-ip-pool-v1]gateway-list 172.16.1.126
[SW1-ip-pool-v1]dns-list 114.114.114.114
[SW1]ip pool v2
[SW1-ip-pool-v2]network 172.16.1.128 mask 25
[SW1-ip-pool-v2]gateway-list 172.16.1.254
[SW1-ip-pool-v2]dns-list 114.114.114.114
[SW1]int vlan 1
[SW1-Vlanif1]dhcp select global
[SW1-Vlanif1]int vlan 2
[SW1-Vlanif2]dhcp select global
[SW2]dhcp enable
[SW2]ip pool v1
[SW2-ip-pool-v1] gateway-list 172.16.1.126
[SW2-ip-pool-v1] network 172.16.1.0 mask 255.255.255.128
[SW2-ip-pool-v1] dns-list 114.114.114.114
[SW2-ip-pool-v1]ip pool v2
[SW2-ip-pool-v2] gateway-list 172.16.1.254
[SW2-ip-pool-v2] network 172.16.1.128 mask 255.255.255.128
[SW2-ip-pool-v2] dns-list 114.114.114.114
[SW2]int vlan 1
[SW2-Vlanif1]dhcp select global
[SW2-Vlanif1]int vlan 2
[SW2-Vlanif2]dhcp select global
因ENSP模拟器自身问题需在SW1,SW2配置SVI模拟3层接口配置IP
[SW1]vlan 100
[SW1-vlan100]int g0/0/1
[SW1-GigabitEthernet0/0/1]port link-type access
[SW1-GigabitEthernet0/0/1]port default vlan 100
[SW1-GigabitEthernet0/0/1]int vlan 100
[SW1-Vlanif100]ip add 172.16.0.1 30
[SW2]vlan 100
[SW2]int g0/0/2
[SW2-GigabitEthernet0/0/2]port link-type access
[SW2-GigabitEthernet0/0/2]port default vlan 100
[SW2-GigabitEthernet0/0/2]int vlan 100
[SW2-Vlanif100]ip add 172.16.0.5 30
配置路由器IP
[R1]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 172.16.0.2 30
[R1-GigabitEthernet0/0/1]int g0/0/2
[R1-GigabitEthernet0/0/2]ip add 172.16.0.6 30
[R1-GigabitEthernet0/0/2]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 12.1.1.1 24
[ISP]int g0/0/0
[ISP-GigabitEthernet0/0/0]ip add 12.1.1.2 24
[ISP-GigabitEthernet0/0/0]int lo 0
[ISP-LoopBack0]ip add 1.1.1.1 24
配置OSPF(三层链路做成Area0,底下部分做成Area1)
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.0.255
[SW1]ospf 1 router-id 2.2.2.2
[SW1-ospf-1]area 0
[SW1-ospf-1-area-0.0.0.0]network 172.16.0.1 0.0.0.0
[SW1-ospf-1]area 1
[SW1-ospf-1-area-0.0.0.1]network 172.16.1.1 0.0.0.0
[SW1-ospf-1-area-0.0.0.1]network 172.16.1.129 0.0.0.0
[SW2]ospf 1 router-id 3.3.3.3
[SW2-ospf-1]area 0
[SW2-ospf-1-area-0.0.0.0]network 172.16.0.5 0.0.0.0
[SW2-ospf-1]area 1
[SW2-ospf-1-area-0.0.0.1]network 172.16.1.2 0.0.0.0
[SW2-ospf-1-area-0.0.0.1]network 172.16.1.130 0.0.0.0
[SW1]ospf 1
[SW1-ospf-1]area 1
[SW1-ospf-1-area-0.0.0.1]abr-summary 172.16.1.0 255.255.255.0
[SW2]ospf 1
[SW2-ospf-1]area 1
[SW2-ospf-1-area-0.0.0.1]abr-summary 172.16.1.0 255.255.255.0
4
为解决SVI多余建邻的问题,需配置静默接口
[SW1]ospf 1
[SW1-ospf-1]silent-interface all
[SW1-ospf-1]undo silent-interface GigabitEthernet 0/0/1
[SW1-ospf-1]undo silent-interface Eth-Trunk 0
[SW1-ospf-1]undo silent-interface Vlanif 1
[SW1-ospf-1]undo silent-interface Vlanif 100
[SW2]ospf 1
[SW2-ospf-1]silent-interface all
[SW2-ospf-1]undo silent-interface GigabitEthernet 0/0/2
[SW2-ospf-1]undo silent-interface Eth-Trunk 0
[SW2-ospf-1]undo silent-interface Vlanif 100
[SW2-ospf-1]undo silent-interface Vlanif 1
在R1上配置easy nat
[R1]ip route-static 0.0.0.0 0 12.1.1.2
[R1]ospf 1
[R1-ospf-1]default-route-advertise
[R1]acl 2000
[R1-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]nat outbound 2000
实验测试
PC1
启动SW1,关闭SW2,通过PC4访问外网再次测试
PC4
边栏推荐
- canvas画图时的bug记录
- HTB-Nibbles
- redis解决分布式session问题
- 学习在微信小程序中判断url的文件后缀格式
- I am 37 this year, and I was rushed by a big factory to...
- TiCDC迁移-TiDB到MySQL测试
- [论文阅读] Unpaired Image-to-Image Translation Using Adversarial Consistency Loss
- ps抠图怎么抠出来,自学ps软件photoshop2022,ps怎么抠出想要的部分-笔记记录
- SVG 的 path 属性绘制图形
- LeetCode中等题之旋转图像
猜你喜欢

MindSpore:mirrorpad算子速度过慢的问题
![Detailed explanation of MSTP protocol configuration on Layer 3 switches [Huawei eNSP experiment]](/img/97/6c3662ef36b02bc42eec95abaa6bc5.png)
Detailed explanation of MSTP protocol configuration on Layer 3 switches [Huawei eNSP experiment]

leetcode单调栈经典例题——最大矩形

TiCDC同步延迟问题处理

XCTF-easy_Maze

罗克韦尔AB PLC RSLogix5000中定时器指令使用方法介绍

数据使用要谨慎——不良数据带来严重后果

I am 37 this year, and I was rushed by a big factory to...

LeetCode中等题之旋转图像
![Cloud function to achieve automatic website check-in configuration details [Web function/Nodejs/cookie]](/img/56/2ad889a3a740d0a7624b25f6307616.png)
Cloud function to achieve automatic website check-in configuration details [Web function/Nodejs/cookie]
随机推荐
Techwiz OLED:OLED器件的发光效率
[Punctuality Atom STM32 Serial] Chapter 3 Development Environment Construction Excerpted from [Punctual Atom] MiniPro STM32H750 Development Guide_V1.1
我和 TiDB 的故事 | TiDB 对我不离不弃,我亦如此
为企业数字化转型提供服务_数字赋能企业转型
学习使用php把stdClass Object转array的方法整理
matlab练习程序(多线段交点)
Win11文件资源管理器找不到选项卡怎么办?
无代码平台多行文字入门教程
Win11如何隐藏输入法悬浮窗?
Detailed explanation of telnet remote login aaa mode [Huawei eNSP]
leetcode每天5题-Day06
架构设计杂谈
开源一夏 | 查询分页不只有limit,这四种分页方法值得掌握
Producer and Consumer Problems in Concurrent Programming
多了<audio controls=
LVS-DR集群部署
关于技术学习的6个观点
渗透——信息收集
redis解决分布式session问题
usb设备复合g_webcam摄像头码流传输功能以及g_serial串口功能