VRRP Management
This section describes the configuration model of VRRP management and provides examples of XML packets.
Data Model
The data model file matching VRRP management is huawei-vrrp.yang.
Object |
Description |
Value |
Remarks |
---|---|---|---|
/huawei-vrrp:vrrp/vrrp-instance/interface-name |
Indicates the interface for which VRRP is to be configured. |
The value is a character string. |
This object can only be set to an interface that has been created in ietf-interfaces. |
/huawei-vrrp:vrrp/vrrp-instance/vrid |
Indicates the ID of a VRRP group. |
The value is an integer in the range from 1 to 255. |
N/A |
/huawei-vrrp:vrrp/vrrp-instance/vrrp4/virtual-ip |
Indicates the virtual IP address of a VRRP group. |
The value is in dotted decimal notation. |
N/A |
/huawei-vrrp:vrrp/vrrp-instance/vrrp4/preempt-mode-flag |
Indicates the preemption mode of a VRRP group. |
The value is of the Boolean type:
The default value is true. |
If this object is set to false (the non-preemption mode is used), preempt-mode-delay must be set to 0. |
/huawei-vrrp:vrrp/vrrp-instance/vrrp4/preempt-mode-delay |
Indicates the preemption delay of a VRRP group, in seconds. |
The value is an integer in the range from 0 to 3600. The default value is 0. |
If this object is set to a non-zero value, preempt-mode-flag cannot be set to false. |
/huawei-vrrp:vrrp/vrrp-instance/vrrp4/priority |
Indicates the priority of a VRRP group. |
The value is an integer in the range from 1 to 254. |
A larger value indicates a higher priority. |
/huawei-vrrp:vrrp/vrrp-instance/vrrp4/vrrp-track-ifs/vrrp-track-if/if-name |
Indicates the type and number of an interface monitored by a VRRP group. |
The value is a character string. |
Only VLANIF interfaces created in ietf-interfaces can be configured. |
/huawei-vrrp:vrrp/vrrp-instance/vrrp4/vrrp-track-ifs/vrrp-track-if/reduce-value |
Indicates the value by which the priority decreases when the monitored interface becomes Down. |
The value is an integer in the range from 1 to 255. The priority can decrease to 1. |
By default, when the monitored BFD session becomes Down, the VRRP priority decreases by 10. |
/huawei-vrrp:vrrp/vrrp-instance/vrrp4/vrrp-track-ifs/vrrp-track-if/increase-value |
Indicates the value by which the priority increases when the monitored interface becomes Down. |
The value is an integer in the range from 1 to 255. The maximum priority value is 254. |
N/A |
/huawei-vrrp:vrrp/vrrp-instance/vrrp4/vrrp-track-bfd-byids/vrrp-track-bfd-byid/session-id |
Indicates the local discriminator of the monitored BFD session. |
The value is an integer in the range from 1 to 8191. |
N/A |
/huawei-vrrp:vrrp/vrrp-instance/vrrp4/vrrp-track-bfd-byids/vrrp-track-bfd-byid/reduce-value |
Indicates the value by which the priority decreases when the monitored BFD session becomes Down. |
The value is an integer in the range from 1 to 255. The priority can decrease to 1. |
By default, when the monitored BFD session becomes Down, the VRRP priority decreases by 10. |
/huawei-vrrp:vrrp/vrrp-instance/vrrp4/vrrp-track-bfd-byids/vrrp-track-bfd-byid/increase-value |
Indicates the value by which the priority increases when the monitored BFD session becomes Down. |
The value is an integer in the range from 1 to 255. The maximum priority value is 254. |
N/A |
/huawei-vrrp:vrrp/vrrp-instance/vrrp4/vrrp-track-bfd-bynames/vrrp-track-bfd-byname/bfd-session-name |
Indicates the name of the monitored BFD session. |
The value is a string of 1 to 15 case-insensitive characters without spaces.
NOTE:
When quotation marks are used around the string, spaces are allowed in the string. |
N/A |
/huawei-vrrp:vrrp/vrrp-instance/vrrp4/vrrp-track-bfd-bynames/vrrp-track-bfd-byname/reduce-value |
Indicates the value by which the priority decreases when the monitored BFD session becomes Down. |
The value is an integer in the range from 1 to 255. |
By default, when the monitored BFD session becomes Down, the VRRP priority decreases by 10. |
/huawei-vrrp:vrrp/vrrp-instance/vrrp4/vrrp-track-bfd-bynames/vrrp-track-bfd-byname/increase-value |
Indicates the value by which the priority increases when the monitored BFD session becomes Down. |
The value is an integer in the range from 1 to 255. The maximum priority value is 254. |
N/A |
Configuring VRRP
This section provides a sample of configuring VRRP using the edit-config method.
Operation |
XPATH |
---|---|
edit-config |
/huawei-vrrp:vrrp/vrrp-instance/vrrp4 |
Data Requirements
Item |
Data |
Description |
---|---|---|
VRRP interface |
Vlanif30 |
Configure VRRP for the interface Vlanif30. |
VRRP group ID |
10 |
Set the VRRP group ID to 10. |
Virtual IP address |
10.10.10.1 |
Set the virtual IP address of a VRRP group. |
Preemption mode of a VRRP group |
true |
Configure the VRRP group to use the preemption mode. |
Preemption delay |
30 |
Set the preemption delay to 30 seconds for the VRRP group. |
VRRP group priority |
120 |
Set the priority to 120 for the VRRP group. |
Name of the monitored interface |
Vlanif20 |
Configure the interface Vlanif20 to be monitored. |
Value by which the priority increases |
50 |
Configure the priority to increase by 50 when the monitored interface becomes Down. |
Request Example
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="2" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config> <if:interfaces xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces"> <if:interface> <if:name>Vlanif30</if:name> <if:type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:propVirtual</if:type> </if:interface> <if:interface> <if:name>Vlanif20</if:name> <if:type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:propVirtual</if:type> </if:interface> </if:interfaces> <hw-vrrp:vrrp xmlns:hw-vrrp="urn:huawei:params:xml:ns:yang:huawei-vrrp"> <hw-vrrp:vrrp-instance> <hw-vrrp:interface-name>Vlanif30</hw-vrrp:interface-name> <hw-vrrp:vrid>10</hw-vrrp:vrid> <hw-vrrp:vrrp4> <hw-vrrp:virtual-ip>10.10.10.1</hw-vrrp:virtual-ip> <hw-vrrp:preempt-mode-flag>true</hw-vrrp:preempt-mode-flag> <hw-vrrp:preempt-mode-delay>30</hw-vrrp:preempt-mode-delay> <hw-vrrp:priority>120</hw-vrrp:priority> <hw-vrrp:vrrp-track-ifs> <hw-vrrp:vrrp-track-if> <hw-vrrp:if-name>Vlanif20</hw-vrrp:if-name> <hw-vrrp:increase-value>50</hw-vrrp:increase-value> </hw-vrrp:vrrp-track-if> </hw-vrrp:vrrp-track-ifs> </hw-vrrp:vrrp4> </hw-vrrp:vrrp-instance> </hw-vrrp:vrrp> </config> </edit-config> </rpc>
Response Example
Sample of successful response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2"> <ok/> </rpc-reply>
Sample of failed response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="10"> <rpc-error> <error-app-tag>-1</error-app-tag> <error-message>At least one virtual-ip should be configured when there is config under vrrp4.</error-message> <error-info>Error on node /huawei-vrrp:vrrp/vrrp-instance[interface-name="Vlanif30",vrid="3"]</error-info> </rpc-error> </rpc-reply>