mirror of
https://github.com/hwdsl2/docker-ipsec-vpn-server.git
synced 2026-04-26 01:55:53 +03:00
[GH-ISSUE #331] Cannot connect to server because of listening address problem #306
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @carbon-lab on GitHub (Dec 10, 2022).
Original GitHub issue: https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/331
Checklist
Describe the issue

The processes in docker are listening IP address
172.17.0.2but not0.0.0.0. So they cannot receive the udp data come from client whose target address is a public IP address but not172.17.0.2.I have tried to use netcat tool to test my network. This is the result:
To Reproduce
Create a docker container and check its listen address.
Expected behavior
I expect the listening address of docker container is
0.0.0.0but not172.17.0.2.Logs
Enable logs, check VPN status, and add error logs to help explain the problem, if applicable.
Server (please complete the following information)
Client (please complete the following information)
Additional context
Nothing.
@hwdsl2 commented on GitHub (Dec 10, 2022):
@carbon-lab Hello! The IPsec VPN (Libreswan) is listening on the Docker container's internal IP address (
172.17.0.2in your case), which is normal. The Docker host should have IPTables rules in place (created automatically by Docker) that are responsible for forwarding the incoming UDP 500 and 4500 traffic to the Docker container.For example, on the Docker host, you might see:
If these rules are missing, there may be an issue with your Docker installation. On the other hand, if the rules are there, try enabling Libreswan logs in the container:
https://github.com/hwdsl2/docker-ipsec-vpn-server/blob/master/docs/advanced-usage.md#enable-libreswan-logs
Then re-connect the client and check the logs. If no new logs appear, then the connection attempt most likely did not reach the Docker container.
@hwdsl2 commented on GitHub (Dec 10, 2022):
@carbon-lab Please try the suggestions above. If you have additional information feel free to reply here.
@carbon-lab commented on GitHub (Dec 16, 2022):
I have tried to enable the Libreswan logs in the container. But when I tried to check the log file
/var/log/auth.logafter I tried connect to my container, I cannot find that file. And I still cannot connect to my server.By the way, I can use netcat to send and receive data from my docker host on port 500 and 4500 by UDP.