From 2f091b1b49543aade4aad9ec3b35b3665abac3e7 Mon Sep 17 00:00:00 2001 From: Thierry Martin Date: Mon, 5 Sep 2022 15:02:06 +0200 Subject: nspawn: container network interface naming systemd-nspawn now optionally supports colon-separated pair of host interface name and container interface name for --network-macvlan, --network-ipvlan and --network-interface options. Also supported in .nspawn configuration files (i.e Interface=, MACVLAN=, IPVLAN= parameters). man page changed for ntwk interface naming --- man/systemd-nspawn.xml | 29 +++++++++++++++++++---------- man/systemd.nspawn.xml | 11 ++++++++--- 2 files changed, 27 insertions(+), 13 deletions(-) (limited to 'man') diff --git a/man/systemd-nspawn.xml b/man/systemd-nspawn.xml index 39a6febb3c..3b158a0631 100644 --- a/man/systemd-nspawn.xml +++ b/man/systemd-nspawn.xml @@ -852,11 +852,13 @@ - Assign the specified network interface to the container. This will remove the - specified interface from the calling namespace and place it in the container. When the container - terminates, it is moved back to the calling namespace. Note that - implies . This option may be - used more than once to add multiple network interfaces to the container. + Assign the specified network interface to the container. Either takes a single + interface name, referencing the name on the host, or a colon-separated pair of interfaces, in which + case the first one references the name on the host, and the second one the name in the container. + When the container terminates, the interface is moved back to the calling namespace and renamed to + its original name. Note that implies + . This option may be used more than once to add multiple network + interfaces to the container. Note that any network interface specified this way must already exist at the time the container is started. If the container shall be started automatically at boot via a @@ -880,9 +882,12 @@ After=sys-subsystem-net-devices-ens1.device Create a macvlan interface of the specified Ethernet network - interface and add it to the container. A macvlan interface is a virtual interface - that adds a second MAC address to an existing physical Ethernet link. The interface in the container - will be named after the interface on the host, prefixed with mv-. Note that + interface and add it to the container. Either takes a single interface name, referencing the name + on the host, or a colon-separated pair of interfaces, in which case the first one references the name + on the host, and the second one the name in the container. A macvlan interface is + a virtual interface that adds a second MAC address to an existing physical Ethernet link. If the + container interface name is not defined, the interface in the container will be named after the + interface on the host, prefixed with mv-. Note that implies . This option may be used more than once to add multiple network interfaces to the container. @@ -895,9 +900,13 @@ After=sys-subsystem-net-devices-ens1.device Create an ipvlan interface of the specified Ethernet network - interface and add it to the container. An ipvlan interface is a virtual interface, + interface and add it to the container. Either takes a single interface name, referencing the name on + the host, or a colon-separated pair of interfaces, in which case the first one references the name + on the host, and the second one the name in the container. An ipvlan interface is + a virtual interface, similar to a macvlan interface, which uses the same MAC address as the underlying - interface. The interface in the container will be named after the interface on the host, prefixed + interface. If the container interface name is not defined, the interface in the container will be + named after the interface on the host, prefixed with iv-. Note that implies . This option may be used more than once to add multiple network interfaces to the container. diff --git a/man/systemd.nspawn.xml b/man/systemd.nspawn.xml index c1eef7853b..ec94176c01 100644 --- a/man/systemd.nspawn.xml +++ b/man/systemd.nspawn.xml @@ -531,8 +531,11 @@ Interface= - Takes a space-separated list of interfaces to - add to the container. This option corresponds to the + Takes a space-separated list of interfaces to add to the container. + The interface object is defined either by a single interface name, referencing the name on the host, + or a colon-separated pair of interfaces, in which case the first one references the name on the host, + and the second one the name in the container. + This option corresponds to the command line switch and implies Private=yes. This option is privileged (see above). @@ -544,7 +547,9 @@ Takes a space-separated list of interfaces to add MACLVAN or IPVLAN interfaces to, which are then added to - the container. These options correspond to the + the container. The interface object is defined either by a single interface name, referencing the name + on the host, or a colon-separated pair of interfaces, in which case the first one references the name + on the host, and the second one the name in the container. These options correspond to the and command line switches and imply Private=yes. These options are -- cgit v1.2.1