[lxc-users] Lost use of tun device for openvpn

Mike Bernson mike at mlb.org
Mon Aug 8 01:16:48 UTC 2016


I upgrade my server from 14.04 to 16.04.1

After the upgrade I no longer have access to tun device which is causing

openvpn to not work.


which now means the following setup:

Host is 16.04.1

container running 14.04.5


create_dir is a script that just creates a bunch of directory


outside container net dir:

root at server:/var/lib/lxc/ltcd-prod/rootfs/dev/net# ls -l
total 1
crw-r--r-- 1 2500000 2500000 10, 200 Aug  7 21:03 tun

inside container:

root at ltcd-prod:/dev/net# ls -la
total 0
drwxr-xr-x 2 root root  40 Aug  7 21:04 .
drwxr-xr-x 7 root root 540 Aug  7 21:04 ..


config file for container:

# Template used to create this container: /usr/share/lxc/templates/lxc-ubuntu
# Parameters passed to the template: -r trusty -a amd64 -u mike
# For additional config options, please look at lxc.container.conf(5)

# Common configuration
lxc.include = /usr/share/lxc/config/ubuntu.common.conf

#autostart container
lxc.start.auto = 1
lxc.start.delay = 5
lxc.start.order = 33

# Container specific configuration
lxc.id_map = u 0 2500000 65536
lxc.id_map = g 0 2500000 65536
lxc.rootfs = /var/lib/lxc/ltcd-prod/rootfs
lxc.utsname = ltcd-prod
lxc.arch = amd64

# mount data for backup-pc
lxc.mount.entry = /lxc-data/ltcd-prod/var var none bind.ro 0.0
lxc.mount.entry = tmpfs var/log/ tmpfs defaults,noatime,mode=775,gid=105,size=100M 0 0
lxc.mount.entry = tmpfs tmp tmpfs defaults,noatime,mode=1777,size=1000M 0 0
lxc.mount.entry = tmpfs var/lib/puppet/state tmpfs defaults,noatime,mode=750,uid=101,gid=108,size=10M 0 0
lxc.mount.entry = tmpfs var/lib/puppet/client_data tmpfs defaults,noatime,mode=750,uid=0,gid=0,size=10M 0 0
lxc.mount.entry = tmpfs var/lib/logrotate tmpfs defaults,noatime,mode=755,uid=0,gid=0,size=10M 0 0

# Network configuration
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br0
lxc.network.hwaddr = 00:16:3e:cd:cb:5c
**lxc.network.ipv4 = 192.168.1.156/24 192.168.1.255**
**lxc.network.ipv4.gateway = 192.168.1.254**
# tun device
lxc.cgroup.devices.allow = c 10:200 rwm

lxc.hook.start = /root/create_dir



More information about the lxc-users mailing list