[GH-ISSUE #174] Unable to Ping other containers after setting DNS #161

Closed
opened 2026-03-02 07:28:10 +03:00 by kerem · 3 comments
Owner

Originally created by @ztj1993 on GitHub (Feb 25, 2020).
Original GitHub issue: https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/174

I've set up DNS, but I still can't Ping other containers. In the same network environment, you can ping by entering the shell.

How to configure this situation?

    image: hwdsl2/ipsec-vpn-server
    privileged: true
    dns: 127.0.0.11
    environment:
      - VPN_DNS_SRV1=127.0.0.11
      - VPN_DNS_SRV2=127.0.0.11
    ports:
      - 500:500/udp
      - 4500:4500/udp
      - 1701:1701/tcp
Originally created by @ztj1993 on GitHub (Feb 25, 2020). Original GitHub issue: https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/174 I've set up DNS, but I still can't Ping other containers. In the same network environment, you can ping by entering the shell. How to configure this situation? ``` image: hwdsl2/ipsec-vpn-server privileged: true dns: 127.0.0.11 environment: - VPN_DNS_SRV1=127.0.0.11 - VPN_DNS_SRV2=127.0.0.11 ports: - 500:500/udp - 4500:4500/udp - 1701:1701/tcp ```
kerem closed this issue 2026-03-02 07:28:10 +03:00
Author
Owner

@hwdsl2 commented on GitHub (Apr 12, 2020):

@ztj1993 Hello! This is restricted by the IPTables FORWARD rules in run.sh. If you build your own customized version of this Docker image, refer to [1] for examples on which IPTables rules to add in order to allow traffic to your subnet.

[1] https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/clients.md#access-vpn-servers-subnet

<!-- gh-comment-id:612666012 --> @hwdsl2 commented on GitHub (Apr 12, 2020): @ztj1993 Hello! This is restricted by the IPTables FORWARD rules in `run.sh`. If you build your own customized version of this Docker image, refer to [1] for examples on which IPTables rules to add in order to allow traffic to your subnet. [1] https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/clients.md#access-vpn-servers-subnet
Author
Owner

@TheAnachronism commented on GitHub (Apr 26, 2021):

What are those rules? The section mentioned in your link doesn't exist anymore.

<!-- gh-comment-id:826883860 --> @TheAnachronism commented on GitHub (Apr 26, 2021): What are those rules? The section mentioned in your link doesn't exist anymore.
Author
Owner

@hwdsl2 commented on GitHub (Apr 27, 2021):

@TheAnachronism Hello! You can find the rules here [1]. This section was removed because I discovered in my tests that accessing the VPN server's subnet works out of the box without adding those rules, assuming that the user sets up the VPN directly without using Docker.

On the other hand, due to Docker's network isolation among containers, it is difficult to reach other containers from a VPN client while connected to the VPN. You can give the rules a try, but it may not help in your use case.

[1] github.com/hwdsl2/setup-ipsec-vpn@ca6bf9818d/docs/clients.md (access-vpn-servers-subnet)

<!-- gh-comment-id:827323565 --> @hwdsl2 commented on GitHub (Apr 27, 2021): @TheAnachronism Hello! You can find the rules here [1]. This section was removed because I discovered in my tests that accessing the VPN server's subnet works out of the box without adding those rules, assuming that the user sets up the VPN directly without using Docker. On the other hand, due to Docker's network isolation among containers, it is difficult to reach other containers from a VPN client while connected to the VPN. You can give the rules a try, but it may not help in your use case. [1] https://github.com/hwdsl2/setup-ipsec-vpn/blob/ca6bf9818dc9310b6140e0c3d6137206992af354/docs/clients.md#access-vpn-servers-subnet
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#161
No description provided.