VPN, Docker, and a cold coffee
dev.to·1d·
Discuss: DEV
Flag this post

Today I had a hard time understanding why my VPN was connected but I couldn’t reach my DB sitting just behind it.

Very simple situation:

  • you launch your PC, coffee’s hot
  • start your VPN
  • open your code and do some stuff
  • need to check something in a tool protected by the VPN
  • hu ho, why can’t I reach the site?
  • check the VPN logs — nothing weird
  • double-check the VPN config
  • recreate a VPN user
  • try with another Wi-Fi
  • coffee’s cold

Then I reboot my PC, connect to the VPN… and suddenly the site works.

Why that?

“Simply” because of Docker! More specifically: Docker networks.

When I launched Docker, it created a network using the same IP range as my VPN.

We can confirm the problem with a few commands.

ip route show (while connected to the VPN) gives us an idea of…

Similar Posts

Loading similar posts...