mirror of
https://github.com/hwdsl2/docker-ipsec-vpn-server.git
synced 2026-04-26 10:05:48 +03:00
[GH-ISSUE #207] VPN don't work with --net=host option #193
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 @BulatSaif on GitHub (Oct 16, 2020).
Original GitHub issue: https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/207
Checklist
Similar issues:
https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/70
https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/154
https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/183
https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/200
Describe the issue
I found several GitHub issues where users wanted to route traffic to another docker container running on the same machine as the VPN container but due Docker's network isolation it is very complicated.
The
--net=hostoption can be a simple solution for this issue.I tested it. And it works, I can ping containers network from remote and ping remote host from the container.
But main VPN functionality is broken. I guess somewhere
MASQUERADEis absent and I can not access to the internet form remote host.To Reproduce
Steps to reproduce the behavior:
Connect to vpn.
Ping container network on vpn server (run some container with network 172.18.0.1 on vpn server, check what you don't have same network in you local pc).
It works, great!
It does not work. I can see in
tcpdumpthat packet is send from vpn server to 8.8.8.8 but I guess the source address is not correct so I didn't receive reply.Expected behavior
Docker container and vpn works with
--net=hostoption.Logs
No error in logs.
Server (please complete the following information)
Client (please complete the following information)
Additional context
@BulatSaif commented on GitHub (Oct 16, 2020):
I found problem, I have different interface name,
ens5on host andeth0in dockerWorkaround:
Is it possible to add support of
--net=hostin/opt/src/run.sh?@Smosia commented on GitHub (Jan 4, 2022):
Is it possible to add support of nftables here?
github.com/hwdsl2/docker-ipsec-vpn-server@b01c7d8951/run.sh (L479)Looks like nftables become more and more popular service.
Maybe you can add new container parameter to choose between iptables and nftables?
iptables-translate utility may help to convert rules.
Thank you!