From 5912be6275b500ca614e98a2de8633a718f14259 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Loipf=C3=BChrer?= <michael.loipfuehrer@stusta.de>
Date: Mon, 10 Jun 2019 09:54:05 +0000
Subject: [PATCH] networking stuff

---
 container/80-container-ve.network    | 23 +++++++++++++++++++++++
 container/80-container.host0.network | 11 +++++++++++
 container/nspawn                     |  4 ++--
 3 files changed, 36 insertions(+), 2 deletions(-)
 create mode 100644 container/80-container-ve.network
 create mode 100644 container/80-container.host0.network

diff --git a/container/80-container-ve.network b/container/80-container-ve.network
new file mode 100644
index 0000000..41b92ae
--- /dev/null
+++ b/container/80-container-ve.network
@@ -0,0 +1,23 @@
+#  SPDX-License-Identifier: LGPL-2.1+
+#
+#  This file is part of systemd.
+#
+#  systemd is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU Lesser General Public License as published by
+#  the Free Software Foundation; either version 2.1 of the License, or
+#  (at your option) any later version.
+
+# This network file matches the host-side of the virtual Ethernet link
+# created by systemd-nspawn's --network-veth switch. See systemd-nspawn(1) for
+# details.
+
+[Match]
+Name=ve-{{ name }}
+Driver=veth
+
+[Network]
+Address={{ ip_address_host }}
+IPMasquerade=yes
+LLDP=yes
+EmitLLDP=customer-bridge
+IPForward=1
diff --git a/container/80-container.host0.network b/container/80-container.host0.network
new file mode 100644
index 0000000..9a017de
--- /dev/null
+++ b/container/80-container.host0.network
@@ -0,0 +1,11 @@
+[Match]
+Virtualization=container
+Name=host0
+
+[Network]
+DHCP=no
+DNS={{ dns_server }}
+Address={{ ip_address_container }}
+Gateway={{ gateway }}
+LLDP=yes
+EmitLLDP=customer-bridge
diff --git a/container/nspawn b/container/nspawn
index bc26999..11944f6 100644
--- a/container/nspawn
+++ b/container/nspawn
@@ -1,8 +1,8 @@
 [Network]
-VirtualEthernet=no
+VirtualEthernet=yes
 
 [Files]
 Bind=/var/www/{{name}}:/var/www
 
 [Exec]
-PrivateUsers=off
\ No newline at end of file
+PrivateUsers=off
-- 
GitLab