You are not logged in.

#1 2017-12-03 21:11:09

CountZukula
Member
Registered: 2017-11-04
Posts: 48

LXD managed containers not getting ipv4 addresses

Hi all,

I am currently trying out LXD under Arch (using arch on both host + client). The image i am using, and the command I'm using to launch the container is the following:

lxc launch images:archlinux/current/amd64 testcontainer

The problem is that testcontainer does not get an ipv4 address, only an ipv6 one. I have followed the guide on the wiki for LXD and I have tried adjusting configuration files here and there, but nothing seems to have an effect on the DHCP behavior of LXD (the example configuration by @jpic listed at https://wiki.archlinux.org/index.php/LXD#LXD_Networking does not work for me, for example). As most configuration information is related to Ubuntu installations it is sometimes difficult to see how it can be applied to Arch, at least to me.

The host is a fresh virtualbox Arch installation. I have installed LXD through the aur repository (LXD version 2.20). lxc seems to 'see' the network fine, but it's not actually doing anything with it:

[user@vmhost /]$ lxc network list
+--------+----------+---------+-------------+---------+
|  NAME  |   TYPE   | MANAGED | DESCRIPTION | USED BY |
+--------+----------+---------+-------------+---------+
| enp0s3 | physical | NO      |             | 0       |
+--------+----------+---------+-------------+---------+
| lxcbr0 | bridge   | NO      |             | 0       |
+--------+----------+---------+-------------+---------+
| lxdbr0 | bridge   | YES     |             | 1       |
+--------+----------+---------+-------------+---------+
[user@vmhost /]$ lxc network show lxdbr0
config:
  dns.mode: dynamic
  ipv4.address: 10.45.224.1/24
  ipv4.nat: "true"
  ipv6.address: fd42:4c81:1f9c:71a5::1/64
  ipv6.nat: "true"
description: ""
name: lxdbr0
type: bridge
used_by:
- /1.0/containers/testcontainer
managed: true

The container itself gets a valid and usable ipv6 address, but not an ipv4 address:

[user@vmhost ~]$ lxc exec testcontainer bash
[root@testcontainer ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
7: eth0@if8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 00:16:3e:d5:46:1b brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet6 fd42:4c81:1f9c:71a5:216:3eff:fed5:461b/64 scope global dynamic mngtmpaddr 
       valid_lft 3598sec preferred_lft 3598sec
    inet6 fe80::216:3eff:fed5:461b/64 scope link 
       valid_lft forever preferred_lft forever

Can anyone put me on the right track?

Last edited by CountZukula (2017-12-03 21:16:25)

Offline

#2 2017-12-04 06:59:28

CountZukula
Member
Registered: 2017-11-04
Posts: 48

Re: LXD managed containers not getting ipv4 addresses

I'm not sure whether this warrants a reply instead of an update, but I should have tested this before: the ubuntu:16.04 image does get an ipv4 address. So it's probably due to the container's/image's configuration?

Offline

Board footer

Powered by FluxBB