I have bubuntux/nordvpn runnign and the --net=container:nordvpn on other containers.
but when i try to block all outgoing traffic in other ports than the vpn those get blocked.
the curl www.ifconfig.me shows a different ip address than my home address which shows in other dockers.
At this point im not sure if it goes through vpn or not.
How do i confirm this?
The dockers im currently passing through the vpn are jackett and transmission.
You pretty much already did what you had to do.
- Check IP with http://ifconfig.me/ip
- start VPN container and curl the address as well, check if the IPs match and if not the VPN works
- connect to all other containers and curl/wget the address as well and check if the IP matches the VPN IP but not your own
If the IPs of the VPN and linked containers are the same AND if they are different from your usual IP then I think you are good to go. If you want to check the torrent then you can google “torrent VPN test” or something like that which will let you add a torrent and shows you the IP address, again check if it matches and if it is the VPN address you should be good.
For anyone else still wondering how to do this:
I use NordVPN so I used the bubuntux/nordvpn container
for my transmission container i set “Network Type” to “None” and in the extra parameters tab I typed “–net=container:nordvpn”.
now the container does not get an IP address because it uses the local IP of the vpn container, the default ip for the unraid bridge is 172.17.0.XXX.
at this moment the nordvpn docker has IP 172.17.0.8, so for connecting to transmission which has port 9091 you use 172.17.0.8:9091.
this took me a while to figure out: the only way you can connect to transmission now is if you are on the same network as the vpn container.
So if all your dockers are on the default “bridge” you can find the vpn containers and all the connected containers.
but if you made a seperate vpn network you cannot connect to it.
this is speculation:
you could probably have a second vpn network with a second nginx container in it with the first nginx container just routing to the second one and that one routing to the right container behind vpn.
i will try this in the following few days
the torrent vpn test shows the same port as the curl result.
So it seems to work.
Thanks for the quick response.
Thanks for this. I’m using Nordvpn also and just started using Unraid. My next step is to setup VPN but I don’t know where to start. Is there a tutorial or video that you used?
that is the one i used, the ip address is right but the country it shows is off.
The vpn i setup goes to Switzerland but it said greece, a search for the ip shows that it is in Switzerland.
The docker wouldn’t run if it didn’t authenticate
there is nothing i could find that explains all this, only like 3 posts about connecting containers together with --net=container:{containerName}.
and there are a few videos about a vpn with docker.
but nothing on how to do them together which is why i spend a week before discovering that they(the container which is trying to access a container behind vpn)
need to be on the same network.
my modem doesnt allow having a vpn installed on it, i would have done that if it was possible (still dont know what options you have there).
but for now this solution seems to work
Sounds like it’s doing the intended job, but labels are off (?). Beyond the mismatch, is this technically risky? I’m genuinely asking in case I ever see this condition. Cheers
I went to the bubuntux/nordvpn GitHub and still don’t understand how to start the VPN. I tried running the commands to start it in the CLI on Unraid. Can you please tell me what you did?
Its just a gimmick that the test service has, showing the country that the ip belongs to.
Im not from greece btw, so it just uses a different service to check the location.
Or maybe nordvpn has any leverage over the ip addresses and switches them every so often?
The ip address is the correct ip that i got from nordvpn so its working as intended.
I was just saying that the label is off because i noticed it and wanted to explain to others who might not immediatly check the ip location themselfs.
They might think that their vpn setup is wrong (which went throught my mind at first).
I dont use any docker command, just the buttons unraid provides me.
You need to install the “Community applications” plugin.
Then you get an extra tab called “apps”, that is where i install all my containers.
There are lots of tutorials for this which are a lot better at explaining than i am, i followed spaceinvadeone’s video.
When you go to the apps tab you will only get apps with unraid templates, the nordvpn one doesnt have one so you wont find it at first.
To the bottom left is a settings category, there you need to set “Enable additional search results from dockerHub?” To yes.
Now when you go to the apps tab and search for “nordvpn” you can click “Click Here To Get More Results From DockerHub” to search dockerhub for the containers, this is where most of them are.
But when you do this they wont have the parameters like username and password when you try to install them, so you have to add them yourself.
Just look at the dockerhub page for the app you are trying to install.
This is what is says:
docker run -ti --cap-add=NET_ADMIN --device /dev/net/tun --name vpn \ -e [email protected] -e PASS=‘pas$word’ \ -e COUNTRY=country -e CATEGORY=category \ -e PROTOCOL=protocol -d bubuntux/nordvpn
-e is a variable, so when trying to install you have to add these by clicking " Add another Path, Port, Variable, Label or Device" and selecting that you want to add a variable, enter the correct key which in this case is USER for the first variable, and enter you username.
Once you have done this for every -e parameter you can run the container
Yes. I had the community apps and the docker. I was just confused where to insert the commands. “docker run -it…”
I did look at the page but I’m very new at docker containers and only understand a little. Where can I find the Country, category, and protocol parameters or do I just copy and paste the whole command and only change the username and password?
Those all have the -e tag in front of them so you should add a new variable with the key COUNTRY and the others with the -e tag in front of them
So in this case you would add 5 variables:
USER
PASS
COUNTRY
CATEGORY
PROTOCOL
The dockerhub page has info on what you need to add to them
These are my settings for torrents
USER=MYNORDVPNUSERNAME
PASS=MYNORDVPNPASSWORD
COUNTRY=Switzerland
CATEGORY=P2P
PROTOCOL=TCP
Sorry for formatting, im on mobile and dont know how to do it
Thanks. I’ll try it tomorrow.
Like this? I tried it and didn’t work. Not sure how to structure it.
Host key 1:
docker run -ti --cap-add=NET_ADMIN --device /dev/net/tun --name vpn
Key 2:
[email protected]
Key 3:
PASS='pas$word'
Key 4:
COUNTRY=United_States
Key 5:
CATEGORY=Standard VPN servers
Key 6:
PROTOCOL=UDP -d bubuntux/nordvpn
Hmm. Not sure what else I’m missing. No luck.