Преглед на файлове

bird: Configure radv protocol only on BATMAN gw named gw*

  There is one BATMAN gw within the city with shitty uplink.
  Let's only force IPv4 traffic to be bound there.

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
Maximilian Wilhelm преди 6 години
родител
ревизия
037b69485f
променени са 2 файла, в които са добавени 3 реда и са изтрити 1 реда
  1. 1 1
      bird/init.sls
  2. 2 0
      bird/radv.conf

+ 1 - 1
bird/init.sls

@@ -358,7 +358,7 @@ bird6-configure:
 #
 # RAdvd (for B.A.T.M.A.N. Gateways / L3-Access)
 #
-{% if 'batman_gw' in roles or "l3_access" in roles %}
+{% if ('batman_gw' in roles and grains.id.startswith('gw')) or "l3_access" in roles %}
 /etc/bird/bird6.d/radv.conf:
   file.managed:
     - source: salt://bird/radv.conf

+ 2 - 0
bird/radv.conf

@@ -8,6 +8,7 @@ protocol radv {
 
 	rdnss 2a03:2260:2342:f251::53;
 
+{%- if grains.id.startswith('gw') %}
 {% for site in node_config.get ('sites', []) %}
   {%- set iface = 'br-' ~ site %}
   {%- set site_config = sites_config.get (site) %}
@@ -21,6 +22,7 @@ protocol radv {
 	};
 
 {% endfor %}
+{%- endif %}
 {%- for iface, iface_config in node_config.get ('ifaces').items ()|sort %}
   {%- if salt['ffho.re_search']('^vlan3\d\d$', iface) %}
     {%- set v6_ip = salt['ffho_net.get_node_iface_ips'](node_config, iface, with_mask = True)['v6'][0] %}