summaryrefslogtreecommitdiff
path: root/roles/vm/guest/network/templates/interfaces/simple.j2
diff options
context:
space:
mode:
Diffstat (limited to 'roles/vm/guest/network/templates/interfaces/simple.j2')
-rw-r--r--roles/vm/guest/network/templates/interfaces/simple.j26
1 files changed, 6 insertions, 0 deletions
diff --git a/roles/vm/guest/network/templates/interfaces/simple.j2 b/roles/vm/guest/network/templates/interfaces/simple.j2
index 26e8aec2..67665f57 100644
--- a/roles/vm/guest/network/templates/interfaces/simple.j2
+++ b/roles/vm/guest/network/templates/interfaces/simple.j2
@@ -3,9 +3,15 @@
{% if 'gateway' in interface %}
gateway {{ interface.gateway }}
{% endif %}
+{% for address in interface.additional_addresses | default([]) %}
+ up /bin/ip addr add dev $IFACE {{ address }}/32
+{% endfor %}
{% for route in interface.static_routes | default([]) %}
up /bin/ip route add {{ route.destination }} via {{ route.gateway }}{% if 'source' in route %} src {{ route.source }}{% endif %}{{ '' }}
{% endfor %}
{% for route in interface.static_routes | default([]) | reverse %}
down /bin/ip route del {{ route.destination }} via {{ route.gateway }}{% if 'source' in route %} src {{ route.source }}{% endif %}{{ '' }}
{% endfor %}
+{% for address in interface.additional_addresses | default([]) | reverse %}
+ down /bin/ip addr del dev $IFACE {{ address }}/32
+{% endfor %}