summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/templates/high-availability/keepalived.conf.j23
-rw-r--r--interface-definitions/high-availability.xml.in19
-rwxr-xr-xsmoketest/scripts/cli/test_ha_vrrp.py3
3 files changed, 25 insertions, 0 deletions
diff --git a/data/templates/high-availability/keepalived.conf.j2 b/data/templates/high-availability/keepalived.conf.j2
index 85b89c70c..bcd92358f 100644
--- a/data/templates/high-availability/keepalived.conf.j2
+++ b/data/templates/high-availability/keepalived.conf.j2
@@ -25,6 +25,9 @@ global_defs {
{% if vrrp.global_parameters.garp.master_repeat is vyos_defined %}
vrrp_garp_master_repeat {{ vrrp.global_parameters.garp.master_repeat }}
{% endif %}
+{% if vrrp.global_parameters.version is vyos_defined %}
+ vrrp_version {{ vrrp.global_parameters.version }}
+{% endif %}
{% endif %}
notify_fifo /run/keepalived/keepalived_notify_fifo
notify_fifo_script /usr/libexec/vyos/system/keepalived-fifo.py
diff --git a/interface-definitions/high-availability.xml.in b/interface-definitions/high-availability.xml.in
index c5e46ed38..413b822f0 100644
--- a/interface-definitions/high-availability.xml.in
+++ b/interface-definitions/high-availability.xml.in
@@ -30,6 +30,25 @@
</constraint>
</properties>
</leafNode>
+ <leafNode name="version">
+ <properties>
+ <help>Default VRRP version to use, IPv6 always uses VRRP version 3</help>
+ <completionHelp>
+ <list>2 3</list>
+ </completionHelp>
+ <valueHelp>
+ <format>u32:2</format>
+ <description>VRRP version 2</description>
+ </valueHelp>
+ <valueHelp>
+ <format>u32:3</format>
+ <description>VRRP version 3</description>
+ </valueHelp>
+ <constraint>
+ <validator name="numeric" argument="--range 2-3"/>
+ </constraint>
+ </properties>
+ </leafNode>
</children>
</node>
<tagNode name="group">
diff --git a/smoketest/scripts/cli/test_ha_vrrp.py b/smoketest/scripts/cli/test_ha_vrrp.py
index 3a4de2d8d..03bdbdd61 100755
--- a/smoketest/scripts/cli/test_ha_vrrp.py
+++ b/smoketest/scripts/cli/test_ha_vrrp.py
@@ -96,6 +96,7 @@ class TestVRRP(VyOSUnitTestSHIM.TestCase):
group_garp_master_delay = '12'
group_garp_master_repeat = '13'
group_garp_master_refresh = '14'
+ vrrp_version = '3'
for group in groups:
vlan_id = group.lstrip('VLAN')
@@ -133,6 +134,7 @@ class TestVRRP(VyOSUnitTestSHIM.TestCase):
self.cli_set(global_param_base + ['garp', 'master-repeat', f'{garp_master_repeat}'])
self.cli_set(global_param_base + ['garp', 'master-refresh', f'{garp_master_refresh}'])
self.cli_set(global_param_base + ['garp', 'master-refresh-repeat', f'{garp_master_refresh_repeat}'])
+ self.cli_set(global_param_base + ['version', vrrp_version])
# commit changes
self.cli_commit()
@@ -145,6 +147,7 @@ class TestVRRP(VyOSUnitTestSHIM.TestCase):
self.assertIn(f'vrrp_garp_master_repeat {garp_master_repeat}', config)
self.assertIn(f'vrrp_garp_master_refresh {garp_master_refresh}', config)
self.assertIn(f'vrrp_garp_master_refresh_repeat {garp_master_refresh_repeat}', config)
+ self.assertIn(f'vrrp_version {vrrp_version}', config)
for group in groups:
vlan_id = group.lstrip('VLAN')