Docker for Mac and VPN can't connect inside container - macos

I am running into a block and can't seem to find the answer. I have Docker for Mac on OSX. I can build and run the containers fine. One of my containers runs a sails app that utilizes sequelize to connect to a SQL database. The database is behind the corporate VPN. I am connected to the VPN through openconnect. Outside of the container (on the host), I can run the application just fine and it connects. Inside of the container, I cannot access the VPN and get a bad connection error. I have tried restarting Docker after the VPN is connected but still cannot connect. I don't see any settings in the GUI for VPN or network handling, other than proxies. I have tried with --network="bridge" and --network="host"
This is similar to this post
Any help is greatly appreciated!

the problem is the VPN, because maybe in the vpn it's enabled only determinate IP, you need to nat all request from docker with your private ip of your vpn, try to install the vpn on virtualbox.

Related

WSL2 - Docker without Docker Desktop - cloud_sql_proxy does not work with VPN

So far I have worked/developed with Windows 10, Docker Desktop and WSL2. Now I had to remove Docker Desktop for licensing reasons and decided to run Docker natively in my WSL2 distro. This also works flawlessly. I can access my Docker applications in WSL from Windows.
For the data connections I use the cloud_sql_proxy from Google.
Again, no problems here. However, they occur as soon as I turn on the VPN. Then I can't connect to the database anymore. Everything else works!
The following:
VPN turned off. Connect to the DB via the cloud_sql container. Everything Okay
turn on VPN. DB connection remains established, but breaks down as soon as a reconnect is necessary.
VPN switched on. LOG in container: net/http: TLS handshake timeout
Using
gcr.io/cloudsql-docker/gce-proxy:1.31.2
Windows 10
Ubuntu-20.04
VPN L2TP (Windows nativ)
Using the cloud_sql_proxy service instead of the Docker container works. Can anyone help me with this? Why does it not work with the Docker container?

How can I make sshuttle working on a dedicated IP of other VPN service?

This is the first time I use the sshuttle.
I am running into an issue working with sshuttle.
I run the sshuttle to connect my local with a remote server on my local machine.
I can access the server by using ssh and pem file.
I used the following command on my MacOS.
sshuttle --dns -vr dev 10.0.0.0/0 --ssh-cmd 'ssh -i ~/.ssh/dev.pem'
I have set ssh config to use the dev hostname in .ssh/config file
host dev
HostName xx.xxx.xx.xx
user root
IdentityFile ~/.ssh/dev
But I couldn't connect my local to the remote server, even all the internet traffic keeps loading and never loads anything.
I am using a dedicated IP on VPN service (PureVPN). Wihtout VPN, sshuttle is working well so meaning that running sshuttle on top of other VPN service is a problem?
I don't think it's a problem since it's a dedicated IP. And if it's a problem, how can I address this issue since I must use the dedicated IP for an another service.
If you have faced the same issue before, please let me know.
Thank you in advance!
From the looks of what you mentioned there could be two things that can be the cause. One, the credentials that are given to you by the third party hosting are incorrect. But since you mentioned that you are able to access the sshuttle without a VPN, this clearly indicates that you need to get your dedicated IP approved from the hosting service if it's not marked spam. If you are looking for a dedicated IP VPN service provider try Ivacy.

How to get WSL2 to route traffic through ProxyCap ssh tunnel

I'm trying to get WSL2 to use the tunnel present in my windows environment but I'm struggling with getting it to work properly.
In order to access our company servers I've set up ProxyCap to open a ssh connection to a proxy server. The only thing I did was point it to our jump server and then set up the following rule.
Now this works flawlessly in Windows and I'm able to ping a machine inside our company network by doing a simple ping x.x.x.x:pppp. However once I start my WSL2 environment and try pinging the same ip and port the only thing I get back is ping: ping x.x.x.x:pppp: Name or service not known.
My initial guess is that this is due to the network in WSL2 being different from the network in Windows. Is there any way to make WSL2 utilize the proxy tunnel running in my Windows environment?
I've also tried running sshuttle inside WSL2 to see if I could access the server that way and not have to go through Windows (I'm using the same command I use on my Linux machine where it works) but I get the same problem this way.

Connect to remote Docker Swarm from Windows

I would like to connect to a remote Docker Swarm (Ubuntu) from a Windows box.
In Linux it seams that you need to update the daemon.json file.
How do you achieve this in Windows?
Thanks!
The Docker engine has two parts, the daemon service (dockerd) that's running on your Ubuntu box, we'll call it the "server". Then the docker cli is what you can run from that server (docker) or from anything like your Windows machine (docker.exe). We'll call this the "client".
The client can talk to the server over two main ways, the socket, and a TCP port. The socket is usually reserved for local connections (SSH into the server and the docker client defaults to using the socket file to talk to the local server) or SSH tunnels, which are not something that works out of the box on Windows (maybe if you try the Windows Subsystem for Linux on Windows 10).
The other connection option is TCP, which isn't enabled on the server out of the box for security reasons. It has no authentication when enabled, so you'll want to use TLS to authenticate remotely, so Docker has steps for that. It's not a 3 min solution, so many look for an easier route to solve this problem.
The easier option for enabling TLS and the TCP port on the server is to use Docker Cloud with the "Bring Your Own Swarm" feature, which manages the certificates and security for you.

Windows services with network access

I have a small server app, which receives UDP data on port X. When I run this app with a local logged in user account, all is fine and my app receives commands via UDP. But when I'm installing the app as a windows service which runs under same local user account, I'm not longer receiving data, when I try to connect from a different machine. Local connections are fine. I've also opened my UDP port X in the windows firewall settings, but with no luck.
Any help is appreciated.
Only for the sake of completeness:
It has been found that it has something to do with the virtual machine in which the Windows runs. I use a network bridge to connect it to my local network. After adding a host-only network adapter, my windows service received all expected commands. No idea why!?

Resources