summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorSander Klein <github@roedie.nl>2022-09-08 16:42:26 +0200
committerSander Klein <github@roedie.nl>2022-09-11 21:04:01 +0200
commit803f1bdc4ae13f3becb4dfe1a7831905152d6c10 (patch)
tree874d81ef24f58bc9879fcfedf36cf7fa30971a82 /data
parent627cfc6d6733998a721ac97f9f5bc44c4c2c6797 (diff)
downloadvyos-1x-803f1bdc4ae13f3becb4dfe1a7831905152d6c10.tar.gz
vyos-1x-803f1bdc4ae13f3becb4dfe1a7831905152d6c10.zip
T4665: Keepalived: Fix interface names
When applying the same VRID for IPv4 and IPv6 with RFC3768 compatibility enabled, the IPv6 interfaces came back with the wrong name. For example: Name Interface VRID State Priority Last Transition ------ ----------- ------ ------- ---------- ----------------- v4-10 eth1v10 10 MASTER 100 21s v6-10 vrrpv10 10 MASTER 100 21s Because of this, the IPv6 interface didn't show up in `show int`. This change suffixes the interface with the IP version so `show int` works again. Name Interface VRID State Priority Last Transition ------ ----------- ------ ------- ---------- ----------------- v4-10 eth1v10v4 10 MASTER 100 21s v6-10 eth1v10v6 10 MASTER 100 21s vyos@vyos:~$ show interfaces Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down Interface IP Address S/L Description --------- ---------- --- ----------- [....] eth1v10v4 192.168.10.60/24 u/u eth1v10v6 2001:ffff::1/64 u/u [....]
Diffstat (limited to 'data')
-rw-r--r--data/templates/high-availability/keepalived.conf.j24
1 files changed, 2 insertions, 2 deletions
diff --git a/data/templates/high-availability/keepalived.conf.j2 b/data/templates/high-availability/keepalived.conf.j2
index 6684dbc2c..706e1c5ae 100644
--- a/data/templates/high-availability/keepalived.conf.j2
+++ b/data/templates/high-availability/keepalived.conf.j2
@@ -47,10 +47,10 @@ vrrp_instance {{ name }} {
{% endif %}
{% endif %}
{% if group_config.rfc3768_compatibility is vyos_defined and group_config.peer_address is vyos_defined %}
- use_vmac {{ group_config.interface }}v{{ group_config.vrid }}
+ use_vmac {{ group_config.interface }}v{{ group_config.vrid }}v{{ '4' if group_config['address'] | first | is_ipv4 else '6' }}
vmac_xmit_base
{% elif group_config.rfc3768_compatibility is vyos_defined %}
- use_vmac {{ group_config.interface }}v{{ group_config.vrid }}
+ use_vmac {{ group_config.interface }}v{{ group_config.vrid }}v{{ '4' if group_config['address'] | first | is_ipv4 else '6' }}
{% endif %}
{% if group_config.authentication is vyos_defined %}
authentication {