[lxc-users] LXD - I cannot change the IPv6 address (from outside the container)
Peter Gloor
pgloor at gmail.com
Wed Apr 19 14:30:42 UTC 2017
On a Ubuntu Xenial host I'm running LXD 2.12 from the xenial-backports.
I configured lxd with an lxdbr0 bridge with IPv4 and IPv6.
The config looks like this:
ipv4.address: 10.122.45.1/24
ipv4.nat: "true"
ipv6.address: fd42:7146:f400:1::1/64
ipv6.nat: "true"
After I launched a container with Xenial (contxenial) its ifconfig for eth0
looked something like this:
peter at led:~$ lxc exec contxenial -- ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:16:3e:bc:f5:8d
inet addr:10.122.45.223 Bcast:10.122.45.255 Mask:255.255.255.0
inet6 addr: fd42:7146:f400:1:216:3eff:febc:f58d/64 Scope:Global
inet6 addr: fe80::216:3eff:febc:f58d/64 Scope:Link
:
Now I wanted to change both, its ipv4 AND its ipv6 address to static ip
adresses using the following commands:
peter at led:~$ lxc network attach lxdbr0 contxenial eth0
peter at led:~$ lxc config device set contxenial eth0 ipv4.address 10.122.45.71
peter at led:~$ lxc config device set contxenial eth0 ipv6.address
fd42:7146:f400:1::71
Finally I restarted my container.
peter at led:~$ lxc restart contxenial
To my surprise the IPv4 address changed as expected, but the IPv6 address
did not!
peter at led:~$ lxc exec contxenial -- ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:16:3e:bc:f5:8d
inet addr:10.122.45.71 Bcast:10.122.45.255 Mask:255.255.255.0
inet6 addr: fd42:7146:f400:1:216:3eff:febc:f58d/64 Scope:Global
inet6 addr: fe80::216:3eff:febc:f58d/64 Scope:Link
:
However, dnsmasq.hosts contains both, the changed IPv4 address as well as
the changed IPv6 address.
peter at led:~$ sudo cat /var/lib/lxd/networks/lxdbr0/dnsmasq.hosts
00:16:3e:bc:f5:8d,id:*,10.122.45.71,[fd42:7146:f400:1::71],contxenial
What did I wrong? I tried several options, but nothing worked, therefore
any hints are welcome.
Or is it a bug that should be reported? In case it is, is there a possible
workaround?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20170419/eac9fda9/attachment.html>
More information about the lxc-users
mailing list