Ver 6.7.2 - VPN Via Vm for dockers


almulder

Recommended Posts

So I am new to unraid, running the trial version right now, before I pull the trigger and make the switch.

 

So I followed a guide on how to setup a vm as a VPN server and it works if I point any PC to that address, but how can I make particular dockers use the VPN and other not to use them. I have traffic I want secure from my house to my off site backup at my brothers house, (And my ISP throttles VPNs now) so I want all my other dockers to not use the vpn so I get full speeds.

 

How can I create a new network pointing to the VPN and make the dockers use it.

 

I have tried going in under Network Settings and creat a new route, thinking it would appear under the docker setting, but no luck.

 

My vpn server is at address 10.1.10.233, so how can I make the docker use that as the gateway instead of my router default of 10.1.10.1?

 

Thanks for your help.

Link to comment

The easiest approach will be to have a second ethernet interface (eth1/br1) on your server, which connects to the same switch as your eth0/br0 interface.

Under network settings configure this interface as bonding=no, bridging=yes and IP=none

Under docker settings assign the same subnet as used for the eth0 interface, and specify as gateway your VPN server.

Any docker containers you want to router thru your VPN server, make sure they use the custom network br1.

 

  • Like 1
Link to comment

SO I added another network, and have it hooked to router. I setup the network settings and the docker, but the containers dont show that new network as an option in the drop down. My options are - Bridge, Host, None, Custom br0

 

br0 is my main one, my new added one shows as br1, its just not in the list to select from.

 

Thoughts?

 

Link to comment

I am a little confused...

 

When no IP assignments are set for interface br1 under docker settings, then this network is not available in Docker.

You should have something like this:

 

subnet = 10.1.10.0 /24

gateway = 10.1.10.233

dhcp pool = 10.1.10.128 /25 (this assumes the IP range .128 to .254 is not used by your router for DHCP assignments)

Link to comment

OK, I am now at a complete loss, nothing seems to be working correctly, I have even wiped everything and started over. Can someone help me out.

 

I am running a test environment so messing it up right now is not an issue.

 

My goal is to setup a vpn server so only particular containers use the VPN while the others bypass it. I followed a youtube video on how to set up a vpn using ubuntu server via vm, and I did get that working, but it seems like I need another nic to get the docker containers to work, so I added one, that's when everything broke. vpc no longer worked, ip addresses were all messed up and could no longer connect to the vpn server.

 

I figure to start from scratch and see if I could get the vpn setup again, but I cant get it to assign it an ip address from my router. (10.1.10.1) it keeps giving me a (192.168.1.xxx) address, so I cant access it from my network.

 

Sorry I have always been a windows guy and been using a qnap for years, but have out grown it.

 

how should I setup my first nic and vm so the vm gets ip address from router, then once I get my vm setup how do I configure my second nic to point it at my vm for the vpn service, and then how do I setup docker contains so some use the nic0 and other use nic1 all while getting ip from router so they are all on the same network. (Also plan on installing pi-hole later)

 

forgot to mention ip setup:

router 10.1.10.1

unraid 10.1.10.103

vm(vpn) will be 10.1.10.233 once I get it set to a fixed ip

 

Also I am open to ideas. in the end I just need a vpn server that particular dockers access while others don't.

nic0.PNG

nic1.PNG

vm.PNG

Docker.PNG

Edited by almulder
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.