I use Laradock for my project, which attacks an external MySql server. Recently, this server had been protected by Fortinet IPsec VPN. I work with Ubuntu 20.04, so I installed strongSwan as explained in this article.
After doing sudo ipsec up MYSERVER
, I can access from console to the MySql server.
However, from docker I get:
SQLSTATE[HY000] [2002] No route to host
Following this answer, I tried to add to my docker-compose.yml the following entry:
extra_hosts:
- "VPN_IP:192.168.150.74"
But I still get the same error; docker cannot connect to DB server.
(instead of VPN_IP
I put the explicit IP, 192.168.150.74 is my local IP which is related to the VPN).
Any idea how to solve it?