router id {{ pillar['hosts-inet']['core'][salt['grains.get']('id')] }}; protocol kernel { scan time 10; import none; export all; } protocol device { scan time 10; } {%- set radv_ifaces = pillar.get('radv') and pillar['radv'].get(salt['grains.get']('id')) %} {%- if radv_ifaces %} protocol radv { {%- for iface, conf in radv_ifaces.items() %} interface "{{ iface }}" { {%- if conf.get('rdnss') %} {%- for value in conf['rdnss'] %} {%- set host = value.split('.')[0] %} {%- set net = value.split('.')[1] %} rdnss {{ pillar['hosts-inet6'][net][host] }}; {%- endfor %} {%- endif %} {%- if conf.get('dnssl') %} dnssl { {%- for value in conf['dnssl'] %} domain "{{ value }}"; {%- endfor %} }; {%- endif %} }; {%- endfor %} } {%- endif %} protocol ospf ZW6 { area 0 { networks { fd23:42:c3d2:500::/56; }; {%- for iface, ips in salt['grains.get']('ip_interfaces').items() %} {%- set subnet = pillar['subnets-inet6'].get(iface) %} {%- if iface == 'core' or iface == 'br-core' %} interface "{{ iface }}" { }; {%- elif subnet %} stubnet {{ subnet }} {}; {%- endif %} {%- endfor %} {%- if pillar['ospf'].get('stubnets-inet6') %} {%- for stubnet in pillar['ospf']['stubnets-inet6'] %} stubnet {{ stubnet }} {}; {%- endfor %} {%- endif %} }; } {%- if pillar.get('bgp') %} protocol static { route fd23:42:c3d2:500::/56 unreachable; } protocol bgp { local as {{ pillar['bgp']['asn'] }}; import all; {%- for host, neighbor in pillar['bgp']['peers-inet6'].items() %} neighbor {{ host }} as {{ neighbor.asn }}; {%- endfor %} export where source=RTS_STATIC; } {%- endif %}