Преглед изворни кода

Configure bird6 RAdv feature on B.A.T.M.A.N. gateways.

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
Maximilian Wilhelm пре 7 година
родитељ
комит
dabad6f994
2 измењених фајлова са 44 додато и 0 уклоњено
  1. 20 0
      bird/init.sls
  2. 24 0
      bird/radv.conf

+ 20 - 0
bird/init.sls

@@ -291,3 +291,23 @@ bird6-configure:
 /etc/bird/bird6.d/bogon_unreach.conf:
   file.absent
 {% endif %}
+
+
+#
+# B.A.T.M.A.N. Gateway
+#
+{% if 'batman_gw' in roles %}
+/etc/bird/bird6.d/radv.conf:
+  file.managed:
+    - source: salt://bird/radv.conf
+    - template: jinja
+    - watch_in:
+      - cmd: bird6-configure
+    - require:
+      - file: /etc/bird/bird6.d
+    - require_in:
+      - service: bird6
+{% else %}
+/etc/bird/bird6.d/ravd.conf:
+  file.absent
+{% endif %}

+ 24 - 0
bird/radv.conf

@@ -0,0 +1,24 @@
+{%- set node_config = salt['pillar.get']('nodes:' ~ grains['id']) %}
+{%- set sites_config = salt['pillar.get']('sites') %}
+protocol radv {
+        # ONLY advertise prefix, IF default route is available
+	import all;
+	export all;
+	trigger ::/0;
+
+	rdnss 2001:4860:4860::8888;
+
+{% for site in node_config.get ('sites') %} 
+  {%- set iface = 'br-' ~ site %}
+  {%- set site_config = sites_config.get (site) %}
+	# {{ site }} / {{ site_config.get ('name') }}
+	interface "{{ iface }}" {
+		default   lifetime 600 sensitive yes;
+
+		prefix {{ site_config.get ('prefix_v6') }} {
+			preferred lifetime 3600;
+		};
+	};
+
+{% endfor %}
+}