summaryrefslogtreecommitdiff
path: root/roles/vm/host/network/templates/interfaces/simple.j2
blob: 8d1bb83ebe16fe6940ef43b089b86b4523e796ae (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 %}