[lxc-users] LXD on EC2/AWS - containers not getting IP addresses?
Stéphane Graber
stgraber at ubuntu.com
Thu Mar 23 04:08:04 UTC 2017
On Thu, Mar 23, 2017 at 01:00:00PM +0900, Tomasz Chmielewski wrote:
> I've just launched a Ubuntu 16.04 instance on EC2.
>
> Unfortunately, LXD containers are not getting an IP address.
>
>
> # lxc launch ubuntu:16.04 website01
>
> # lxc list
> +-----------+---------+------+------+------------+-----------+
> | NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
> +-----------+---------+------+------+------------+-----------+
> | website01 | RUNNING | | | PERSISTENT | 0 |
> +-----------+---------+------+------+------------+-----------+
>
>
> # dpkg-reconfigure -p medium lxd
> (set IPv4 network)
>
>
> # reboot
>
>
> Still no IP address in the container:
>
> # lxc list
> +-----------+---------+------+------+------------+-----------+
> | NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
> +-----------+---------+------+------+------------+-----------+
> | website01 | RUNNING | | | PERSISTENT | 0 |
> +-----------+---------+------+------+------------+-----------+
>
>
>
> dhclient is running:
>
> root 1023 0.0 0.0 16124 864 ? Ss 03:50 0:00
> /sbin/dhclient -1 -v -pf /run/dhclient.eth0.pid -lf
> /var/lib/dhcp/dhclient.eth0.leases -I -df
> /var/lib/dhcp/dhclient6.eth0.leases eth0
>
>
> lxdbr0 is present:
>
> lxdbr0 Link encap:Ethernet HWaddr fe:3e:3b:09:3d:e4
> inet addr:10.76.6.1 Bcast:0.0.0.0 Mask:255.255.255.0
> inet6 addr: fe80::8091:8dff:fe30:bfb3/64 Scope:Link
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> RX packets:8 errors:0 dropped:0 overruns:0 frame:0
> TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:1000
> RX bytes:536 (536.0 B) TX bytes:570 (570.0 B)
>
>
> # brctl show
> bridge name bridge id STP enabled interfaces
> lxdbr0 8000.fe3e3b093de4 no vethHHJNCH
>
> # dpkg -l|grep lxd
> ii lxd 2.0.9-0ubuntu1~16.04.2
> amd64 Container hypervisor based on LXC - daemon
> ii lxd-client 2.0.9-0ubuntu1~16.04.2
> amd64 Container hypervisor based on LXC - client
>
>
> What step did I miss?
A somewhat common mistake which leads to the behavior you described is
when your chosen subnet doesn't match your chose DHCP range.
"ps aux | grep dnsmasq" on the host would confirm if that's the case.
--
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20170323/cf29be91/attachment.sig>
More information about the lxc-users
mailing list