summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2022-02-16 15:00:34 +0000
committerViacheslav Hletenko <v.gletenko@vyos.io>2022-02-16 15:00:34 +0000
commitb99432ee2dc84a1d8cef59ef534392867d10de1e (patch)
tree32cb1aa69ae50b33cd6d48e027eba381a742977e /data
parent40bf0d3ff0789378fc208a14437390a8135a7c76 (diff)
downloadvyos-1x-b99432ee2dc84a1d8cef59ef534392867d10de1e.tar.gz
vyos-1x-b99432ee2dc84a1d8cef59ef534392867d10de1e.zip
vrrp: T1972: Ability to set IP address on not vrrp interface
Ability to set virtual_address on not vrrp-listen interface Add ability don't track primary vrrp interface "exclude-vrrp-interface" Add ability to set tracking (state UP/Down) on desired interfaces For example eth0 is used for vrrp and we want to track another eth1 interface that not belong to any vrrp-group set high-avail vrrp group WAN interface 'eth0' set high-avail vrrp group WAN virtual-address 192.0.2.222/24 interface 'eth2' set high-avail vrrp group WAN track exclude-vrrp-interface set high-avail vrrp group WAN track interface 'eth1'
Diffstat (limited to 'data')
-rw-r--r--data/templates/vrrp/keepalived.conf.tmpl14
1 files changed, 12 insertions, 2 deletions
diff --git a/data/templates/vrrp/keepalived.conf.tmpl b/data/templates/vrrp/keepalived.conf.tmpl
index afbdc978e..10d5c6d24 100644
--- a/data/templates/vrrp/keepalived.conf.tmpl
+++ b/data/templates/vrrp/keepalived.conf.tmpl
@@ -28,6 +28,9 @@ vrrp_instance {{ name }} {
virtual_router_id {{ group_config.vrid }}
priority {{ group_config.priority }}
advert_int {{ group_config.advertise_interval }}
+{% if group_config.track is defined and group_config.track.exclude_vrrp_interface is defined %}
+ dont_track_primary
+{% endif %}
{% if group_config.no_preempt is not defined and group_config.preempt_delay is defined and group_config.preempt_delay is not none %}
preempt_delay {{ group_config.preempt_delay }}
{% elif group_config.no_preempt is defined %}
@@ -61,8 +64,8 @@ vrrp_instance {{ name }} {
{% endif %}
{% if group_config.virtual_address is defined and group_config.virtual_address is not none %}
virtual_ipaddress {
-{% for addr in group_config.virtual_address %}
- {{ addr }}
+{% for addr, addr_config in group_config.virtual_address.items() %}
+ {{ addr }}{{ ' dev ' + addr_config.interface if addr_config.interface is defined }}
{% endfor %}
}
{% endif %}
@@ -73,6 +76,13 @@ vrrp_instance {{ name }} {
{% endfor %}
}
{% endif %}
+{% if group_config.track is defined and group_config.track.interface is defined and group_config.track.interface is not none %}
+ track_interface {
+{% for interface in group_config.track.interface %}
+ {{ interface }}
+{% endfor %}
+ }
+{% endif %}
{% if group_config.health_check is defined and group_config.health_check.script is defined and group_config.health_check.script is not none %}
track_script {
healthcheck_{{ name }}