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 %}