Browse Source

fastd: Reflect batctl CLI changes and set iface penalty on relevant nodes

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
Maximilian Wilhelm 3 years ago
parent
commit
9a60e783d1
1 changed files with 10 additions and 2 deletions
  1. 10 2
      fastd/fastd.conf

+ 10 - 2
fastd/fastd.conf

@@ -1,6 +1,10 @@
 #
 # {{ site }} / {{ network }} FASTd configuration (Salt managed)
 #
+{%- set meshif = "meshif" %}
+{%- if grains.oscodename != "buster" %}
+  {%- set meshif = "-m" %}
+{%- endif %}
 
 log to syslog level info;
 
@@ -44,11 +48,15 @@ on up "
 	ip link set address {{ mac_address }} dev $INTERFACE
 	ip link set $INTERFACE up
 
-	batctl -m {{ bat_iface }} if add $INTERFACE
+	batctl {{ meshif }} {{ bat_iface }} if add $INTERFACE
+{%- if grains.oscodename == "buster" or 'batman-iface-penalty' in salt['pillar.get']('nodes:' ~ grains['id'] ~ ':tags', []) %}
+	# Make VPN more expensive than intra DC/DCI/WBBL links
+	batctl hardif $INTERFACE hop_penalty 50
+{%- endif %}
 ";
 
 on down "
-	batctl -m {{ bat_iface }} if del $INTERFACE
+	batctl {{ meshif }} {{ bat_iface }} if del $INTERFACE
 ";
 
 {%- if network_type == 'nodes' %}