当前位置: 首页 > news >正文

HCIP--5实验:综合实验

学习目标: 

学习目标

 接口配置/
VLAN间通讯VLAN,vlanIF
多生成树协议STP-->RSTP-->MSTP
VRRP虚拟路由器冗余协议--Vlanif IP,虚拟IP地址 


学习内容:

  1. 实验拓扑
  2. 实验需求
  3. 实验需求分析
  4. 实验配置内容 (每一个设备的每一步操作)
  5. 实验结果验证

目录

学习目标: 

学习内容:

1.实验拓扑

[ 2.实验需求 3.实验需求分析]

4.实验配置内容 (每一个设备的每一步操作) 

接口配置

 VLAN间通讯---(VLAN,vlanIF)

多生成树协议(STP-->RSTP-->MSTP) 

VRRP---虚拟路由器冗余协议--Vlanif IP,虚拟IP地址 

DHCP

OSPF--三层 

ip配置(静态路由,空接口)环回,缺省 

NAPT 

下 

IP,接口配置,OSPF

5.实验结果验证

学习时间:

学习产出:


1.实验拓扑

[ 2.实验需求 3.实验需求分析]

4.实验配置内容 (每一个设备的每一步操作) 

接口配置

链路聚合---静态LACP
(交换配置的第一步变为链路聚合。再做VLAN配置


1.创建Eth-Trunk接口和确定成员接口
lsw1
interface Eth-Trunk 1
mode lacp-static
trunkport GigabitEthernet 0/0/1 to 0/0/2
port trunk allow-pass vlan 2 3 20 30
lsw2
interface Eth-Trunk 1
mode lacp-static
trunkport GigabitEthernet 0/0/1 to 0/0/2
port trunk allow-pass vlan 2 3 20 30
 
trunk--lsw1
system-viewvlan batch 2 3 20 30
interface GigabitEthernet  0/0/3
port link-type trunk 
port trunk allow-pass vlan 2 3 20 30
interface GigabitEthernet  0/0/4
port link-type trunk 
port trunk allow-pass vlan 2 3 20 30
trunk--lsw2
system-viewvlan batch 2 3 20 30
interface GigabitEthernet  0/0/3
port link-type trunk 
port trunk allow-pass vlan 2 3 20 30
interface GigabitEthernet  0/0/4
port link-type trunk 
port trunk allow-pass vlan 2 3 20 30
2.修改系统优先级,确定主动端
lsw1
lacp priority 100-----设定系统优先级,默认值为32768
lsw2
lacp priority 200
————————————————————————————————————————————————————————————————————————
链路聚合---静态LACP
(交换配置的第一步变为链路聚合。再做VLAN配置
【[sw1]interface Eth-Trunk 0 ---创建聚合接口
[sw1-Eth-Trunk0]trunkport GigabitEthernet 0/0/1 to 0/0/2 ---将接口划入聚合接口中,方
法一】
3.设置活动接口上限
interface Eth-Trunk 0
[sw1-Eth-Trunk1]max active-linknumber 2
q
[sw1]display eth-trunk   ---查看Eth-Trunk接口
[sw2-Eth-Trunk1]lacp preempt enable   ---开启LACP抢占模式(数值小的开启)
(开启了LACP抢占功能。聚合组会始终保证高优先级的接口作为活动接口。)
[sw2-Eth-Trunk1]lacp preempt delay 10---抢占延迟时间,默认30
 VLAN间通讯---(VLAN,vlanIF)
1.创建vlan
2.划分接口
lsw3
system-view
vlan batch 2 3 20 30
interface GigabitEthernet  0/0/1
port link-type access
port default vlan 2 
q
interface GigabitEthernet  0/0/2
port link-type access
port default vlan 3
lw4
system-view
vlan batch 2 3 20 30
interface GigabitEthernet  0/0/1
port link-type access
port default vlan 20 
q
interface GigabitEthernet  0/0/2
port link-type access
port default vlan 30
3.Trunk干道
lsw3
interface GigabitEthernet  0/0/3
port link-type trunk 
port trunk allow-pass vlan 2 3 20 30
q
interface GigabitEthernet  0/0/4
port link-type trunk 
port trunk allow-pass vlan 2 3 20 30
lw4
interface GigabitEthernet  0/0/3
port link-type trunk 
port trunk allow-pass vlan 2 3 20 30
q
interface GigabitEthernet  0/0/4
port link-type trunk 
port trunk allow-pass vlan 2 3 20 30
多生成树协议(STP-->RSTP-->MSTP) 
配置MSPT生成树
lsw3
stp enable
stp mode mstp
[sw3]stp region-configuration ---进入MSTP域配置视图
[sw3-mst-region]region-name aa  ---修改域名,默认域名为本地MAC地址
[sw3-mst-region]revision-level 100  ---设置修订登记,默认为0,此项可以不修改
[sw-3mst-region]instance 1 vlan 2 3  ---配置实例与VLAN的映射关系
[sw3-mst-region]instance 2 vlan 20 30
[sw3-mst-region]active region-configuration   ---激活域配置,如果没有激活,则前面的配置无效
lsw4
stp enable
stp mode mstp
[sw4]stp region-configuration ---进入MSTP域配置视图
[sw4-mst-region]region-name aa  ---修改域名,默认域名为本地MAC地址
[sw4-mst-region]revision-level 100  ---设置修订登记,默认为0,此项可以不修改
[sw-4mst-region]instance 1 vlan 2 3  ---配置实例与VLAN的映射关系
[sw4-mst-region]instance 2 vlan 20 30
[sw4-mst-region]active region-configuration   ---激活域配置,如果没有激活,则前面的配置无效
lsw1
stp enable
stp mode mstp
[sw1]stp region-configuration ---进入MSTP域配置视图
[sw1-mst-region]region-name aa  ---修改域名,默认域名为本地MAC地址
[sw1-mst-region]revision-level 100  ---设置修订登记,默认为0,此项可以不修改
[sw-4mst-region]instance 1 vlan 2 3  ---配置实例与VLAN的映射关系
[sw1-mst-region]instance 2 vlan 20 30
[sw1-mst-region]active region-configuration   ---激活域配置,如果没有激活,则前面的配置无效
lsw2
stp enable
stp mode mstp
[sw1]stp region-configuration ---进入MSTP域配置视图
[sw1-mst-region]region-name aa  ---修改域名,默认域名为本地MAC地址
[sw1-mst-region]revision-level 100  ---设置修订登记,默认为0,此项可以不修改
[sw-1mst-region]instance 1 vlan 2 3  ---配置实例与VLAN的映射关系
[sw1-mst-region]instance 2 vlan 20 30
[sw1-mst-region]active region-configuration   ---激活域配置,如果没有激活,则前面的配置无效
 
修改STP参数
[sw1]stp instance 1 root primary  ---将SW1设定为实例1的主根
[sw1]stp instance 2 root secondary --2的主根副根
[sw2]stp instance 2 root primary  ---将SW1设定为实例1的主根
[sw2]stp instance 1 root secondary --2的主根副根
 
 
------------[sw1]display stp region-configuration   ---查看STP域配置
 
MSTP--根保护
[swl-GigabitEthernet0/0/3]stp root-protection---除备用设备外的接入接口
[swl-GigabitEthernet0/0/4]stp root-protection---除备用设备外的接入接口
[sw2-GigabitEthernet0/0/3]stp root-protection---除备用设备外的接入接口
[sw2-GigabitEthernet0/0/4]stp root-protection---除备用设备外的接入接口
-----------0/0/1  0/0/2  不能开------------
MSTP--边缘端口
[sw3-GigabitEthernet0/0/1]stp edged-port enable---连接PC或终端设备的接口
[sw3-GigabitEthernet0/0/2]stp edged-port enable
[sw4-GigabitEthernet0/0/1]stp edged-port enable
[sw4-GigabitEthernet0/0/2]stp edged-port enable
--->代表该接口不需要参与到STP的工作过程,即边缘端口立即切换为转发状态。
一般将连接PC或终端设备的接口设定为边缘端口。
边缘端口的关闭和激活,不会触发RSTP的拓扑变更。相当于将该接口从STP工作范围中摘出
来。
VRRP---虚拟路由器冗余协议--Vlanif IP,虚拟IP地址 
LSW1--配置虚拟IP地址,以及VRID--LSW1 LSW2接口ip,虚拟IP地址不同
---主网关---
vln ip配置
lsw1
interface Vlanif 2
ip address 10.0.2.1 255.255.255.0---Vlanif IP网关
vrrp vrid 1 virtual-ip 10.0.0.254---配置虚拟IP地址
vrrp vrid 1 priority 120 ---修改优先级,手工调整Master设备位置
vrrp vrid 1 preempt-mode timer delay 20
vrrp vrid 1 track interface GigabitEthernet 0/0/5 reduced 30---三层接口
interface Vlanif 3
ip address 10.0.3.1 255.255.255.0---Vlanif IP网关
vrrp vrid 1 virtual-ip 10.0.0.254---配置虚拟IP地址
vrrp vrid 1 priority 120 ---修改优先级,手工调整Master设备位置
vrrp vrid 1 preempt-mode timer delay 20
vrrp vrid 1 track interface GigabitEthernet 0/0/5 reduced 30---三层接口
LSW2
interface Vlanif 20
ip address 10.0.20.2 24----Vlanif IP网关--LSW1 LSW2网关不同
vrrp vrid 1 virtual-ip 10.0.20.254----配置虚拟IP地址
vrrp vrid 1 priority 120 ---修改优先级,手工调整Master设备位置
vrrp vrid 1 preempt-mode timer delay 20
vrrp vrid 1 track interface GigabitEthernet 0/0/5 reduced 30---三层接口
interface Vlanif 30
ip address 10.0.30.2 24
vrrp vrid 1 virtual-ip 10.0.30.254
vrrp vrid 1 preempt-mode timer delay 20
vrrp vrid 1 track interface GigabitEthernet 0/0/5 reduced 30---三层接口
----设定抢占延迟时间----只在主网关
lsw1
vrrp vrid 1 preempt-mode timer delay 20 --设定抢占延迟时间为20S,默认时间为0--一般只需要Master设备上配置。
lsw2
vrrp vrid 1 preempt-mode timer delay 20
----VRRP主备切换----只在主网关
lsw1
vrrp vrid 1 track interface GigabitEthernet 0/0/5 reduced 30--VRRP主备切换,降低30的优先级
lsw2
vrrp vrid 1 track interface GigabitEthernet 0/0/5 reduced 30
----备网关---
LSW1
interface Vlanif 20
ip address 10.0.20.1 24
vrrp vrid 1 virtual-ip 10.0.20.254
q
interface Vlanif 30
ip address 10.0.30.1 24
vrrp vrid 1 virtual-ip 10.0.30.254
q
LSW2
interface Vlanif 2
ip address 10.0.2.1 24
vrrp vrid 1 virtual-ip 10.0.2.254
q
interface Vlanif 3
ip address 10.0.3.1 24
vrrp vrid 1 virtual-ip 10.0.3.254
 
--------display vrrp brief查看-----------
 
DHCP
LSW1
dhcp enable
ip policy-based-route
ip pool vlan2
network 10.0.2.0 mask 24
gateway-list 10.0.2.254---虚拟网关
dns-list 8.8.8.8
LSW2
dhcp enable
ip policy-based-route
ip pool vlan2
network 10.0.2.0 mask 24
gateway-list 10.0.2.254---虚拟网关
dns-list 8.8.8.8
excluded-ip-address 10.0.2.3 10.0.2.128----排除已有ip
 
或者
LSW1
dhcp enable
ip policy-based-route
ip pool vlan2
network 10.0.2.0 mask 25
gateway-list 10.0.2.100---虚拟网关
dns-list 8.8.8.8
interface Vlanif 2
vrrp vrid 1 virtual-ip 10.0.2
 
OSPF--三层 
lsw1
vlan 11
q
interface GigabitEthernet 0/0/5
port link-type access
port default vlan 11
q
interface Vlanif 11
ip address 10.0.11.1 30
q
lsw2
vlan 12
q
interface GigabitEthernet 0/0/5
port link-type access
port default vlan 12
q
interface Vlanif 12
ip address 10.0.12.1 30
q
AR1
Iinterface GigabitEthernet 0/0/1
ip address 10.0.11.2 30
q
int g 0/0/2
ip address 10.0.12.2 30
q
lsw1
|ospf 1
area 0
network 10.0.2.1 0.0.0.0
network 10.0.3.1 0.0.0.0
network 10.0.11.1 0.0.0.0
network 10.0.20.1 0.0.0.0
network 10.0.30.1 0.0.0.0
lsw1
|ospf 1
area 0
network 10.0.2.2 0.0.0.0
network 10.0.3.2 0.0.0.0
network 10.0.11.2 0.0.0.0
network 10.0.20.2 0.0.0.0
network 10.0.30.2 0.0.0.0
AR1
|ospf 1
area 0
network 10.0.11.2 0.0.0.0
network 10.0.12.2 0.0.0.0
network 10.0.11.1 0.0.0.0
 
-----------display ospf peer brief
ip配置(静态路由,空接口)环回,缺省 
ip配置,静态路由
r1
interface GigabitEthernet 0/0/0
ip address 202.1.1.1 30
q
interface GigabitEthernet 0/0/1
ip address 10.0.0.1 30
q
interface GigabitEthernet 0/0/2
ip address 10.0.0.4 30
q
[ip route-static 100.100.100.100 24 202.1.1.2 (preference 60默认)
isp
interface GigabitEthernet 0/0/0
ip address 202.1.1.2 30
q]
 
环回isp
interface LoopBack 0
ip address 100.100.100.100 32
q
缺省--AR1
ip route-static 0.0.0.0 0 202.1.1.2
NAPT 
AR1--NAPT
IP配置
interface GigabitEthernet 0/0/0
ip address 202.1.1.1 30
q
NAPT--ACL
acl 2000
rule permit source 10.0.0.0 0.0.255.255 
interface GigabitEthernet 0/0/0--AR1的出接口
nat outbound 2000

下 

IP,接口配置,OSPF
R21
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
user-interface console 0
idle-timeout 0 0
quit
int g0/0/0
int g0/0/1
ip address 192.168.200.2 30
int g0/0/2
ip address 10.10.10.38 30
int l0
ip address 9.9.9.9 32
q

R22
<Huawei>sys
Enter system view, return user view with Ctrl+Z.

user-interface console 0
idle-timeout 0 0
quit
int g0/0/1.1
ip address 192.168.3.254 24
int g0/0/1.2
ip address 192.168.4.254 24
q
int g0/0/0
ip ad	
ip address 192.168.200.1 30
q

————-------------OSPF————————————————
[R21]ospf 200 router-id 9.9.9.9
[R21-ospf-200]area 0
[R21-ospf-200-area-0.0.0.0]network 192.168.200.2 0.0.0.0
[R21-ospf-200-area-0.0.0.0]q
[R21-ospf-200]q
[R21]
[R22]ospf 200 router-id 10.10.10.10
[R22-ospf-200]area 0
[R22-ospf-200-area-0.0.0.0]network 192.168.200.1 0.0.0.0
[R22-ospf-200-area-0.0.0.0]network 192.168.3.254 0.0.0.0
[R22-ospf-200-area-0.0.0.0]network 192.168.4.254 0.0.0.0
[R22-ospf-200-area-0.0.0.0]q
[R22-ospf-200]q
----------vlan-------------------------
SW8
sys SW8
[SW8]vlan b	
[SW8]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW8]int g0/0/1
[SW8-GigabitEthernet0/0/1]port link-type trunk 
[SW8-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20
[SW8-GigabitEthernet0/0/1]int g0/0/2
[SW8-GigabitEthernet0/0/2]port link-type access 
[SW8-GigabitEthernet0/0/2]port default vlan 10
[SW8-GigabitEthernet0/0/2]int g0/0/3
[SW8-GigabitEthernet0/0/3]port link-type access 
[SW8-GigabitEthernet0/0/3]port default vlan 20
[SW8-GigabitEthernet0/0/3]q
[SW8]

5.实验结果验证


学习时间:

学习时间为学习时间


学习产出:

画工

HCIP--4实验:OSPF综合实验-CSDN博客           

HCIP--3实验- 链路聚合,VLAN间通讯,Super VLAN,MSTP,VRRP,ip配置,OSPF(静态路由,环回,缺省,空接口),NAPT-CSDN博客

HCIP--1实验.配置ip,静态路由,浮动静态 VLAN,trunk干道,vlan间路由DHCP,OSPF/RIP,缺省NAT,ACL,Telnet,DNS,HTTP,端口映射-CSDN博客

  • 技术笔记 1遍
  • 有错误请指出,作者会及时改正

相关文章:

  • Unity中给Animator扩展一个异步等待播放指定clip的方法
  • QFlightInstruments飞行仪表控件库
  • 快速幂算法
  • 【Qt】文件与音视频
  • 【C++】map
  • 华为开源自研AI框架昇思MindSpore应用案例:基于MindSpore框架实现PWCNet光流估计
  • 梓航建站CMS独立版最新v1.9.4全插件PC+H5
  • 表格结构数据
  • 3.29:数据结构-绪论线性表-上
  • 类与对象(下)
  • 智能指针/内存泄露/类型转换
  • BeanDefinition和Beanfactory实现一个简单的bean容器
  • Prompt Flow 与 DSPy:大型语言模型开发的未来
  • 【论文阅读】LongDiff:Training-Free Long Video Generation in One Go
  • 全流程AI论文辅助系统开发实战:从构思到文献增值的智能进化
  • 测试开发-定制化测试数据生成(Python+jmeter+Faker)
  • 动态规划(DP)
  • 聚类(Clustering)基础知识2
  • Web开发-JS应用WebPack构建打包Mode映射DevTool源码泄漏识别还原
  • Linux内核perf性能分析工具案例分析