I have a question as to how/when an IPv4 gets assigned.
I’ve created an image [alias=‘local/stretch’] from debootstrap. I then proceed to create an instance ‘local-stretch’ from image [ lxc launch local/stretch local-stretch].
Upon listing instances I see that only IPv6 is assigned. No IPv4.
Upon some web search I found that following steps assign a static ip. lxc network attach lxdbr0 local-stretch eth0 eth0 lxc config device set local-stretch eth0 ipv4.address 10.226.171.101 [host ip is 10.226.171.1]
and fire up container.
Even then the IPv4 is not assigned.
Did I miss any step in creating an image? Is not assigning IPv4 by design?
Thanks in advance for any help.
Ravi
PS: Just noticed there’s a thing called distrobuilder. I think that’s the way to go. But if you know answers to above, please post.
Hi Tom, like in Docker, I am trying to figure out how to create our own images with pre-built applications. Primary purpose is learning. Thanks.
Here’s lxc config show output
Thanks. I think issue is with my deb9 network conf and not lxd. The /etc/network/interface.d is empty, and /etc/network/interface too only includes interfaces.d directory. I’ll need to figure out how to add / configure eth0.
Thanks in advance again for any help.
Update: After /etc/network/interfaces was modified to include eth0, the container is now getting an IPv4.