All traffic through a VPN in LXC

Jabbabi

Member
Mar 18, 2020
6
0
6
36
Hello there, I'm a total beginner in network !

I'm running PVE, creating LXC or VMs without any trouble. I'm stuck on one thing I would like to achieve :

How to restrict all traffic of one of my LXC with a commercial VPN ? Other said, How to make all the external traffic through a VPN (like NordVPN, cyberghost etc.)
I can't figure what I need to do, create a gateway container with openVPN ?

I'm on a unifi network, should I handle it at the router level ?

Thank you :)
 
Last edited:
What I did is I went into the unifi settings and set up a VPN client using wireguard. And then I used the traffic rules to route all traffic from the LXC's that need the VPN through the VPN.

I'm not certain that this is ideal though, at least for my use case (you don't say you are torrenting). When I ran IP leak tests it seemed as though everything was going through the VPN properly, but by doing it this way I don't believe you are able to bind your torrent client to the VPN so it's possible your IP/ DNS might leak. I'm fairly new to this whole VPN thing so I'm not sure the best way to do it myself.

Hopefully this was able to help out a little and hopefully someone else a little bit more knowledge can come along and answer this question for both of us.
 
Hey ! I'm totally torrenting :D
I know that with qBitorrent, I can bind the torrent to only run through one specific network interface. It could be something useful for our use case ?

The goal is, as you guess, to prevent any leaking :)
 
What I did is I went into the unifi settings and set up a VPN client using wireguard. And then I used the traffic rules to route all traffic from the LXC's that need the VPN through the VPN.

I'm not certain that this is ideal though, at least for my use case (you don't say you are torrenting). When I ran IP leak tests it seemed as though everything was going through the VPN properly, but by doing it this way I don't believe you are able to bind your torrent client to the VPN so it's possible your IP/ DNS might leak. I'm fairly new to this whole VPN thing so I'm not sure the best way to do it myself.

Hopefully this was able to help out a little and hopefully someone else a little bit more knowledge can come along and answer this question for both of us.
I finally did it that way :

Setup a VPN client in my unifi UDM pro.
Added a traffic route VPN/container
Added a firewall rule to drop internet on my specific container IP.

That way, I have no leaks, if the VPN is down, the firewall rule block it all.
 
Can you tell me what Unifi controller do you use and what speeds do you achive? Reading into Dreamrouter and the new UniFi Express, it looks like the Unifi stuff can handle only speeds up to max 50 Mbit/s, which is super slow for such a usecase I guess.
 
Can you tell me what Unifi controller do you use and what speeds do you achive? Reading into Dreamrouter and the new UniFi Express, it looks like the Unifi stuff can handle only speeds up to max 50 Mbit/s, which is super slow for such a usecase I guess.
Hey ! I have an UDM pro. I have no bottleneck so far...
 

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!