[lxc-users] LXD IPV6 DHCP

Serge Hallyn serge.hallyn at ubuntu.com
Mon Dec 21 17:40:35 UTC 2015


does it work if you use lxcbr0?

Quoting Van Dorsey (vandorsey at client1st.com):
> Serge,
> Here are the steps I took. Other than apt-get update after fresh install.
> 
> Van
> 
> 
> -----
> 
> MY HOST:
> 
> vdorsey at ubulxd1:~$ lsb_release -r
> Release:        15.10
> vdorsey at ubulxd1:~$
> 
> vdorsey at ubulxd1:/etc/network$ more interfaces
> # This file describes the network interfaces available on your system
> # and how to activate them. For more information, see interfaces(5).
> 
> source /etc/network/interfaces.d/*
> 
> # The loopback network interface
> auto lo
> iface lo inet loopback
> 
> # The primary network interface
> auto br0
> iface br0 inet static
>         address 192.168.80.200
>         netmask 255.255.255.0
>         gateway 192.168.80.1
>         dns-nameservers ipv4masked
>         bridge-ifaces enp3s0
>         bridge-ports enp3s0
>         bridge_stp off
>         bridge_fd 0
>         up ifconfig enp3s0 up
> 
> iface br0 inet6 static
>         address ipv6staticmasked
>         netmask 64
>         gateway ipv6staticmasked
>         dns-nameservers ipv6staticmasked
>         bridge-ifaces enp3s0
>         bridge-ports enp3s0
>         bridge_stp off
>         brdge_fd 0
>         up ifconfig enp3s0 up
> 
> vdorsey at ubulxd1:/etc/network$ ifconfig
> br0       Link encap:Ethernet  HWaddr 90:b1:1c:73:f0:15
>           inet addr:192.168.80.200  Bcast:192.168.80.255 Mask:255.255.255.0
>           inet6 addr: fe80::92b1:1cff:fe73:f015/64 Scope:Link
>           inet6 addr: ipv6staticmasked Scope:Global
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:222892 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:24141 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:0
>           RX bytes:69061158 (69.0 MB)  TX bytes:2959302 (2.9 MB)
> 
> enp3s0    Link encap:Ethernet  HWaddr 90:b1:1c:73:f0:15
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:259181 errors:0 dropped:1 overruns:0 frame:0
>           TX packets:65275 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:78614269 (78.6 MB)  TX bytes:7516221 (7.5 MB)
> 
> lo        Link encap:Local Loopback
>           inet addr:127.0.0.1  Mask:255.0.0.0
>           inet6 addr: ::1/128 Scope:Host
>           UP LOOPBACK RUNNING  MTU:65536  Metric:1
>           RX packets:160 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:160 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:0
>           RX bytes:11840 (11.8 KB)  TX bytes:11840 (11.8 KB)
> 
> vethU3PM55 Link encap:Ethernet  HWaddr fe:54:c0:3a:8f:3d
>           inet6 addr: fe80::fc54:c0ff:fe3a:8f3d/64 Scope:Link
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:10 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:51 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:1372 (1.3 KB)  TX bytes:6800 (6.8 KB)
> 
> 
> 
> LXD IMAGE:
> 
> vdorsey at ubulxd1:~$ lxc profile show default
> name: default
> config: {}
> devices:
>   eth0:
>     nictype: bridged
>     parent: br0
>     type: nic
> 
> vdorsey at ubulxd1:~$ lxc profile list
> default
> migratable
> 
> vdorsey at ubulxd1:/etc/network$ lxc image list
> +-------+--------------+--------+----------------------+--------+---------+------------------------------+
> | ALIAS | FINGERPRINT  | PUBLIC |     DESCRIPTION      |  ARCH  |
> SIZE   |         UPLOAD DATE          |
> +-------+--------------+--------+----------------------+--------+---------+------------------------------+
> | ubu   | e7ef8497c6a1 | no     | Ubuntu wily (amd64)  | x86_64 |
> 73.34MB | Nov 18, 2015 at 7:06am (CST) |
> | ubviv | 9a78b6299ff4 | no     | Ubuntu vivid (amd64) | x86_64 |
> 65.26MB | Nov 18, 2015 at 4:17pm (CST) |
> +-------+--------------+--------+----------------------+--------+---------+------------------------------+
> vdorsey at ubulxd1:/etc/network$
> 
> 
> vdorsey at ubulxd1:/etc/network$ lxc list
> +--------+---------+---------------+------+-----------+-----------+
> |  NAME  |  STATE  |     IPV4      | IPV6 | EPHEMERAL | SNAPSHOTS |
> +--------+---------+---------------+------+-----------+-----------+
> | ub1    | RUNNING | 192.168.80.13 |      | NO        | 0         |
> | ubuviv | STOPPED |               |      | NO        | 0         |
> +--------+---------+---------------+------+-----------+-----------+
> vdorsey at ubulxd1:/etc/network$
> 
> 
> vdorsey at ubulxd1:~$
> vdorsey at ubulxd1:~$ lxc start ub1
> vdorsey at ubulxd1:~$ lxc exec ub1 /bin/bash
> root at ub1:~# cd /etc/network
> root at ub1:/etc/network# more interfaces
> # This file describes the network interfaces available on your system
> # and how to activate them. For more information, see interfaces(5).
> 
> # The loopback network interface
> auto lo
> iface lo inet loopback
> 
> auto eth0
> iface eth0 inet dhcp
> iface eth0 inet6 dhcp
> iface eth0 inet6 auto
> 
> 
> root at ub1:/etc/network# ifconfig
> eth0      Link encap:Ethernet  HWaddr 00:16:3e:34:3d:52
>           inet addr:192.168.80.13  Bcast:192.168.80.255 Mask:255.255.255.0
>           inet6 addr: fe80::216:3eff:fe34:3d52/64 Scope:Link
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:15 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:2418 (2.4 KB)  TX bytes:1192 (1.1 KB)
> 
> lo        Link encap:Local Loopback
>           inet addr:127.0.0.1  Mask:255.0.0.0
>           inet6 addr: ::1/128 Scope:Host
>           UP LOOPBACK RUNNING  MTU:65536  Metric:1
>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:0
>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
> 
> 
> root at ub1:/etc/network# ifup eth0
> Internet Systems Consortium DHCP Client 4.3.1
> Copyright 2004-2014 Internet Systems Consortium.
> All rights reserved.
> For info, please visit https://www.isc.org/software/dhcp/
> 
> Listening on LPF/eth0/00:16:3e:34:3d:52
> Sending on   LPF/eth0/00:16:3e:34:3d:52
> Sending on   Socket/fallback
> DHCPREQUEST of 192.168.80.13 on eth0 to 255.255.255.255 port 67
> (xid=0x5a0d3b03)
> DHCPACK of 192.168.80.13 from 192.168.80.1
> RTNETLINK answers: File exists
> bound to 192.168.80.13 -- renewal in 264337 seconds.
> 
> 
> root at ub1:/etc/network# ifconfig
> eth0      Link encap:Ethernet  HWaddr 00:16:3e:34:3d:52
>           inet addr:192.168.80.13  Bcast:192.168.80.255 Mask:255.255.255.0
>           inet6 addr: ipv6dhcpmasked Scope:Global
>           inet6 addr: fe80::216:3eff:fe34:3d52/64 Scope:Link
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:27 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:4162 (4.1 KB)  TX bytes:2150 (2.1 KB)
> 
> lo        Link encap:Local Loopback
>           inet addr:127.0.0.1  Mask:255.0.0.0
>           inet6 addr: ::1/128 Scope:Host
>           UP LOOPBACK RUNNING  MTU:65536  Metric:1
>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:0
>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
> 
> root at ub1:/etc/network#
> 
> root at ub1:/etc/network# exit
> exit
> 
> 
> vdorsey at ubulxd1:~$ lxc list
> +--------+---------+---------------+----------------------+-----------+-----------+
> |  NAME  |  STATE  |     IPV4      |         IPV6         |
> EPHEMERAL | SNAPSHOTS |
> +--------+---------+---------------+----------------------+-----------+-----------+
> | ub1    | RUNNING | 192.168.80.13 | ipv6dhcpmasked       | NO
> | 0         |
> | ubuviv | STOPPED |               |                      | NO
> | 0         |
> +--------+---------+---------------+----------------------+-----------+-----------+
> vdorsey at ubulxd1:~$
> 
> 
> On 12/8/2015 10:26 AM, Serge Hallyn wrote:
> >Quoting Van Dorsey (vandorsey at client1st.com):
> >>My problem may be Ubuntu server related as I have not had time to
> >>try another O/S image yet.
> >>
> >>I had this environment working while using 15.04 and followed
> >>various setups blogs. I burned that all down and started over with
> >>15.10.
> >>
> >>Bridging seems to be working fine, I can launch Ubuntu 15.10 images
> >>with static ipv6 addresses and they work just fine.
> >>
> >>When I try to enable IPV6 DHCP in the interfaces file and reboot,
> >Hi,
> >
> >can you show exactly what you did?
> >
> >>ifconfig shows no IPV6 address from the pool. Using stateful DHCPv6.
> >>
> >>I can run a simple ifup eth0 and get a working address from the pool
> >>right away.
> >>
> >>I tried the same Ubuntu version under Virtualbox and VMware
> >>Workstation, the same interfaces setup works fine after reboot.
> >>
> >>Could this be a timing thing? Reboot is so fast it is not waiting
> >>for an address.
> >>
> >>I acknowledge this could be an O/S problem and not a LXD/LXC issue
> >>but I thought I would ask if anyone here has had the same issue.
> >>
> >>Thanks in advance,
> >>Van
> >>
> >>_______________________________________________
> >>lxc-users mailing list
> >>lxc-users at lists.linuxcontainers.org
> >>http://lists.linuxcontainers.org/listinfo/lxc-users
> >_______________________________________________
> >lxc-users mailing list
> >lxc-users at lists.linuxcontainers.org
> >http://lists.linuxcontainers.org/listinfo/lxc-users
> 
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users


More information about the lxc-users mailing list