华为交换机vrrp配置实例,华为交换机vrrp配置步骤

首页 > 数码 > 作者:YD1662022-11-01 11:54:15

  • 拓扑图
  • 华为交换机vrrp配置实例,华为交换机vrrp配置步骤(1)

    华为交换机vrrp配置实例,华为交换机vrrp配置步骤(2)

    华为交换机vrrp配置实例,华为交换机vrrp配置步骤(3)

    华为交换机vrrp配置实例,华为交换机vrrp配置步骤(4)

    MSTP(多生成树协议)是在STP的基础上发展而来的,用于在局域网中消除数据链路层的物理环路,作为一种二层协议,MSTP通过选择性的阻塞网络中的冗余链路来消除二层环路,将环路网络结构修剪无环路的树型网络结构,从而防止在环路网络中不断增生和无限循环,避免设备由于重复接收相同报文造成报文处理能力的下降;同时,它还具备链路备份的能力。与STP相比,MSTP可以实现网络拓扑的快速收敛,也能使不同VLAN的流量沿各自的路径转发,从而为冗余链路提供了更好的负载分担机制。

    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、配置完成

    栏目热文

    文档排行

    本站推荐

    Copyright © 2018 - 2021 www.yd166.com., All Rights Reserved.