How can I route traffic from specific containers through my VPN on a home router?

0
0
Asked By TechieNerd42 On

I'm planning to switch from a Windows VM to using containers for my applications. Right now, I have a Windows VM with two virtual NICs managed under IPs 192.168.1.250 and 192.168.251. My home router (192.168.1.1) is set up to route traffic from 192.168.1.251 through a dedicated VPN interface. I'm unclear on how to configure my Ubiquiti Gateway Max to route traffic from the containers since they are given private IPs that use NAT. Is there a way to assign a specific IP, like 192.168.1.251, to a container to achieve the same routing as my VM setup?

2 Answers

Answered By VPNMaster77 On

I've been using gluetun, and it's been great for routing container traffic through a VPN. If you're looking for a user-friendly solution, you might want to check it out! It handles the VPN connection and simplifies the setup for you.

Answered By DockerHeaven On

Using Docker Compose along with MACVLAN or IPVLAN can make managing your network settings much easier. By defining them in a configuration file, you can assign fixed IPs directly from your home network to each container, making routing through your VPN a breeze.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.