diff options
author | Christian Pointner <equinox@spreadspace.org> | 2020-07-21 00:20:24 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2020-07-21 00:20:24 +0200 |
commit | 0ab459a63c0a083a45dc21c781729d7ff770d6b4 (patch) | |
tree | 06dd8a71421ebd17ceb544702c3f37e67a23d5c3 /roles/vm/guest/network/templates/interfaces/simple.j2 | |
parent | Merge branch 'topic/installer-again' (diff) | |
parent | vm/host network using ifconfig includes (diff) |
Merge branch 'topic/network-overlays-exteneded'
Diffstat (limited to 'roles/vm/guest/network/templates/interfaces/simple.j2')
-rw-r--r-- | roles/vm/guest/network/templates/interfaces/simple.j2 | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/roles/vm/guest/network/templates/interfaces/simple.j2 b/roles/vm/guest/network/templates/interfaces/simple.j2 new file mode 100644 index 00000000..c5b7dadc --- /dev/null +++ b/roles/vm/guest/network/templates/interfaces/simple.j2 @@ -0,0 +1,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 %} |