chiark / gitweb /
networkd/nspawn: enable dhcp client on veth device created in guest
authorTom Gundersen <teg@jklm.no>
Fri, 21 Feb 2014 21:44:42 +0000 (22:44 +0100)
committerTom Gundersen <teg@jklm.no>
Sat, 22 Feb 2014 17:29:43 +0000 (18:29 +0100)
When starting systemd-nspawn with --network-veth, we create a veth device called
host0 in the guest. Pick up on this and start a dhcp client on it. We will also
pick up host0 netdevs created by other containers should they chose to use the
same name.

Makefile.am
network/80-container-host0.network [new file with mode: 0644]

index 069971268609eb21878262712ed3e466405e0266..647e993a5fa6733a6fa37534cb597121882ea01d 100644 (file)
@@ -2464,7 +2464,8 @@ INSTALL_DIRS += \
        $(sysconfdir)/udev/hwdb.d
 
 dist_network_DATA = \
-       network/99-default.link
+       network/99-default.link \
+       network/80-container-host0.network
 
 dist_udevrules_DATA += \
        rules/99-systemd.rules \
diff --git a/network/80-container-host0.network b/network/80-container-host0.network
new file mode 100644 (file)
index 0000000..d49fba0
--- /dev/null
@@ -0,0 +1,6 @@
+[Match]
+Virtualization=container
+Name=host0
+
+[Network]
+DHCP=yes