From 7a188bfd955cbc3c324dfe2dbe1ee7a9c8888a1a Mon Sep 17 00:00:00 2001 From: Markus Katharina Brechtel Date: Tue, 4 Sep 2018 22:32:12 +0000 Subject: [PATCH] bridge --- templates/netifs.json.j2 | 2 +- templates/network-interface-debian.j2 | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/templates/netifs.json.j2 b/templates/netifs.json.j2 index cadba8e..0955079 100644 --- a/templates/netifs.json.j2 +++ b/templates/netifs.json.j2 @@ -1,7 +1,7 @@ [ {% if netifs is defined %} {% for netif in netifs %} -{% if netifs[netif].type == "ethernet" or ( netifs[netif].type == "virt" and virt_type=="qemu" ) %} +{% if netifs[netif].type == "ethernet" or ( netifs[netif].type == "virt" and virt_type=="qemu" ) or netifs[netif].type == "bridge" %} "{{netif}}", {% endif %} {% endfor %} diff --git a/templates/network-interface-debian.j2 b/templates/network-interface-debian.j2 index adbcecc..6544d51 100644 --- a/templates/network-interface-debian.j2 +++ b/templates/network-interface-debian.j2 @@ -53,12 +53,22 @@ iface {{ dev }} inet6 static {% else %} +{% if netifs[netif].type == "bridge" %} +# bridge +iface {{ dev }} inet manual +{% if netifs[netif].devices is defined %} + bridge_ports {{ netifs[netif].devices | join(" ") }} +{% else %} + bridge_ports none +{% endif %} +{% endif %} + {% for ip in netifs[netif].ips %} {% if ip.ip | ipv6 %} # ipv6 {{ip.ip}} iface {{ dev }} inet6 static address {{ ip.ip | ipv6('address') }} - netmask {{ ip.ip | ipv6('netmask') }} + netmask {{ ip.ip | ipv6('prefix') }} {% endif %} {% if ip.ip | ipv4 %} # ipv4 {{ip.ip}}