< Home

Configuring VRRP

This section provides a sample of configuring VRRP using the edit-config method.

Table 1 Configuring VRRP

Operation

XPATH

edit-config

/huawei-vrrp:vrrp/vrrp-instance/vrrp4

Data Requirements

Table 2 Configuring VRRP

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>
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic