Skip to content

Commit 9f2a1e7

Browse files
committed
FRR: Make VARP configuration AF-specific
Based on suggestion by @jbemmel in c5ba130
1 parent 57ae285 commit 9f2a1e7

File tree

1 file changed

+8
-2
lines changed
  • netsim/ansible/templates/gateway

1 file changed

+8
-2
lines changed

netsim/ansible/templates/gateway/frr.j2

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#
33
set -e # Exit immediately when any command fails
44
#
5+
sysctl -w net.ipv6.conf.all.enhanced_dad=0
6+
sysctl -w net.ipv6.conf.default.enhanced_dad=0
57
{% for intf in interfaces if intf.gateway.protocol|default('none') == 'vrrp' %}
68
{% for afm in ['ipv4','ipv6'] if afm in intf.gateway %}
79
{% set v_if = 'vrrp%s-%s-%s'|format('6' if afm == 'ipv6' else '',intf.ifindex,intf.gateway.vrrp.group) %}
@@ -29,13 +31,17 @@ if [ ! -e /sys/class/net/{{ v_if }} ]; then
2931
{% for afm in ['ipv4','ipv6'] if afm in intf.gateway %}
3032
ip addr add {{ intf.gateway[afm] }} dev {{ v_if }} metric 1024
3133
{% endfor %}
32-
sysctl -w net.ipv6.conf.all.enhanced_dad=0
33-
sysctl -w net.ipv6.conf.default.enhanced_dad=0
34+
{% if 'ipv4' in intf.gateway %}
3435
sysctl -w net.ipv4.conf.{{ intf.ifname }}.arp_announce=1
3536
sysctl -w net.ipv4.conf.{{ intf.ifname }}.arp_ignore=2
37+
{% endif %}
38+
{% if 'ipv6' in intf.gateway %}
3639
sysctl -w net.ipv6.conf.{{ v_if }}.enhanced_dad=0
3740
sysctl -w net.ipv6.conf.{{ v_if }}.accept_dad=0
3841
sysctl -w net.ipv6.conf.{{ v_if }}.dad_transmits=0
42+
{% else %}
43+
sysctl -w net.ipv6.conf.{{ v_if }}.disable_ipv6=1
44+
{% endif %}
3945
ip link set dev {{ v_if }} up
4046
fi
4147
{% endfor %}

0 commit comments

Comments
 (0)