IP Forwarding inside an LXC on 5.0 not working

FastLaneJB

Well-Known Member
Feb 3, 2012
89
6
48
Hi,

I have an LXC container running on 4.4 which establishes an OpenVPN and then IP Masq to effectively turn that into a router. This has additional lines in the config as follows:

Code:
lxc.cgroup.devices.allow: c 10:200 rwm
lxc.hook.autodev: sh -c "modprobe tun; cd ${LXC_ROOTFS_MOUNT}/dev; mkdir net; mknod net/tun c 10 200; chmod 0666 net/tun"

This works perfectly on 4.4. Firing this up on on 5.0 and the OpenVPN tunnel establishes on the tun interface, all is good there. However it's not working as a router but same container works on 4.4

Has something changed to stop this working and is there anything that can be done to make this work again as an LXC? Obviously could stick it in KVM if needed but just asking if it's fixable on LXC?
 
I also have this problem on a fresh install.
I have created a LXC with debian 9 and added the following two links in the config
Code:
lxc.mount.entry: / dev / net / dev / net / none bind, create = dir
lxc.cgroup.devices.allow: c 10: 200 rwm

After that I have ip_forward activated, openvpn installed, iptables configured
tun0 comes up, container has a connection into the tunnel
But other devices on the network can not use the LXC as a gateway.

On Proxmox 4.0 and ubuntu server, No problems with the configuration

PVE 5.1-36

EDIT: tried it several times, now I have created an unprivileged lxc and now it works
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!