Parcourir la source

SDN: Activate OSPF on Wireguard tunnels

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
Maximilian Wilhelm il y a 2 ans
Parent
commit
c7d7222bf5
1 fichiers modifiés avec 10 ajouts et 0 suppressions
  1. 10 0
      _modules/ffho_net.py

+ 10 - 0
_modules/ffho_net.py

@@ -1320,6 +1320,16 @@ def get_ospf_interface_config (node_config, grains_id):
 			elif iface.startswith ('ovpn-er-'):
 				ospf_config['type'] = 'broadcast'
 
+		# Active OSPF on Wireguard tunnels, cost 10000
+		elif iface.startswith ('wg-'):
+			ospf_on = True
+			ospf_config['stub'] = False
+			ospf_config['cost'] = 10000
+
+			# Inter-Core links should have cost 5000
+			if iface.startswith ('wg-cr') and grains_id.startswith ('cr'):
+				ospf_config['cost'] = 5000
+
 		# OSPF explicitly enabled for interface
 		elif 'ospf' in iface_config:
 			ospf_on = True