- Minor
I posted a thread about it in General Support a few days ago, but didn't get any replies. Since then, I've collected some more info, and discovered specific ways to reproduce the problem. So, here's what's going on:
- I have a tunnel set up in VPN Manager that's of type "VPN tunneled access for docker", and it's called wg0
- It's the only VPN tunnel set up in Unraid. No others exist either in VPN Manager, or in any Docker containers
- I have several containers set up specifically to use that tunnel, so they're set up to to use a custom network wg0
- I also have other containers that I don't want to be routed through that tunnel. Some of them are set up to use the Bridge network, and others are set up to use the Host network
- My expectation (and please correct me if I'm wrong) is that only the containers set up to use the wg0 network would actually use that VPN tunnel. If I check my public IP address from the console of any of those containers, I expect to see the VPN tunnel's public IP
- The rest of the containers should be using the local network, and if I check the public IP from the console, I expect to see my local network's public IP
-
I'm using the following command to check the public IP from the container consoles:
curl https://ipinfo.io/ip
And here's where the weird behavior comes in. If I manually enable the wg0 tunnel from Settings --> VPN Manager, everything works exactly as expected. I can toggle the tunnel on and off while the containers are running, or I can stop and restart any of the containers, and nothing gets screwed up. However, under the following conditions, all docker containers (regardless of which network they're set up to use) start reporting the wg0 tunnel's public IP address:
- If I activate the tunnel from the main dashboard
-
If I activate it manually from the terminal using
wg-quick up wg0
- if I set up Autostart for the tunnel, and reboot the server
- It doesn't matter if the containers are running, or if they are stopped and get re-started
- As soon as the tunnel is activated, all containers start reporting the tunnel's public IP
- As soon as the tunnel is deactivated, the containers that are set up to use wg0 as the custom network completely lose internet access (as expected), but everything that was set up for Bridge or Host networks revert back to reporting the correct local Public IP
- No matter how many times I tried toggling the tunnel on and off, this behavior continues
- The only time it starts acting normally (as expected) is if I activate the runnel from the VPN Manager UI page
Also, just for testing purposes, I changed the network in one of my containers that's set up to use the Host network to use br0 instead. Since I use macvlan for Docker, that container lost its connection to the host (and I was obviously unable to access its WebUI), but I was still able to open the console and check the public IP. This container was not affected by any of the shenanigans described above. It worked just as expected in all circumstances