How to Setup TUN Mode in Proxmox LXC

A quick guide to enabling TUN in Proxmox LXC containers. Applicable for both Unprivileged and Privileged containers!

SK
Stefan Khor

What is TUN?

TUN (Network Tunnel) is virtual network kernel devices which will simulate a network layer device.

When to Enable TUN?

Enable TUN if you:

  • Plan to run VPN services/servers/clients (OpenVPN, WireGuard, etc.) inside containers
  • Use applications that require low-level network tunneling
  • Need more advanced networking setups inside a container

⚡ Without TUN, most VPN services won't work inside an LXC container!

How to Enable TUN in Proxmox LXC?

Enabling TUN for Proxmox LXC can be easily done by following these steps:

  1. Login to your Proxmox host (via SSH or the built-in Shell in the WebUI)
  2. Edit your LXC container configuration:
    bash
    nano /etc/pve/lxc/<CTID>.conf
    
  3. Add these lines into your LXC config:
    bash
    lxc.cgroup2.devices.allow: c 10:200 rwm
    lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file
    
  4. Restart LXC container:
    bash
    pct restart <CTID>
    
  5. Finally, you may verify TUN is available inside the LXC container:
    bash
    cat /dev/net/tun
    
© 2025Stefan KhorAll rights reserved.