2

I’m looking for examples how to create/launch a container with a predefined ipv4.address? Is that even possible? I've tried with

lxc launch image name --config 'eth0.ipv4.address=10.0.2.2'

Though this errors out with unknown key? I'm suspecting that's a limitation of LXD?

bugzbunny
  • 41
  • 2

1 Answers1

2

Not with lxc launch image name --config in my testing, though not ideal, the following did accomplish what I needed in the end.

Copy default profile called staticip and remove eth0 device.

LXCN=lxcname
lxc init image name --profile staticip
lxc config device add $LXCN eth0 ipv4.address=10.0.3.2 nictype=bridged parent=virbr1
bugzbunny
  • 41
  • 2