[lxc-users] LXD network access on wifi-only host witout bridge adapter

Jeff Kowalczyk jeff.kowalczyk at gmail.com
Sat Oct 8 05:25:37 UTC 2016


On Fri, Oct 7, 2016 at 4:05 PM, Stéphane Graber <stgraber at ubuntu.com> wrote:
>
> > Does LXD 2.4.1 provide/use an internal DHCP server and NAT proxy, or
> > is dnsmasq or similar required to be configured and running on the
> > host? I'm accustomed to qemu-kvm and its internal DHCP/NAT. Is LXD
> > doing something similar?
>
> LXD managed bridges come with dnsmasq as a DNS and DHCP(v6) server. LXD
> also configures ebtables and iptables as required and toggles any needed
> sysctls.
>
> In most cases, all you need is:
>
>   lxc network create blah
>   lxc network attach-profile blah default eth0
>
> Which will create a bridged called blah with IPv4 and IPv6 connectivity
> and then add it to the default profile.
>
> You can set static leases for IPv4 and IPv6 by setting ipv4.address or
> ipv6.address on the network device entry.
>
> We don't do port forwarding directly in LXD, so you'll still need to do
> that by hand.

Thanks, this clears things up. I really like the way the new
networking functions work. Many thanks to the LXD and LXC teams.

To make sure I'm understanding correctly: network attach-profile blah
eth0 can work even when eth0 is inactive with no IP address?

I encounter an error on network create, am I missing certain IPV6 or
NF related kernel (4.8.0) config options? I've previously added config
items when lxc requests them.
% lxc network list
NAME, TYPE, MANAGED, USED BY
eth0, physical, NO, 0
wlan0, physical, NO, 0

% lxc network create network0
error: Failed to list ipv6 rules for network0 (table nat)

% lxc network attach-profile network0 default eth0
% lxc network list
NAME, TYPE, MANAGED, USED BY
eth0, physical, NO, 0
network0, bridge, YES, 0
wlan0, physical, NO, 0

% lxc launch ubuntu-daily:16.04 ubuntu-dev
Creating ubuntu-dev
Retrieving image: 100%
Starting ubuntu-dev
error: Missing parent 'network0' for nic 'eth0'
Try `lxc info --show-log local:ubuntu-dev` for more info

% lxc info --show-log local:ubuntu-dev
Name: ubuntu-dev
Remote: unix:/var/lib/lxd/unix.socket
Architecture: x86_64
Created: 2016/10/08 04:55 UTC
Status: Stopped
Type: persistent
Profiles: default

Log:

lxc 20161007215531.030 INFO  lxc_confile - confile.c:config_idmap:1500
- read uid map: type u nsid 0 hostid 1000000 range 65536

lxc 20161007215531.030 INFO  lxc_confile - confile.c:config_idmap:1500
- read uid map: type g nsid 0 hostid 1000000 range 65536

lxc 20161007215531.047 WARN  lxc_cgmanager -
cgroups/cgmanager.c:cgm_get:989 - do_cgm_get exited with error

(... same)

Network shows as in use. Is this by stopped container or network attach-profile?

% lxc network list
NAME, TYPE, MANAGED, USED BY
eth0, physical, NO, 0
network0, bridge, YES, 0
wlan0, physical, NO, 0

% lxc delete ubuntu-dev

Container without network starts OK:

% lxc network detach-profile network0 default eth0

% lxc network delete network0
Network network0 deleted

% lxc launch ubuntu-daily:16.04 ubuntu-dev
Creating ubuntu-dev
The container you are starting doesn’t have any network attached to it.
  To create a new network, use: lxc network create
  To assign a network to a container, use: lxc network assign
Starting ubuntu-dev


More information about the lxc-users mailing list