网工必备技术-华为交换技术实战讲解
Posted Friends of the wind
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了网工必备技术-华为交换技术实战讲解相关的知识,希望对你有一定的参考价值。
学习目标:
通过案例,了解Hybrid接口应用场景及如何配置;MSTP实现负载均衡
基础内容:
1、Hybrid接口特点
华为交换机接口默认为Hybrid模式
既可以实现Access接口的功能,也可以实现Trunk接口的功能
不借助三层设备即可实现跨VLAN通信和访问控制
Hybrid接口相对于Access接口和Trunk接口具有更高的灵活性与可控性
2、 作用
流量隔离、 流量互通
Hybrid接口应用
1、s1配置
创建vlan并配置接口pvid为1(默认为1,可省略这步)
[s1]vlan batch 2 3 10
[s1]int g0/0/1
[s1-GigabitEthernet0/0/1]port hybrid pvid vlan 1
vlan加入untag列表
[s1-GigabitEthernet0/0/1]port hybrid untagged vlan 1 to 2
[s1-GigabitEthernet0/0/1]int g0/0/2
[s1-GigabitEthernet0/0/2]port hybrid pvid vlan 1
[s1-GigabitEthernet0/0/2]port hybrid untagged vlan 1 to 2
[s1-GigabitEthernet0/0/2]int g0/0/3
[s1-GigabitEthernet0/0/3]port hybrid pvid vlan 10
[s1-GigabitEthernet0/0/3]port hybrid untagged vlan 3 10
[s1-GigabitEthernet0/0/3]int g0/0/4
[s1-GigabitEthernet0/0/4]port hybrid pvid vlan 1
[s1-GigabitEthernet0/0/4]port hybrid untag vlan 1 to 2
[s1-GigabitEthernet0/0/4]port hybrid tag vlan 3 10
[s1-GigabitEthernet0/0/4]
[s2]vlan batch 2 3 10
[s2]int g0/0/1
[s2-GigabitEthernet0/0/1]port hybrid pvid vlan 1
[s2-GigabitEthernet0/0/1]port hybrid untag vlan 1 2
[s2-GigabitEthernet0/0/1]port hybrid tag vlan 3 10
[s2-GigabitEthernet0/0/1]int g0/0/2
[s2-GigabitEthernet0/0/2]port hybrid pvid vlan 2
[s2-GigabitEthernet0/0/2]port hybrid untag vlan 1 2
[s2-GigabitEthernet0/0/2]int g0/0/3
[s2-GigabitEthernet0/0/3]port hybrid pvid vlan 3
[s2-GigabitEthernet0/0/3]port hybrid untag vlan 3 10
2、验证:
正向验证:生产部销售部(10.1.1.12)可以互相访问,并且可以访问服务器1(10.1.1.100)
销售部(10.1.1.12)可以访问服务器1(10.1.1.100)
反向验证:财务部(10.1.1.13)只能访问服务器2(10.1.1.200),不能访问其他设备
MSTP配置
推荐步骤
1、R1配置
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 10.1.10.254 24
[r1-GigabitEthernet0/0/0]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 10.1.20.254 24
2、配置vlan和trunk
S1的配置
[sw1]vlan batch 10 20
[sw1]int g0/0/2
[sw1-GigabitEthernet0/0/2]port link-type trunk
[sw1-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[sw1-GigabitEthernet0/0/2]int g0/0/1
[sw1-GigabitEthernet0/0/1]port link-type trunk
[sw1-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[sw1-GigabitEthernet0/0/1]int g0/0/3
[sw1-GigabitEthernet0/0/3]port link-type hybrid
[sw1-GigabitEthernet0/0/3]port hybrid untagged vlan 10
[sw1-GigabitEthernet0/0/3]port hybrid pvid vlan 10
S2的配置
[sw2]vlan batch 10 20
[sw2]int g0/0/2
[sw2-GigabitEthernet0/0/2]port link-type trunk
[sw2-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[sw2-GigabitEthernet0/0/2]int g0/0/1
[sw2-GigabitEthernet0/0/1]port link-type trunk
[sw2-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[sw2-GigabitEthernet0/0/1]int g0/0/3
[sw2-GigabitEthernet0/0/3]port link-type hybrid
[sw2-GigabitEthernet0/0/3]port hybrid untagged vlan 20
[sw2-GigabitEthernet0/0/3]port hybrid pvid vlan 20
S3的配置
[Huawei]vlan batch 10 20
[Huawei]int e0/0/3
[Huawei-Ethernet0/0/3]port link-type access
[Huawei-Ethernet0/0/3]port default vlan 10
[Huawei-Ethernet0/0/3]int e0/0/4
[Huawei-Ethernet0/0/4]port link-type access
[Huawei-Ethernet0/0/4]port default vlan 20
[Huawei-Ethernet0/0/4]int e0/0/1
[Huawei-Ethernet0/0/1]port link-type trunk
[Huawei-Ethernet0/0/1]port trunk allow-pass vlan all
[Huawei-Ethernet0/0/1]int e0/0/2
[Huawei-Ethernet0/0/2]port link-type trunk
[Huawei-Ethernet0/0/2]port trunk allow-pass vlan all
3.配置mstp
S1的配置
[sw1-GigabitEthernet0/0/3]quit
[sw1]stp mode mstp
[sw1]stp region-configuration
[sw1-mst-region]region-name huawei
[sw1-mst-region]revision-level 1
[sw1-mst-region]instance 1 vlan 10
[sw1-mst-region]instance 2 vlan 20
[sw1-mst-region]active region-configuration
[sw1-mst-region]quit
[sw1]stp instance 1 root primary
[sw1]stp instance 2 root sec
S2的配置
[sw2-GigabitEthernet0/0/3]quit
[sw2]stp mode mstp
[sw2]stp region-con
[sw2-mst-region]region-name huawei
[sw2-mst-region]revision-level 1
[sw2-mst-region]instance 1 vlan 10
[sw2-mst-region]instance 2 vlan 20
[sw2-mst-region]active region-configuration
[sw2-mst-region]quit
[sw2]stp instance 1 root sec
[sw2]stp instance 2 root pri
S3的配置
[Huawei-Ethernet0/0/2]quit
[Huawei]stp mode mstp
[Huawei]stp region-configuration
[Huawei-mst-region]region-name huawei
[Huawei-mst-region]revision-level 1
[Huawei-mst-region]instance 1 vlan 10
[Huawei-mst-region]instance 2 vlan 20
[Huawei-mst-region]active region-configuration
4、验证:
s3上用命令查看stp接口及状态,发现e0/0/2和e0/0/1为阻塞状态,两个实例互相独立。不受影响。
删除一条线路,依然可以ping通,表示成功
以上是关于网工必备技术-华为交换技术实战讲解的主要内容,如果未能解决你的问题,请参考以下文章