canonical / lxd

Powerful system container and virtual machine manager
https://canonical.com/lxd
GNU Affero General Public License v3.0
4.32k stars 926 forks source link

none/auto value no more allowed as valid IP address setting #6485

Closed eviweb closed 4 years ago

eviweb commented 4 years ago

Required information

Issue description

none or auto values are no more allowed to IPv4 and IPv6 settings unlike it is described in the network documentation.

Steps to reproduce

  1. lxc init images:alpine/3.10 alpine
  2. lxc network attach lxdbr0 alpine eth0
  3. lxc config device set alpine eth0 ipv4.address auto
    • Expected result: From lxc config show alpine
      devices:
      eth0:
      ipv4.address: auto
      nictype: bridged
      parent: lxdbr0
      type: nic
    • Current result: The following error message:
      Error: Invalid devices: Invalid value for device option ipv4.address: Not an IPv4 address: auto

Information to attach

stgraber commented 4 years ago

You're getting confused between the valid values for LXD networks (lxc network edit lxdbr0) and container devices (lxc config edit alpine).

The none/auto values are only valid for networks, not for network interfaces. For network interfaces, they must either be set to an address in the network's subnet or not be set at all.

https://linuxcontainers.org/lxd/docs/master/containers#nictype-bridged https://linuxcontainers.org/lxd/docs/master/networks

eviweb commented 4 years ago

My bad, thanks for the clarification.