diff options
-rw-r--r-- | data/templates/vrrp/keepalived.conf.tmpl | 3 | ||||
-rw-r--r-- | interface-definitions/vrrp.xml.in | 19 | ||||
-rwxr-xr-x | smoketest/scripts/cli/test_ha_vrrp.py | 3 |
3 files changed, 25 insertions, 0 deletions
diff --git a/data/templates/vrrp/keepalived.conf.tmpl b/data/templates/vrrp/keepalived.conf.tmpl index 6203184e3..4bbd56584 100644 --- a/data/templates/vrrp/keepalived.conf.tmpl +++ b/data/templates/vrrp/keepalived.conf.tmpl @@ -9,6 +9,9 @@ global_defs { {% if global_parameters.startup_delay is defined %} vrrp_startup_delay {{ global_parameters.startup_delay }} {% endif %} +{% if global_parameters.version is defined %} + vrrp_version {{ 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/vrrp.xml.in b/interface-definitions/vrrp.xml.in index 80a33c2b2..cbd248b33 100644 --- a/interface-definitions/vrrp.xml.in +++ b/interface-definitions/vrrp.xml.in @@ -28,6 +28,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 ad272f524..7d8d7c643 100755 --- a/smoketest/scripts/cli/test_ha_vrrp.py +++ b/smoketest/scripts/cli/test_ha_vrrp.py @@ -88,6 +88,7 @@ class TestVRRP(VyOSUnitTestSHIM.TestCase): priority = '123' preempt_delay = '400' startup_delay = '120' + vrrp_version = '3' for group in groups: vlan_id = group.lstrip('VLAN') @@ -114,6 +115,7 @@ class TestVRRP(VyOSUnitTestSHIM.TestCase): # Global parameters self.cli_set(global_param_base + ['startup-delay', f'{startup_delay}']) + self.cli_set(global_param_base + ['version', vrrp_version]) # commit changes self.cli_commit() @@ -121,6 +123,7 @@ class TestVRRP(VyOSUnitTestSHIM.TestCase): # Check Global parameters config = getConfig(f'global_defs') self.assertIn(f'vrrp_startup_delay {startup_delay}', config) + self.assertIn(f'vrrp_version {vrrp_version}', config) for group in groups: vlan_id = group.lstrip('VLAN') |