summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2024-03-28 12:16:31 +0000
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-03-28 17:18:58 +0000
commitcc60e0dcd491e606ac45241419a71e3a763f6ac1 (patch)
tree8ffec5834fde4bc18e76d642a283baed0103220e
parent42c9243e05a9b9617e9053a3caaddf01567501e3 (diff)
downloadvyos-1x-cc60e0dcd491e606ac45241419a71e3a763f6ac1.tar.gz
vyos-1x-cc60e0dcd491e606ac45241419a71e3a763f6ac1.zip
T5832: VRRP allow set interface for exluded-address
Ability to set interface for `excluded-address` The excluded-addresses are not listed in the VRRP packet (adverts packets). We have this ability for `address`, add the same feature for the excluded-address ``` set high-availability vrrp group GRP-01 excluded-address 192.0.2.202 interface 'dum2' set high-availability vrrp group GRP-01 excluded-address 192.0.2.203 interface 'dum3' ``` (cherry picked from commit 0daf445abcd00446da21fe0220d41d5fdde95ebd)
-rw-r--r--data/templates/high-availability/keepalived.conf.j24
-rw-r--r--interface-definitions/high-availability.xml.in23
2 files changed, 18 insertions, 9 deletions
diff --git a/data/templates/high-availability/keepalived.conf.j2 b/data/templates/high-availability/keepalived.conf.j2
index 240161748..c0d66ae54 100644
--- a/data/templates/high-availability/keepalived.conf.j2
+++ b/data/templates/high-availability/keepalived.conf.j2
@@ -138,8 +138,8 @@ vrrp_instance {{ name }} {
{% endif %}
{% if group_config.excluded_address is vyos_defined %}
virtual_ipaddress_excluded {
-{% for addr in group_config.excluded_address %}
- {{ addr }}
+{% for addr, addr_config in group_config.excluded_address.items() %}
+ {{ addr }}{{ ' dev ' + addr_config.interface if addr_config.interface is vyos_defined }}
{% endfor %}
}
{% endif %}
diff --git a/interface-definitions/high-availability.xml.in b/interface-definitions/high-availability.xml.in
index 558404882..7108aa06c 100644
--- a/interface-definitions/high-availability.xml.in
+++ b/interface-definitions/high-availability.xml.in
@@ -294,25 +294,34 @@
#include <include/generic-interface-broadcast.xml.i>
</children>
</tagNode>
- <leafNode name="excluded-address">
+ <tagNode name="excluded-address">
<properties>
<help>Virtual address (If you need additional IPv4 and IPv6 in same group)</help>
<valueHelp>
+ <format>ipv4net</format>
+ <description>IPv4 address and prefix length</description>
+ </valueHelp>
+ <valueHelp>
+ <format>ipv6net</format>
+ <description>IPv6 address and prefix length</description>
+ </valueHelp>
+ <valueHelp>
<format>ipv4</format>
- <description>IP address</description>
+ <description>IPv4 address</description>
</valueHelp>
<valueHelp>
<format>ipv6</format>
<description>IPv6 address</description>
</valueHelp>
- <multi/>
<constraint>
- <validator name="ipv4-host"/>
- <validator name="ipv6-host"/>
+ <validator name="ip-host"/>
+ <validator name="ip-address"/>
</constraint>
- <constraintErrorMessage>Virtual address must be a valid IPv4 or IPv6 address with prefix length (e.g. 192.0.2.3/24 or 2001:db8:ff::10/64)</constraintErrorMessage>
</properties>
- </leafNode>
+ <children>
+ #include <include/generic-interface-broadcast.xml.i>
+ </children>
+ </tagNode>
<leafNode name="vrid">
<properties>
<help>Virtual router identifier</help>