radv.conf 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. {%- set node_config = salt['pillar.get']('nodes:' ~ grains['id']) %}
  2. {%- set sites_config = salt['pillar.get']('sites') %}
  3. protocol radv {
  4. # ONLY advertise prefix, IF default route is available
  5. import all;
  6. export all;
  7. trigger ::/0;
  8. rdnss {{ salt['pillar.get'] ('globals:dns:resolver_v6') }};
  9. {%- if grains.id.startswith('gw') %}
  10. {% for site in node_config.get ('sites', []) %}
  11. {%- set iface = 'br-' ~ site %}
  12. {%- set site_config = sites_config.get (site) %}
  13. # {{ site }} / {{ site_config.get ('name') }}
  14. interface "{{ iface }}" {
  15. default lifetime 600 sensitive yes;
  16. prefix {{ site_config.get ('prefix_v6') }} {
  17. preferred lifetime 3600;
  18. };
  19. };
  20. {% endfor %}
  21. {%- endif %}
  22. {%- for iface, iface_config in node_config.get ('ifaces').items ()|sort %}
  23. {%- if salt['ffho.re_search']('^vlan(3\d\d|39\d\d)$', iface) or "l3-access" in iface_config.get ('tags', []) %}
  24. {%- set v6_ip = salt['ffho_net.get_node_iface_ips'](node_config, iface, with_mask = True)['v6'][0] %}
  25. {%- set prefix = salt['ffho_net.get_network_address'](v6_ip, with_prefixlen = True) %}
  26. # {{ iface_config.get ('desc', 'L3-Access') }}
  27. interface "{{ iface }}" {
  28. default lifetime 600 sensitive yes;
  29. prefix {{ prefix }} {
  30. preferred lifetime 3600;
  31. };
  32. };
  33. {%- endif %}
  34. {%- endfor %}
  35. }