华为交换机MSTP+VRRP配置实例说明文档
华为交换机MSTP+VRRP配置实例说明文档
拓扑图
IP地址规划表
设备名称 |
设备接口 |
对端设备 |
对端接口 |
VLAN |
VLAN /接口地址 |
备注 |
SW0 |
GE0/0/23 |
SW2 |
GE0/0/23 |
VLAN200 |
10.0.1.1/24 |
|
GE0/0/24 |
SW1 |
GE0/0/24 |
VLAN100 |
10.0.0.1/24 |
||
SW1 |
GE0/0/24 |
SW0 |
GE0/0/24 |
VLAN100 |
10.0.0.2/24 |
|
GE0/0/11 GE0/0/12 |
SW1 |
GE0/0/11 GE0/0/12 |
VLAN 10:192.168.0.253/24 VLAN 20:192.168.1.253/24 Vir - ip: 192.168.0.254/24 Vir - ip: 192.168.1.254/24 |
链路聚合 Eth-trunk1 |
||
GE0/0/13 |
SW4 |
Eth0/0/13 |
||||
GE0/0/1 |
SW3 |
GE0/0/1 |
||||
SW2 |
GE0/0/23 |
SW0 |
GE0/0/23 |
VLAN200 |
10.0.1.2/24 |
|
GE0/0/11 GE0/0/12 |
SW1 |
GE0/0/11 GE0/0/12 |
VLAN 10:192.168.0.253/24 VLAN 20:192.168.1.253/24 Vir - ip: 192.168.0.254/24 Vir - ip: 192.168.1.254/24 |
链路聚合 Eth-trunk1 |
||
GE0/0/14 |
SW3 |
Eth0/0/14 |
||||
GE0/0/1 |
SW4 |
GE0/0/1 |
||||
SW3 |
GE0/0/1 |
SW1 |
GE0/0/1 |
|||
Eth0/0/14 |
SW3 |
GE0/0/14 |
||||
Eth0/0/1 |
CLENT1 |
Eth0/0/1 |
||||
SW4 |
GE0/0/1 |
SW2 |
GE0/0/1 |
|||
Eth0/0/13 |
SW1 |
GE0/0/13 |
||||
Eth0/0/1 |
CLENT2 |
Eth0/0/1 |
||||
CLENT1 |
Eth0/0/1 |
SW3 |
Eth0/0/1 |
192.168.0.1/24 |
||
CLENT2 |
Eth0/0/1 |
SW4 |
Eth0/0/1 |
192.168.1.1/24 |
MSTP简介
MSTP(多生成树协议)是在STP的基础上发展而来的,用于在局域网中消除数据链路层的物理环路,作为一种二层协议,MSTP通过选择性的阻塞网络中的冗余链路来消除二层环路,将环路网络结构修剪无环路的树型网络结构,从而防止在环路网络中不断增生和无限循环,避免设备由于重复接收相同报文造成报文处理能力的下降;同时,它还具备链路备份的能力。与STP相比,MSTP可以实现网络拓扑的快速收敛,也能使不同VLAN的流量沿各自的路径转发,从而为冗余链路提供了更好的负载分担机制。
VRRP简介
VRRP用来为网关设备提供冗余备份。VRRP将可以承担网关功能的一组设备加入到备份组中,形成一台虚拟路由器,局域网内的主机将此虚拟路由器设置为缺省网关。VRRP根据优先级从备份组中选举一台网关设备作为Master,负责转发局域网内主机与外部通信的流量,其他网关设备作为Backup。当Master出现故障后,VRRP重新选举新的Master,保证流量转发不会中断。
配置脚本说明
[SW0]
<Huawei>sys
//进入特权模式
[Huawei]sysname SW0
//修改主机名
[SW0]vlan batch 100 200
//声明VLAN 100 200
[SW0]interface Vlanif100
//进入VLAN100的Svi接口模式
[SW0-Vlanif100]ip address 10.0.0.1 255.255.255.0
//配置VLAN100的Svi地址
[SW0-Vlanif100]qu
//退出Svi配置模式
[SW0]interface Vlanif200
//进入VLAN200的Svi接口模式
[SW0-Vlanif200]ip address 10.0.1.1 255.255.255.0
//配置VLAN100的Svi地址
[SW0-Vlanif200]qu
//退出VLAN200的接口配置模式
[SW0]interface GigabitEthernet 0/0/23
//进入到GE0/0/23的接口配置模式
[SW0-GigabitEthernet 0/0/23]port link-type access
//配置GE0/0/23的接口类型为access
[SW0-GigabitEthernet 0/0/23]port default vlan 200
//把GE0/0/23划分到VLAN200
[SW0-GigabitEthernet 0/0/23]qu
//退出GE0/0/23的接口模式
[SW0]interface GigabitEthernet0/0/24
//进入到GE0/0/24的接口配置模式
[SW0-GigabitEthernet 0/0/24]port link-type access
//配置GE0/0/24的接口类型为access
[SW0-GigabitEthernet 0/0/24]port default vlan 100
//把GE0/0/23划分到VLAN100
[SW0-GigabitEthernet 0/0/23]qu
//退出GE0/0/23的接口模式
[SW0]rip 1
//进入到RIP路由协议配置模式
[SW0-rip-1]network 10.0.0.0
//声明直连网段
[SW0-rip-1]qu
//退出RIP路由协议的配置模式
[SW0]qu
//退出特权模式
<SW0>sa
//保存配置
[SW1]
<Huawei>sys
//进入特权模式
[Huawei]sysname SW1
//修改主机名
[SW1]vlan batch 10 20 100
//声明VLAN 10 20 100
[SW1]interface Vlanif10
//进入VLAN10的Svi接口模式
[SW1-Vlanif10]ip address 192.168.0.253 255.255.255.0
//配置VLAN10的Svi地址
[SW1-Vlanif10]qu
//退出Svi配置模式
[SW1]interface Vlanif20
//进入VLAN20的Svi接口模式
[SW1-Vlanif20]ip address 192.168.1.253 255.255.255.0
//配置VLAN20的Svi地址
[SW1-Vlanif20]qu
//退出Svi配置模式
[SW1]interface Vlanif100
//进入VLAN100的Svi接口模式
[SW1-Vlanif100]ip address 10.0.0.2 255.255.255.0
//配置VLAN100的Svi地址
[SW1-Vlanif100]qu
//退出Svi配置模式
[SW1]interface Eth-Trunk1
//进入到链路聚合配置模式
[SW1-Eth-Trunk1]port link-type trunk
//配置聚合链路的链路类型为trunk
[SW1-Eth-Trunk1]port trunk allow-pass vlan 2 to 4094
//允许所有VLAN通过链路
[SW1-Eth-Trunk1]qu
//退出链路聚合配置模式
[SW1]interface GigabitEthernet0/0/1
//进入到GE0/0/1的接口配置模式
[SW1-GigabitEthernet 0/0/1]port link-type trunk
//配置GE0/0/1的链路类型为trunk
[SW1-GigabitEthernet 0/0/1]port trunk allow-pass vlan 2 to 4094
//允许所有VLAN通过链路
[SW1-GigabitEthernet 0/0/1]qu
//退出GE0/0/1的接口配置模式
[SW1]interface GigabitEthernet0/0/11
//进入到GE0/0/11的接口配置模式
[SW1-GigabitEthernet 0/0/11] eth-trunk 1
//将GE0/0/11加入到聚合链路中
[SW1-GigabitEthernet 0/0/11]qu
//退出链路接口配置模式
[SW1]interface GigabitEthernet0/0/12
//进入到GE0/0/12的接口配置模式
[SW1-GigabitEthernet 0/0/12]eth-trunk 1
//将GE0/0/12加入到聚合链路中
[SW1-GigabitEthernet 0/0/12]qu
//退出GE0/0/12的接口配置模式
[SW1]interface GigabitEthernet0/0/13
//进入到GE0/0/13的接口配置模式
[SW1-GigabitEthernet 0/0/13]port link-type trunk
//配置GE0/0/13的链路类型为trunk
[SW1-GigabitEthernet 0/0/13]port trunk allow-pass vlan 2 to 4094
//允许所有VLAN通过链路
[SW1-GigabitEthernet 0/0/13]qu
//退出GE0/0/13的接口配置模式
[SW1]interface GigabitEthernet0/0/24
//进入到GE0/0/24的接口配置模式
[SW1-GigabitEthernet 0/0/24]port link-type access
//配置GE0/0/24的链路类型为access
[SW1-GigabitEthernet 0/0/24]port default vlan 100
//将GE0/0/24划分到VLAN100
[SW1-GigabitEthernet 0/0/24]qu
//退出GE0/0/24的接口配置模式
【MSTP配置】
[SW1]stp region-configuration
//进入到stp配置模式
[SW1-mst-region] region-name vrrp
//配置MSTP名称
[SW1-mst-region]instance 1 vlan 10
//将VLAN10映射到实例1
[SW1-mst-region]instance 2 vlan 20
//将VLAN20映射到实例2
[SW1-mst-region]active region-configuration
//激活区域配置
[SW1-mst-region]qu
//退出MSTP配置模式
[SW1]stp instance 1 root primary
//设置实例1为主根
[SW1]stp instance 2 root secondary
//设置实例2为从根
【VRRP配置】
[SW1]interface Vlanif10
//进入到VLAN10的Svi接口模式下
[SW1-Vlanif10]vrrp vrid 1 virtual-ip 192.168.0.254
//声明虚拟备份组1并配置虚拟网关ip
[SW1-Vlanif10]vrrp vrid 1 priority 120
//配置虚拟备份组1的优先级为120
[SW1-Vlanif10]qu
//退出Svi接口配置模式
[SW1]interface Vlanif20
//进入到VLAN20的Svi接口模式下
[SW1-Vlanif20]vrrp vrid 2 virtual-ip 192.168.1.254
//声明虚拟备份组2并配置虚拟网关ip
[SW1-Vlanif20]qu
//退出Svi接口配置模式
[SW1]rip 1
//进入到RIP路由协议配置模式
[SW1-rip-1]network 10.0.0.0
//声明直连网段
[SW1-rip-1]network 192.168.0.0
//声明直连网段
[SW1-rip-1]network 192.168.1.0
//声明直连网段
[SW1-rip-1]qu
//退出RIP路由协议的配置模式
[SW1]qu
//退出特权模式
<SW1>sa
//保存配置
[SW2]
<Huawei>sys
//进入特权模式
[Huawei]sysname SW2
//修改主机名
[SW2]vlan batch 10 20 200
//声明VLAN 10 20 200
[SW2]interface Vlanif10
//进入VLAN10的Svi接口模式
[SW2-Vlanif10]ip address 192.168.0.253 255.255.255.0
//配置VLAN10的Svi地址
[SW2-Vlanif20]qu
//退出Svi配置模式
[SW2]interface Vlanif20
//进入VLAN20的Svi接口模式
[SW2-Vlanif20]ip address 192.168.1.253 255.255.255.0
//配置VLAN20的Svi地址
[SW2-Vlanif20]qu
//退出Svi配置模式
[SW2]interface Vlanif200
//进入VLAN200的Svi接口模式
[SW2-Vlanif200]ip address 10.0.1.2 255.255.255.0
//配置VLAN200的Svi地址
[SW2-Vlanif200]qu
//退出Svi配置模式
[SW2]interface Eth-Trunk1
//进入到链路聚合配置模式
[SW2-Eth-Trunk1]port link-type trunk
//配置聚合链路的链路类型为trunk
[SW2-Eth-Trunk1]port trunk allow-pass vlan 2 to 4094
//允许所有VLAN通过链路
[SW2-Eth-Trunk1]qu
//退出链路聚合配置模式
[SW2]interface GigabitEthernet0/0/1
//进入到GE0/0/1的接口配置模式
[SW2-GigabitEthernet 0/0/1]port link-type trunk
//配置GE0/0/1的链路类型为trunk
[SW2-GigabitEthernet 0/0/1]port trunk allow-pass vlan 2 to 4094
//允许所有VLAN通过链路
[SW2-GigabitEthernet 0/0/1]qu
//退出GE0/0/1的接口配置模式
[SW2]interface GigabitEthernet0/0/11
//进入到GE0/0/11的接口配置模式
[SW2-GigabitEthernet 0/0/11] eth-trunk 1
//将GE0/0/11加入到聚合链路中
[SW1-GigabitEthernet 0/0/11]qu
//退出链路接口配置模式
[SW2]interface GigabitEthernet0/0/12
//进入到GE0/0/12的接口配置模式
[SW2-GigabitEthernet 0/0/12]eth-trunk 1
//将GE0/0/12加入到聚合链路中
[SW2-GigabitEthernet 0/0/12]qu
//退出GE0/0/12的接口配置模式
[SW2]interface GigabitEthernet0/0/14
//进入到GE0/0/14的接口配置模式
[SW2-GigabitEthernet 0/0/14]port link-type trunk
//配置GE0/0/14的链路类型为trunk
[SW2-GigabitEthernet 0/0/14]port trunk allow-pass vlan 2 to 4094
//允许所有VLAN通过链路
[SW2-GigabitEthernet 0/0/14]qu
//退出GE0/0/14的接口配置模式
[SW2]interface GigabitEthernet0/0/23
//进入到GE0/0/23的接口配置模式
[SW2-GigabitEthernet 0/0/23]port link-type access
//配置GE0/0/23的链路类型为access
[SW2-GigabitEthernet 0/0/23]port default vlan 200
//将GE0/0/23划分到VLAN200
[SW2-GigabitEthernet 0/0/23]qu
//退出GE0/0/23的接口配置模式
【MSTP配置】
[SW2]stp region-configuration
//进入到stp配置模式
[SW2-mst-region] region-name vrrp
//配置MSTP名称
[SW2-mst-region]instance 1 vlan 10
//将VLAN10映射到实例1
[SW2-mst-region]instance 2 vlan 20
//将VLAN20映射到实例2
[SW2-mst-region]active region-configuration
//激活区域配置
[SW2-mst-region]qu
//退出MSTP配置模式
[SW2]stp instance 1 root secondary
//设置实例1为从根
[SW2]stp instance 2 root primary
//设置实例2为主根
【VRRP配置】
[SW2]interface Vlanif10
//进入到VLAN10的Svi接口模式下
[SW2-Vlanif10]vrrp vrid 1 virtual-ip 192.168.0.254
//声明虚拟备份组1并配置虚拟网关ip
[SW2-Vlanif10]qu
//退出Svi接口配置模式
[SW2]interface Vlanif20
//进入到VLAN20的Svi接口模式下
[SW2-Vlanif20]vrrp vrid 2 virtual-ip 192.168.1.254
//声明虚拟备份组2并配置虚拟网关ip
[SW2-Vlanif20]vrrp vrid 2 priority 120
//配置虚拟备份组2的优先级为120
[SW2-Vlanif20]qu
//退出Svi接口配置模式
[SW2]rip 1
//进入到RIP路由协议配置模式
[SW2-rip-1]network 10.0.0.0
//声明直连网段
[SW2-rip-1]network 192.168.1.0
//声明直连网段
[SW2-rip-1]network 192.168.0.0
//声明直连网段
[SW2-rip-1]qu
//退出RIP路由协议的配置模式
[SW2]qu
//退出特权模式
<SW2>sa
//保存配置
[SW3]
<Huawei>sys
//进入特权模式
[Huawei]sysname SW3
//修改主机名
[SW3]vlan batch 10 20
//声明VLAN 10 20
[SW3]interface Ethernet0/0/1
//进入到Eth0/0/1的接口模式
[SW3-Ethernet0/0/1]port link-type access
//配置Eth0/0/1的链路类型为access
[SW3-Ethernet0/0/1]port default vlan 10
//将Eth0/0/1划分到VLAN10
[SW3-Ethernet0/0/1]qu
//退出Eth0/0/1接口模式
[SW3]interface Ethernet0/0/14
//进入到Eth0/0/14的接口模式
[SW3-Ethernet0/0/14]port link-type trunk
//将Eth0/0/14的链路类型配置为trunk
[SW3-Ethernet0/0/14]port trunk allow-pass vlan 2 to 4094
//允许所有VLAN通过
[SW3-Ethernet0/0/14]qu
//退出Eth0/0/14的接口模式
[SW3]iinterface GigabitEthernet0/0/1
//进入到GE0/0/1的接口配置模式
[SW3-GigabitEthernet 0/0/1]port link-type trunk
//配置GE0/0/1的接口模式为trunk
[SW3-GigabitEthernet 0/0/1]port trunk allow-pass vlan 2 to 4094
//允许所有VLAN通过
[SW3-GigabitEthernet 0/0/1]qu
//退出GE0/0/1的接口配置模式
【MSTP】
[SW3]stp region-configuration
//进入到STP配置模式
[SW3]stp region-configuration
//进入到stp配置模式
[SW3-mst-region] region-name vrrp
//配置MSTP名称
[SW3-mst-region]instance 1 vlan 10
//将VLAN10映射到实例1
[SW3-mst-region]instance 2 vlan 20
//将VLAN20映射到实例2
[SW3-mst-region]active region-configuration
//激活区域配置
[SW3-mst-region]qu
//退出MSTP配置模式
[SW3]qu
//退出特权模式
<SW3>sa
//保存配置
[SW4]
<Huawei>sys
//进入特权模式
[Huawei]sysname SW4
//修改主机名
[SW4]vlan batch 10 20
//声明VLAN 10 20
[SW4]interface Ethernet0/0/1
//进入到Eth0/0/1的接口模式
[SW4-Ethernet0/0/1]port link-type access
//配置Eth0/0/1的链路类型为access
[SW4-Ethernet0/0/1]port default vlan 10
//将Eth0/0/1划分到VLAN10
[SW4-Ethernet0/0/1]qu
//退出Eth0/0/1接口模式
[SW4]interface Ethernet0/0/13
//进入到Eth0/0/13的接口模式
[SW4-Ethernet0/0/13]port link-type trunk
//将Eth0/0/13的链路类型配置为trunk
[SW4-Ethernet0/0/13]port trunk allow-pass vlan 2 to 4094
//允许所有VLAN通过
[SW4-Ethernet0/0/13]qu
//退出Eth0/0/13的接口模式
[SW4]iinterface GigabitEthernet0/0/1
//进入到GE0/0/1的接口配置模式
[SW4-GigabitEthernet 0/0/1]port link-type trunk
//配置GE0/0/1的接口模式为trunk
[SW4-GigabitEthernet 0/0/1]port trunk allow-pass vlan 2 to 4094
//允许所有VLAN通过
[SW4-GigabitEthernet 0/0/1]qu
//退出GE0/0/1的接口配置模式
【MSTP】
[SW4]stp region-configuration
//进入到STP配置模式
[SW4]stp region-configuration
//进入到stp配置模式
[SW4-mst-region] region-name vrrp
//配置MSTP名称
[SW4-mst-region]instance 1 vlan 10
//将VLAN10映射到实例1
[SW4-mst-region]instance 2 vlan 20
//将VLAN20映射到实例2
[SW4-mst-region]active region-configuration
//激活区域配置
[SW4-mst-region]qu
//退出MSTP配置模式
[SW4]qu
//退出特权模式
<SW4>sa
//保存配置
总结
MSTP+VRRP配置步骤
1、配置交换机路由器的基本配置,例如接口信息、主机名等
2、配置交换机互连链路为trunk
3、配置主VRRP ID、虚拟IP、优先级,然后设置备VRRP的虚拟IP、优先级(此处的优先级一定要比主设备的低)
4、配置MSTP,进入MSTP配置接口、配置name、实例映射、激活,退出后设置主备
5、配置完成
华为交换机MSTP+VRRP配置实例说明文档的更多相关文章
- Highcharts选项配置详细说明文档(zz)
http://www.helloweba.com/view-blog-156.html Highcharts提供大量的选项配置参数,您可以轻松定制符合用户要求的图表,目前官网只提供英文版的开发配置说明 ...
- Highcharts选项配置详细说明文档
Highcharts提供大量的选项配置参数,您可以轻松定制符合用户要求的图表,目前官网只提供英文版的开发配置说明文档,而中文版的文档网上甚少,且零散不全.这里,我把Highcharts常用的最核心的参 ...
- 华为交换机VRRP配置实例收集(转)
示例图: 其实说白了就是做线路冗余,达到热备切换. 组网需求: 楼层1和楼层2分别通过两条线路做冗余接入交换机(本示例只考虑vrrp,暂不考虑其他方面).当其中一段链路故障时,能通过另外一条链路传输. ...
- 华为交换机VRP用户界面配置及Telnet登录实验
user privilege level level 设置使用以上用户界面登录后的用户级别 5 acl acl-number { inbound | outbound } (可选)在用户界面上应用AC ...
- 华为交换机GVRP基础配置
GVRP基础配置 int G0/0/1 port link-type trunk 配置接口类型为trunk port trunk allow-pass vlan all 允许所有VLAN通过 int ...
- ASP.NET Aries DataGrid 配置表头说明文档
DataGrid 配置表头 字段 中文 说明 Field 字段 注意:mg_ 开头的字段为层级表头 Title 列称 OrderNum 序号 显示的顺序(冻结和非冻结列是两个组的序号) Width 列 ...
- 华为交换机S5700系列配置镜像端口(M:N)
配置本地端口镜像组网图(M:N) 组网需求 如图所示,某公司研发一部.研发二部和市场部通过Switch与外部Internet通信,监控设备Server1.Server2与Switch直连. 现在希望将 ...
- 华为交换机S5700系列配置镜像端口(1:1)
配置本地镜像口(1:1) 组网需求 如图一所示,某公司行政部通过Switch与外部Internet通信,监控设备Server与Switch直连. 现在希望通过Server对行政部访问Internet的 ...
- 华为交换机S5700系列配置通过STelnet登录设备示例
配置通过STelnet登录设备示例 组网图形 图1 配置用户通过STelnet登录设备组网图 在服务器端生成本地密钥对 <HUAWEI> system-view [HUAWEI] sysn ...
随机推荐
- 利用PHP扩展Taint找出网站的潜在安全漏洞实践
一.背景 笔者从接触计算机后就对网络安全一直比较感兴趣,在做PHP开发后对web安全一直比较关注,2016时无意中发现Taint这个扩展,体验之后发现确实好用:不过当时在查询相关资料时候发现关注此扩展 ...
- nginx: [emerg] getpwnam("nginx") failed
搭建LNMP环境的时候,在安装完Nginx后启动测试Nginx服务时发现报如下错误: nginx: [emerg] getpwnam("nginx") failed 这是由于没有创 ...
- HTTP 协议基础概念和报文结构
基础概念 1.WWW(World Wide Web,万维网)构建技术有3项: (1)把SGML(Standard Generalized Markup Language,标准通用标记语言)作为页面的文 ...
- java后端导入excel模板和导入excel文件去读数据
模板转载地址:https://www.cnblogs.com/zhangyangtao/p/9802948.html 直接上代码(我是基于ssm写的demo,导入文件目前只能读取.xls后缀的exce ...
- spring boot -thymeleaf-遍历list和map
遍历 list如下 th:each th:each 状态变量 var 遍历map如下(需要双层遍历) controller代码如下
- 课程四(Convolutional Neural Networks),第三 周(Object detection) —— 0.Learning Goals
Learning Goals: Understand the challenges of Object Localization, Object Detection and Landmark Find ...
- servlet 请求乱码解决
- Android应用系列:值得收藏的ViewHolder工具类实现
前言 在开发APP的过程中,攻城狮少不了要跟ListView.GridView这些组件眉来眼去,暗送几波秋波.自然原生态美人BaseAdapter更是程序员的最爱,有了它,我们想怎么干就能怎么干,嘿嘿 ...
- Spring Session - 使用Redis存储HttpSession例子
目的 使用Redis存储管理HttpSession: 添加pom.xml 该工程基于Spring Boot,同时我们将使用Spring IO Platform来维护依赖版本号: 引入的依赖有sprin ...
- 从零开始学 Web 之 jQuery(四)元素的创建添加与删除,自定义属性
大家好,这里是「 从零开始学 Web 系列教程 」,并在下列地址同步更新...... github:https://github.com/Daotin/Web 微信公众号:Web前端之巅 博客园:ht ...