summaryrefslogtreecommitdiffstats
path: root/network
diff options
context:
space:
mode:
Diffstat (limited to 'network')
-rw-r--r--network/80-container-host0.network25
-rw-r--r--network/80-container-ve.network25
-rw-r--r--network/80-container-vz.network24
-rw-r--r--network/80-vm-vt.network24
-rw-r--r--network/80-wifi-adhoc.network6
-rw-r--r--network/80-wifi-ap.network.example8
-rw-r--r--network/80-wifi-station.network.example6
-rw-r--r--network/99-default.link16
-rw-r--r--network/meson.build20
9 files changed, 154 insertions, 0 deletions
diff --git a/network/80-container-host0.network b/network/80-container-host0.network
new file mode 100644
index 0000000..a8e6834
--- /dev/null
+++ b/network/80-container-host0.network
@@ -0,0 +1,25 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+#
+# 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 container-side of the virtual Ethernet link
+# created by systemd-nspawn's --network-veth switch. See systemd-nspawn(1) for
+# details.
+
+[Match]
+Virtualization=container
+Name=host0
+
+[Network]
+DHCP=yes
+LinkLocalAddressing=yes
+LLDP=yes
+EmitLLDP=customer-bridge
+
+[DHCP]
+UseTimezone=yes
diff --git a/network/80-container-ve.network b/network/80-container-ve.network
new file mode 100644
index 0000000..7e8ff48
--- /dev/null
+++ b/network/80-container-ve.network
@@ -0,0 +1,25 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+#
+# 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-*
+Driver=veth
+
+[Network]
+# Default to using a /28 prefix, giving up to 13 addresses per container.
+Address=0.0.0.0/28
+LinkLocalAddressing=yes
+DHCPServer=yes
+IPMasquerade=yes
+LLDP=yes
+EmitLLDP=customer-bridge
diff --git a/network/80-container-vz.network b/network/80-container-vz.network
new file mode 100644
index 0000000..b0ea57a
--- /dev/null
+++ b/network/80-container-vz.network
@@ -0,0 +1,24 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+#
+# 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 bridge interface created by systemd-nspawn's
+# --network-zone= switch. See systemd-nspawn(1) for details.
+
+[Match]
+Name=vz-*
+Driver=bridge
+
+[Network]
+# Default to using a /24 prefix, giving up to 253 addresses per virtual network.
+Address=0.0.0.0/24
+LinkLocalAddressing=yes
+DHCPServer=yes
+IPMasquerade=yes
+LLDP=yes
+EmitLLDP=customer-bridge
diff --git a/network/80-vm-vt.network b/network/80-vm-vt.network
new file mode 100644
index 0000000..45c5ab1
--- /dev/null
+++ b/network/80-vm-vt.network
@@ -0,0 +1,24 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+#
+# 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 vt-* TUN/TAP devices and applies a similar
+# configuration as ve-* to provide NAT/DHCP to VMs.
+
+[Match]
+Name=vt-*
+Driver=tun
+
+[Network]
+# Default to using a /28 prefix, giving up to 13 addresses per VM.
+Address=0.0.0.0/28
+LinkLocalAddressing=yes
+DHCPServer=yes
+IPMasquerade=yes
+LLDP=yes
+EmitLLDP=customer-bridge
diff --git a/network/80-wifi-adhoc.network b/network/80-wifi-adhoc.network
new file mode 100644
index 0000000..b909f9a
--- /dev/null
+++ b/network/80-wifi-adhoc.network
@@ -0,0 +1,6 @@
+[Match]
+Type=wifi
+WLANInterfaceType=ad-hoc
+
+[Network]
+LinkLocalAddressing=yes
diff --git a/network/80-wifi-ap.network.example b/network/80-wifi-ap.network.example
new file mode 100644
index 0000000..6644c7e
--- /dev/null
+++ b/network/80-wifi-ap.network.example
@@ -0,0 +1,8 @@
+[Match]
+Type=wifi
+WLANInterfaceType=ap
+
+[Network]
+Address=0.0.0.0/24
+DHCPServer=yes
+IPMasquerade=yes
diff --git a/network/80-wifi-station.network.example b/network/80-wifi-station.network.example
new file mode 100644
index 0000000..9268eb6
--- /dev/null
+++ b/network/80-wifi-station.network.example
@@ -0,0 +1,6 @@
+[Match]
+Type=wifi
+WLANInterfaceType=station
+
+[Network]
+DHCP=yes
diff --git a/network/99-default.link b/network/99-default.link
new file mode 100644
index 0000000..bca660a
--- /dev/null
+++ b/network/99-default.link
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+#
+# 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.
+
+[Match]
+OriginalName=*
+
+[Link]
+NamePolicy=keep kernel database onboard slot path
+AlternativeNamesPolicy=database onboard slot path
+MACAddressPolicy=persistent
diff --git a/network/meson.build b/network/meson.build
new file mode 100644
index 0000000..b0e60f7
--- /dev/null
+++ b/network/meson.build
@@ -0,0 +1,20 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+if conf.get('ENABLE_NETWORKD') == 1
+ install_data('80-container-host0.network',
+ '80-container-ve.network',
+ '80-container-vz.network',
+ '80-vm-vt.network',
+ '80-wifi-adhoc.network',
+ '80-wifi-ap.network.example',
+ '80-wifi-station.network.example',
+ install_dir : networkdir)
+
+ if install_sysconfdir
+ meson.add_install_script('sh', '-c',
+ mkdir_p.format(join_paths(sysconfdir, 'systemd/network')))
+ endif
+endif
+
+install_data('99-default.link',
+ install_dir : networkdir)