EOX GitLab Instance

Skip to content
Snippets Groups Projects
Commit 78173774 authored by Karl Grube's avatar Karl Grube
Browse files

anycast with IPv4...

parent 126f500e
No related branches found
No related tags found
No related merge requests found
......@@ -2,24 +2,38 @@
if [ "$1" = "up" ]; then
{% for anycast_ip in anycast_ips %}
ip a add {{anycast_ip}}/128 dev lo
{% if (anycast_ip|ansible.utils.ipv4) %}
ip a add {{anycast_ip}}/32 dev lo
{% else %}
ip a add {{anycast_ip}}/128 dev lo
{% endif %}
{% if my_interfaces is defined %}
{% for interface in my_interfaces %}
{% if interface.service|default(False) == True %}
ip a add {{anycast_ip}}/128 dev {{(interface|list)[0]}}
ip -6 rule add from {{anycast_ip}} lookup service priority 900
{% if (anycast_ip|ansible.utils.ipv4) %}
ip a add {{anycast_ip}}/32 dev {{(interface|list)[0]}}
{% else %}
ip a add {{anycast_ip}}/128 dev {{(interface|list)[0]}}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
elif [ "$1" = "down" ]; then
{% for anycast_ip in anycast_ips %}
ip a del {{anycast_ip}}/128 dev lo
{% if (anycast_ip|ansible.utils.ipv4) %}
ip a del {{anycast_ip}}/32 dev lo
{% else %}
ip a del {{anycast_ip}}/128 dev lo
{% endif %}
{% if my_interfaces is defined %}
{% for interface in my_interfaces %}
{% if interface.service|default(False) == True %}
ip a del {{anycast_ip}}/128 dev {{(interface|list)[0]}}
ip -6 rule del from {{anycast_ip}} lookup service priority 900
{% if (anycast_ip|ansible.utils.ipv4) %}
ip a del {{anycast_ip}}/32 dev {{(interface|list)[0]}}
{% else %}
ip a del {{anycast_ip}}/128 dev {{(interface|list)[0]}}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
......@@ -30,3 +44,4 @@ else
fi
exit 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment