mirror of
https://github.com/hwdsl2/docker-ipsec-vpn-server.git
synced 2026-04-26 01:55:53 +03:00
[GH-ISSUE #133] No Internet access when connected to VPN #121
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 @arabold on GitHub (Apr 5, 2019).
Original GitHub issue: https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/133
I have a problem that's probably more related to
iptablesthan to the Docker image itself, but hopefully someone can help me on this nonetheless... 🙏I want to be able to connect my Laptop to my Server running the VPN docker container from within the same Wi-Fi. I'm not going through a NAT nor do I plan to do so. This is more of a VPN inside of a private Wi-Fi network. Once connected to the VPN I want to be able to access my other containers running on the same server as well as use the server as an Internet gateway. My containers are all running on a bridge network.
My Wi-Fi network uses 192.168.0.0/16, the L2TP connection uses 192.168.42.0/24 (might this might be the culprit?)
To achieve the above I have tried two different options so far:
Both options would be acceptable for me if I can have a) a static IP address of the server within the VPN (such as 192.168.42.1) through which all other containers are accessible, and b) have access to the Internet.
Any suggestions or ideas?
This is the
iptables -Loutput on my host system when running the VPN container inhostmode:@hwdsl2 commented on GitHub (Apr 11, 2019):
@arabold Hello! Due to the way Docker networking works and isolation among Docker containers, in the normal "bridge" network mode I think it is not possible to access services on your other Docker containers (such as
http://192.168.42.1:3000) using your VPN server's internal IP 192.168.42.1.For the "host" network mode (which is not recommended because in this mode the Docker image may modify the IPTables on your host), I think your issue might be caused by the Docker image assuming
eth+for your server's default network interface. But you are using Wi-Fi on your Docker host so it's probablywlan0orwlan+. To fix... Save a copy of your existing IPTables rules:iptables-save -c > iptables-rules.tmp, then editiptables-rules.tmpand replace alleth+withwlan+, on the relevant lines (see [1]). Finally, save the file and restore IPTables rules:iptables-restore -c < iptables-rules.tmp.[1] https://github.com/hwdsl2/docker-ipsec-vpn-server/blob/master/run.sh#L305-L323