summaryrefslogtreecommitdiff
path: root/roles/vm/guest/network/templates/interfaces/multihomed-base6.j2
blob: 53d118b022c04f631ccbcda10f58fd5a43803b69 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  address {{ interface.address6 }}
{% for route in interface.static_routes6 | default([]) %}
  up /bin/ip -6 route add {{ route.destination }} via {{ route.gateway }}{% if 'source' in route %} src {{ route.source }}{% endif %}{% if 'table' in route %} table {{ route.table }}{% endif %}{{ '' }}
{% endfor %}
{% if 'gateway6' in interface %}
  up /bin/ip -6 route add default via {{ interface.gateway }} table default
{% endif %}
  up /bin/ip -6 rule add pref 42000 lookup default
  down /bin/ip -6 rule del pref 42000
{% if 'gateway6' in interface %}
  down /bin/ip -6 route del default via {{ interface.gateway }} table default
{% endif %}
{% for route in interface.static_routes6 | default([])  | reverse %}
  down /bin/ip -6 route del {{ route.destination }} via {{ route.gateway }}{% if 'source' in route %} src {{ route.source }}{% endif %}{% if 'table' in route %} table {{ route.table }}{% endif %}{{ '' }}
{% endfor %}