[GH-ISSUE #211] Access resources in the same server that docker #196

Closed
opened 2026-03-02 07:44:41 +03:00 by kerem · 1 comment
Owner

Originally created by @certifirm on GitHub (Nov 7, 2020).
Original GitHub issue: https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/211

I am testing your docker image and all works well.

I need only to access resources on the server, like mariadb, apache, ...

This is my env file

VPN_IPSEC_PSK=*****
VPN_USER=*****
VPN_PASSWORD=*****

VPN_L2TP_NET=192.168.50.0/24
VPN_L2TP_LOCAL=192.168.50.1
VPN_L2TP_POOL=192.168.50.50-192.168.50.250

If I ping from a client to server address it works (ping from 192.168.50.50 to 192.168.50.1), but resources in server are not accessible.

Thanks

Originally created by @certifirm on GitHub (Nov 7, 2020). Original GitHub issue: https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/211 I am testing your docker image and all works well. I need only to access resources on the server, like mariadb, apache, ... This is my env file ``` VPN_IPSEC_PSK=***** VPN_USER=***** VPN_PASSWORD=***** VPN_L2TP_NET=192.168.50.0/24 VPN_L2TP_LOCAL=192.168.50.1 VPN_L2TP_POOL=192.168.50.50-192.168.50.250 ``` If I ping from a client to server address it works (ping from 192.168.50.50 to 192.168.50.1), but resources in server are not accessible. Thanks
kerem closed this issue 2026-03-02 07:44:41 +03:00
Author
Owner

@hwdsl2 commented on GitHub (Nov 7, 2020):

@certifirm Hello! Due to Docker's network isolation, and because your VPN clients connect to the VPN server which is running inside a Docker container, they cannot access resources on the Docker host. The only possible solution I can think of is to try the "--net=host" option when creating the Docker container, so that the container will share the Docker host's networking. There are some caveats and possible bugs, however, such as #207. Also you may need to manually clean up the Docker host's IPTables rules if you no longer need to run the VPN server container.

<!-- gh-comment-id:723489172 --> @hwdsl2 commented on GitHub (Nov 7, 2020): @certifirm Hello! Due to Docker's network isolation, and because your VPN clients connect to the VPN server which is running inside a Docker container, they cannot access resources on the Docker host. The only possible solution I can think of is to try the "--net=host" option when creating the Docker container, so that the container will share the Docker host's networking. There are some caveats and possible bugs, however, such as #207. Also you may need to manually clean up the Docker host's IPTables rules if you no longer need to run the VPN server container.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/docker-ipsec-vpn-server#196
No description provided.