summaryrefslogtreecommitdiff
path: root/roles/vm/guest/network/templates/interfaces/simple.j2
blob: c5b7dadc2037d72e58aa893c60ff8040f802ff1d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
  address {{ interface.address | ipaddr('address') }}
  netmask {{ interface.address | ipaddr('netmask') }}
{% if 'gateway' in interface %}
  gateway {{ interface.gateway }}
{% endif %}
{% 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 %}