address {{ interface.address6 }} #### overlays {% for overlay in interface.overlays %} {% if 'address6' in overlay %} {% if 'name' in overlay %} ## {{ overlay.name }} {% endif %} up /bin/ip -6 addr add dev $IFACE {{ overlay.address6 | ansible.utils.ipaddr('address') }}/128 nodad preferred_lft 0 up /bin/ip -6 route add default via {{ overlay.gateway6 }} src {{ overlay.address6 | ansible.utils.ipaddr('address') }} table {{ 200 + loop.index0 }} up /bin/ip -6 rule add pref {{ 40000 + loop.index0 }} from {{ overlay.address6 | ansible.utils.ipaddr('address') }} lookup {{ 200 + loop.index0 }} {% endif %} {% endfor %} ########## {% for overlay in interface.overlays | reverse %} {% if 'address6' in overlay %} {% if 'name' in overlay %} ## {{ overlay.name }} {% endif %} down /bin/ip rule del pref {{ 40000 + loop.revindex0 }} down /bin/ip route del default via {{ overlay.gateway6 }} src {{ overlay.address6 | ansible.utils.ipaddr('address') }} table {{ 200 + loop.revindex0 }} down /bin/ip addr del dev $IFACE {{ overlay.address6 | ansible.utils.ipaddr('address') }}/128 {% endif %} {% endfor %}