kylemanna / docker-openvpn

🔒 OpenVPN server in a Docker container complete with an EasyRSA PKI CA
https://hub.docker.com/r/kylemanna/openvpn/
MIT License
8.62k stars 2.37k forks source link

Unable to connect to vpn server with --network=host #741

Open Chris3481 opened 1 year ago

Chris3481 commented 1 year ago

Hello,

I'm trying to run kylemanna/docker-openvpn container with --network-host option on a virtual machine. But any clients are able to connect. when I look at the server logs, it's like if no one tries to connect.

It works very well when I use docker network and exposing port 1194/udp

I don't have a eth0 interface on my host machine (as it's a VM). All my public traffic uses enp1s0 interface I know this by using the command ip route | grep default who gives me the result default via 95.x.x.x dev enp1s0

After diving in the code, I noticed the option OVPN_NATDEVICE that I tried to set with the correct value in the ovpn_env.sh file. But it didn't solve the problem.

Any help or ideas will be appreciated to help me to salve this problem