HCIP的交换机(STP,VRRP)实验

文章详细描述了在LSW1、LSW2等设备上进行链路聚合、VLAN配置、MSTP区域设置、VRRP虚拟路由器、DHCP服务和OSPF路由配置的过程,以及如何设置静态路由和NAT规则。
摘要由CSDN通过智能技术生成

实验要求:

在这里插入图片描述

拓扑图:

在这里插入图片描述

链路聚合

LSW1

[lsw3]interface Eth-Trunk 1
[lsw3-Eth-Trunk1]trunkport GigabitEthernet 0/0/3 0/0/4
[lsw3-Eth-Trunk1]q
[lsw3]vlan batch 1 2
[lsw3]interface Eth-Trunk 1
[lsw3-Eth-Trunk1]port link-type trunk 
[lsw3-Eth-Trunk1]port trunk allow-pass vlan 1 2
[lsw3-Eth-Trunk1]q
[lsw3]int g0/0/1
[lsw3-GigabitEthernet0/0/1]port link-type trunk
[lsw3-GigabitEthernet0/0/1]port trunk allow-pass vlan 1 2
[lsw3-GigabitEthernet0/0/1]int g0/0/2
[lsw3-GigabitEthernet0/0/2]port link-type trunk
[lsw3-GigabitEthernet0/0/2]port trunk allow-pass vlan 1 2

LSW2

[lsw4]interface Eth-Trunk 1
[lsw4-Eth-Trunk1]trunkport GigabitEthernet 0/0/3 0/0/4
[lsw4-Eth-Trunk1]q
[lsw4]vlan batch 1 2
[lsw4]interface Eth-Trunk 1
[lsw4-Eth-Trunk1]port link-type trunk 
[lsw4-Eth-Trunk1]port trunk allow-pass vlan 1 2
[lsw4-Eth-Trunk1]q
[lsw4]int g0/0/1
[lsw4-GigabitEthernet0/0/1]port link-type trunk
[lsw4-GigabitEthernet0/0/1]port trunk allow-pass vlan 1 2
[lsw4-GigabitEthernet0/0/1]int g0/0/2
[lsw4-GigabitEthernet0/0/2]port link-type trunk
[lsw4-GigabitEthernet0/0/2]port trunk allow-pass vlan 1 2

LSW1配置

[lsw1]vlan batch 1 2
Info: This operation may take a few seconds. Please wait for a moment...done.
[lsw1]
[lsw1]int e0/0/3
[lsw1-Ethernet0/0/3]port link-type trunk
[lsw1-Ethernet0/0/3]port trunk allow-pass vlan 1 2
[lsw1-Ethernet0/0/3]int e0/0/4
[lsw1-Ethernet0/0/4]port link-type trunk
[lsw1-Ethernet0/0/4]port trunk allow-pass vlan 1 2
[lsw1-Ethernet0/0/4]int e0/0/1
[lsw1-Ethernet0/0/1]port link-t	
[lsw1-Ethernet0/0/1]port link-type acc	
[lsw1-Ethernet0/0/1]port link-type access 
[lsw1-Ethernet0/0/1]port de	
[lsw1-Ethernet0/0/1]port default 	
[lsw1-Ethernet0/0/1]port default vlan 1
[lsw1-Ethernet0/0/1]int e0/0/2
[lsw1-Ethernet0/0/2]port link-t	
[lsw1-Ethernet0/0/2]port link-type acc	
[lsw1-Ethernet0/0/2]port link-type access 
[lsw1-Ethernet0/0/2]port de	
[lsw1-Ethernet0/0/2]port default vlan 2

LSW2配置

[lsw2]vlan batch 1 2
Info: This operation may take a few seconds. Please wait for a moment...done.
[lsw2]int e0/0/3
[lsw2-Ethernet0/0/3]port link-type trunk
[lsw2-Ethernet0/0/3]port trunk allow-pass vlan 1 2
[lsw2-Ethernet0/0/3]int e0/0/4
[lsw2-Ethernet0/0/4]port link-type trunk
[lsw2-Ethernet0/0/4]port trunk allow-pass vlan 1 2
[lsw2-Ethernet0/0/4]int e0/0/1
[lsw2-Ethernet0/0/1]port link-t	
[lsw2-Ethernet0/0/1]port link-type ac	
[lsw2-Ethernet0/0/1]port link-type access 
[lsw2-Ethernet0/0/1]port de	
[lsw2-Ethernet0/0/1]port default 	
[lsw2-Ethernet0/0/1]port default vlan 1
[lsw2-Ethernet0/0/1]int e0/0/2
[lsw2-Ethernet0/0/2]port link-t	
[lsw2-Ethernet0/0/2]port link-type acc	
[lsw2-Ethernet0/0/2]port link-type access 
[lsw2-Ethernet0/0/2]port de	
[lsw2-Ethernet0/0/2]port default vlan 2
[lsw2-Ethernet0/0/2]
[lsw2-Ethernet0/0/2]q

所有access接口配置为边缘接口,并配置BPDU保护
LSW1

[lsw1]port-g	
[lsw1]port-group gr	
[lsw1]port-group group-member e0/0/1 e0/0/2
[lsw1-port-group]
[lsw1-port-group]stp ed	
[lsw1-port-group]stp edged-port en	
[lsw1-port-group]stp edged-port enable 
[lsw1-Ethernet0/0/1]stp edged-port enable 
[lsw1-Ethernet0/0/2]stp edged-port enable 
[lsw1-Ethernet0/0/2]q
[lsw1]stp bp	
[lsw1]stp bpdu-p	
[lsw1]stp bpdu-protection .

LSW2

[lsw2]port-g	
[lsw2]port-group gr	
[lsw2]port-group group-member e0/0/1 e0/0/2
[lsw2-port-group]stp ed	
[lsw2-port-group]stp edged-port en	
[lsw2-port-group]stp edged-port enable 
[lsw2-Ethernet0/0/1]stp edged-port enable 
[lsw2-Ethernet0/0/2]stp edged-port enable 
[lsw2-port-group]q
[lsw2]stp bp	
[lsw2]stp bpdu-p	
[lsw2]stp bpdu-protection 

开启MSTP
LSW1

[lsw1]stp mode mstp 	
[lsw1]stp mode mstp 
[lsw1]stp region-configuration 	
[lsw1]stp region-configuration 
[lsw1-mst-region]region-name HCIP
[lsw1-mst-region]revision-level 10	
[lsw1-mst-region]revision-level 10
[lsw1-mst-region]instance 1 vlan 1
[lsw1-mst-region]instance 2 vlan 2
[lsw1-mst-region]active region-configuration

LSW2

[lsw2]
[lsw2]stp mode mstp 	
[lsw2]stp mode mstp 
[lsw2]stp region-configuration 	
[lsw2]stp region-configuration 
[lsw2-mst-region]region-name HCIP
[lsw2-mst-region]revision-level 10	
[lsw2-mst-region]revision-level 10
[lsw2-mst-region]instance 1 vlan 1
[lsw2-mst-region]instance 2 vlan 2
[lsw2-mst-region]active region-configuration 

LSW3

[lsw3]stp mode mstp 	
[lsw3]stp mode mstp 
[lsw3]stp region-configuration 	
[lsw3]stp region-configuration 
[lsw3-mst-region]region-name HCIP
[lsw3-mst-region]revision-level 10	
[lsw3-mst-region]revision-level 10
[lsw3-mst-region]instance 1 vlan 1
[lsw3-mst-region]instance 2 vlan 2
[lsw3-mst-region]active region-configuration 

LSW4

[lsw4]stp mode mstp 	
[lsw4]stp mode mstp 
[lsw4]stp region-configuration 	
[lsw4]stp region-configuration 
[lsw4-mst-region]region-name HCIP
[lsw4-mst-region]revision-level 10	
[lsw4-mst-region]revision-level 10
[lsw4-mst-region]instance 1 vlan 1
[lsw4-mst-region]instance 2 vlan 2
[lsw4-mst-region]active region-configuration

配置主根和备份根
LSW3

[lsw3]stp instance 0 root primary
[lsw3]stp instance 1 root primary 
[lsw3]stp instance 2 root secondary

LSW4

[lsw4]stp instance 0 root secondary
[lsw4]stp instance 1 root secondary
[lsw4]stp instance 2 root primary

配置VRRP
LSW3

[lsw3]interface Vlanif 1
[lsw3-Vlanif1]ip address 172.16.1.1 24
[lsw3-Vlanif1]vrrp vrid 1 virtual-ip 172.16.1.254
[lsw3-Vlanif1]vrrp vrid 1 priority 105
[lsw3-Vlanif1]q
[lsw3]interface Vlanif 2
[lsw3-Vlanif2]ip address 172.16.2.1 24
[lsw3-Vlanif2]vrrp vrid 1 virtual-ip 172.16.2.254

LSW4

[lsw4]interface Vlanif 1
[lsw4-Vlanif1]ip address 172.16.1.2 24
[lsw4-Vlanif1]vrrp vrid 1 virtual-ip 172.16.1.254
[lsw4-Vlanif1]q
[lsw4]interface Vlanif 2
[lsw4-Vlanif2]ip address 172.16.2.2 24
[lsw4-Vlanif2]vrrp vrid 1 virtual-ip 172.16.2.254
[lsw4-Vlanif2]vrrp vrid 1 priority 105

配置DHCP,PC端自动获取IP地址
LSW3

[lsw3]dhcp enable 
[lsw3]ip pool v1
[lsw3-ip-pool-v1]network 172.16.1.0 mask 24
[lsw3-ip-pool-v1]gateway-list 172.16.1.254
[lsw3-ip-pool-v1]q
[lsw3]ip pool v2           
[lsw3-ip-pool-v2]network 172.16.2.0 mask 24
[lsw3-ip-pool-v2]gateway-list 172.16.2.254
[lsw3-ip-pool-v2]q
[lsw3]interface Vlanif 1
[lsw3-Vlanif1]dhcp select global 
[lsw3]interface Vlanif 2
[lsw3-Vlanif2]dhcp select global

LSW4

[lsw4]dhcp enable 
[lsw4]ip pool v1
[lsw4-ip-pool-v1]network 172.16.1.0 mask 24
[lsw4-ip-pool-v1]gateway-list 172.16.1.254
[lsw4-ip-pool-v1]q
[lsw4]ip pool v2           
[lsw4-ip-pool-v2]network 172.16.2.0 mask 24
[lsw4-ip-pool-v2]gateway-list 172.16.2.254
[lsw4-ip-pool-v2]q
[lsw4]interface Vlanif 1
[lsw4-Vlanif1]dhcp select global 
[lsw4]interface Vlanif 2
[lsw4-Vlanif2]dhcp select global

R1和R2基础配置
R1

[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 172.16.0.2 30
[r1-GigabitEthernet0/0/0]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 172.16.0.6 30
[r1-GigabitEthernet0/0/1]int g0/0/2
[r1-GigabitEthernet0/0/2]ip add 10.1.1.1 24

R2

[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 10.1.1.2 24
[r2-GigabitEthernet0/0/0]q
[r2]int l	
[r2]int LoopBack 0
[r2-LoopBack0]ip add 2.2.2.2 24
[r2-LoopBack0]

配置OSPF
LSW3

[lsw3]vlan 99
[lsw3]interface Vlanif 99
[lsw3-Vlanif99]ip address 172.16.0.1 30
[lsw3]interface g0/0/5 
[lsw3-GigabitEthernet0/0/1]port link-type access 
[lsw3-GigabitEthernet0/0/1]port default vlan 99

[lsw3]ospf 1 router-id 2.2.2.2
[lsw3-ospf-1]area 0
[lsw3-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.0.255
[lsw3-ospf-1]area 1
[lsw3-ospf-1-area-0.0.0.1]network 172.16.0.0 0.0.255.255

LSW4

[lsw4]vlan 99
[lsw4]interface Vlanif 99
[lsw4-Vlanif99]ip address 172.16.0.5 30
[lsw4]interface g0/0/5 
[lsw4-GigabitEthernet0/0/1]port link-type access 
[lsw4-GigabitEthernet0/0/1]port default vlan 99

[lsw4]ospf 1 router-id 3.3.3.3
[lsw4-ospf-1]area 0
[lsw4-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.0.255
[lsw4-ospf-1]area 1
[lsw4-ospf-1-area-0.0.0.1]network 172.16.0.0 0.0.255.255

R1

[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

沉默接口
LSW3

[lsw3-ospf-1]sil	
[lsw3-ospf-1]silent-interface all
[lsw3-ospf-1]undo silent-interface g	
[lsw3-ospf-1]undo silent-interface GigabitEthernet 0/0/5	
[lsw3-ospf-1]undo sil	
[lsw3-ospf-1]undo silent-interface e	
[lsw3-ospf-1]undo silent-interface Eth-Trunk 1
[lsw3-ospf-1]undo silent-interface vl	
[lsw3-ospf-1]undo silent-interface Vlanif 1
[lsw3-ospf-1]undo silent-interface Vlanif 99
[lsw3-ospf-1]

LSW4

[lsw4-ospf-1]sil	
[lsw4-ospf-1]silent-interface all
[lsw4-ospf-1]undo silent-interface g	
[lsw4-ospf-1]undo silent-interface GigabitEthernet 0/0/5	
[lsw4-ospf-1]undo sil	
[lsw4-ospf-1]undo silent-interface e	
[lsw4-ospf-1]undo silent-interface Eth-Trunk 1
[lsw4-ospf-1]undo silent-interface vl	
[lsw4-ospf-1]undo silent-interface Vlanif 1
[lsw4-ospf-1]undo silent-interface Vlanif 99
[lsw4-ospf-1]

缺省,NAT
R1

[r1]ip route-static 0.0.0.0 0 10.1.1.2
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]default-route-advertise
[r1-ospf-1]q
[r1]acl 2000
[r1-acl-basic-2000]rule 1 permit source any 
[r1]int g0/0/2
[r1-GigabitEthernet0/0/0]nat outbound 2000

结果展示:
在这里插入图片描述

在这里插入图片描述

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

HCIP实验100是华为认证网络专家(Huawei Certified IP Professional)培养计划的一部分,是其可供选择的实验之一。综合实验的目的是为了让学员在真实的网络环境中应用所学知识和技能,通过解决实际问题来提升他们的专业能力。 在这项实验中,学员将面临一个综合的网络实景场景,需要通过设计、规划和操作来构建和维护一个复杂的网络架构。实验内容包括网络设备的安装调试、网络拓扑的设计与优化、网络服务的配置与管理等。 在实验过程中,学员需要通过分析业务需求,理解网络架构,制定相应的方案。在网络设备安装调试阶段,学员需要进行硬件组装、设备配置操作,并进行相关测试和调整,以确保设备正常工作。在网络拓扑设计与优化阶段,学员需要考虑网络规模、性能需求、容灾能力等因素,并利用各项技术手段进行设计和优化。在网络服务配置与管理阶段,学员需要完成各种网络服务的配置,如IP地址分配、路由协议配置、安全策略配置等。 这个实验对学员的要求非常高,在实验过程中,学员需要综合应用他们所学的各种知识和技能,如网络硬件的安装与调试、网络拓扑设计与规划、网络服务配置与管理等。同时,学员需要具备良好的沟通能力、问题解决能力和团队协作能力,以便在解决问题时能与他人有效合作。 通过完成HCIP实验100综合实验,学员将对网络架构的设计和实施有更深入的理解,提升了技术能力和实践经验,为日后从事网络相关工作打下了坚实的基础。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值