[systemd-devel] container virtual Ethernet link naming

Dan Williams dcbw at redhat.com
Fri Oct 9 13:00:17 PDT 2015


On Fri, 2015-10-09 at 12:53 -0700, Johannes Ernst wrote:
> man systemd-nspawn, section on --network-veth
>     "The container side of the Ethernet link will be named <literal>host0</literal>."
> 
> container> ip link
> ...
> 2: host0 at if9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
>     link/ether ce:d3:4f:6c:44:5f brd ff:ff:ff:ff:ff:ff link-netnsid 0
> 
> Where does the @if9 come from, and what’s the naming scheme here?

It comes from /sbin/ip.  What's after the @ is the interface index of
the veth peer, so "if9" == interface index 9 and that tells you what the
peer link will be outside the container/namespace.  The stuff after the
@ isn't controlled by systemd/udev, the "if" prefix is hardcoded
in /sbin/ip.

Dan



More information about the systemd-devel mailing list