Container with p2p nic failing to obtain IP address

Hello,

If a container is using the p2p nic type, is that a “managed” network by LXD? Meaning, can I expect it to automatically get an IP address like bridged networks?

Currently I have a container with nic type p2p that is failing to get an IP. (A different container on same host obtains its IP just fine using bridged connection.)

In the problematic container (running Alpine) I can see udhcpc trying to obtain an IP and failing. It loops on “udhcpc: sending discover”

Configuration is:

devices:
  eth0:
    name: eth0
    nictype: p2p
    type: nic

Any pointers would be appreciated, thanks.

p2p stands for point to point and gives you a veth pair with one device in the container and one in the host.

Unlike bridged, p2p isn’t connected to any bridge on the host and therefore will not get any automatic connectivity from LXD. It’s entirely up to the user to setup the host side of the veth pair whichever way they want.

To make this easier, you usually want to set the host_name property to control the interface’s name and avoid getting a randomly named one.

1 Like