HSRP, or Hot Standby Router Protocol, is a Cisco-proprietary redundancy protocol that allows multiple routers or switches to work together to present a single virtual IP address to the network. This virtual IP address can be used as the default gateway for hosts on the network, providing high availability and redundancy in case one of the physical devices fails. Although HSRP is a Cisco protocol, Huawei switches support a similar feature called VRRP (Virtual Router Redundancy Protocol), which serves the same purpose. In this blog, as a Huawei switch supplier, I'll guide you through the process of configuring HSRP-like functionality using VRRP on a Huawei switch.
Prerequisites
Before you start configuring VRRP on a Huawei switch, you need to have the following:
- A Huawei switch, such as the Huawei S6720 30C EI 24S AC, Huawei S5700 Switch, or S6730 Huawei.
- Basic knowledge of networking concepts, including IP addressing, subnetting, and VLANs.
- Access to the switch's command-line interface (CLI) through a console cable or Telnet/SSH.
Step 1: Enter System View
First, you need to log in to the Huawei switch using the console cable or a remote connection. Once you're logged in, enter the system view by typing the following command:
<Huawei> system-view
This command will change your prompt from <Huawei> to [Huawei], indicating that you're now in the system view.
Step 2: Create a VLAN Interface
VRRP operates at the layer 3 level, so you need to create a VLAN interface for the VLAN that you want to configure VRRP on. For example, if you want to configure VRRP on VLAN 10, you can create a VLAN interface using the following command:
[Huawei] interface vlanif 10
This command will create a VLAN interface for VLAN 10 and enter the interface view for that interface.
Step 3: Configure the IP Address
Next, you need to configure an IP address for the VLAN interface. This IP address will be used as the physical IP address of the switch on the VLAN. For example, if you want to assign the IP address 192.168.10.1 with a subnet mask of 255.255.255.0 to the VLAN interface, you can use the following command:
[Huawei-Vlanif10] ip address 192.168.10.1 24
Step 4: Configure VRRP
Now, you're ready to configure VRRP on the VLAN interface. First, enable VRRP on the interface using the following command:
[Huawei-Vlanif10] vrrp vrid 1 virtual-ip 192.168.10.254
In this command, vrid 1 is the VRRP virtual router ID, which is a number between 1 and 255 that identifies the VRRP group. 192.168.10.254 is the virtual IP address that will be used as the default gateway for hosts on the VLAN.
Step 5: Configure the Priority
By default, the priority of a VRRP router is 100. The router with the highest priority will become the master router, which is responsible for forwarding traffic. You can configure the priority of the switch using the following command:
[Huawei-Vlanif10] vrrp vrid 1 priority 120
In this example, the priority of the switch is set to 120, which means it will become the master router as long as there are no other routers with a higher priority.
Step 6: Configure Preemption
Preemption allows a router with a higher priority to take over the master role if it becomes available. By default, preemption is enabled on Huawei switches. You can verify the preemption status using the following command:
[Huawei-Vlanif10] display vrrp
If you want to disable preemption, you can use the following command:
[Huawei-Vlanif10] vrrp vrid 1 preempt-mode disable
Step 7: Save the Configuration
Once you've finished configuring VRRP, you need to save the configuration to the switch's startup configuration. You can do this using the following command:


[Huawei] save
This command will prompt you to confirm the save operation. Type y and press Enter to save the configuration.
Step 8: Verify the Configuration
You can verify the VRRP configuration using the following command:
[Huawei] display vrrp
This command will display the VRRP status information, including the virtual router ID, virtual IP address, priority, and master router status.
Troubleshooting
If you encounter any issues with the VRRP configuration, you can use the following commands to troubleshoot:
display interface vlanif [vlan-id]: This command will display the status of the VLAN interface, including the IP address and link status.display vrrp statistics: This command will display the VRRP statistics, including the number of advertisements sent and received.display vrrp brief: This command will display a brief summary of the VRRP configuration, including the virtual router ID, virtual IP address, and master router status.
Conclusion
Configuring VRRP on a Huawei switch is a straightforward process that can provide high availability and redundancy for your network. By following the steps outlined in this blog, you can easily configure VRRP on your Huawei switch and ensure that your network remains operational in case of a device failure.
If you're interested in purchasing Huawei switches or need further assistance with network configuration, please feel free to contact us for procurement and negotiation. We're here to help you find the best solutions for your networking needs.
References
- Huawei Enterprise Network Documentation
- Networking Fundamentals Textbooks
