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.77k stars 2.39k forks source link

Wrong server IP pushed to client? #210

Open ghost opened 7 years ago

ghost commented 7 years ago

I have just installed a fresh container on my server and followed the instructions, created a client conf and installed it on my client. I have executed openvpn --config ovpn.conf on the client and could see the connection establish on both server and client. So far so good.

But, on the client side I saw: inet 192.168.255.6 peer 192.168.255.5/32 scope global tun0

and my route was updated to: 0.0.0.0/1 via 192.168.255.5 dev tun0 128.0.0.0/1 via 192.168.255.5 dev tun0 192.168.255.5 dev tun0 proto kernel scope link src 192.168.255.6

And so, ping 192.168.255.5 returned no results. No results either when pinging a publicly reachable IP or domain name. But, ping 192.168.255.1 was returning results.

And when manually setting the route to use 192.168.255.1 as a gateway then I could ping public IPs and they see connections as coming from the server's IP.

Did I do something wrong or is that an actual issue?

kylemanna commented 7 years ago

Seems like something is wrong, need more details on how your system is configured. OpenVPN addresses seem valid.

ghost commented 7 years ago

Great! What configuration info could be interesting? On the server side I have simply executed the steps mentioned in the quickstart. And on the client side I have tried on an arch linux to download openvpn and execute it with the config file generated on the server. And I also tried that on an openwrt. Same results. Please let me know what else I can tell you.

kellybyrd commented 7 years ago

I have the same problem. I followed the quickstart instructions then moved to starting the container via systemd.

yukunyi commented 7 years ago

I get same result.

yukunyi commented 7 years ago

I found,this is correct, google "openvpn net30", add topology subnet to openvpn.conf .

kellybyrd commented 7 years ago

Confirmed "topology subnet" worked for me. My issue was that I was trying to configure a router to do a gateway failover. If the VPN is down, send traffic over another interface. The problem is that the test for "down" is to try and ping the peer, which was .5.

1070148808 commented 7 years ago

sorry,i want to use server ping client,but not success,just client ping client succeed~~~

ivakinpavel commented 6 years ago

same for me, i have setuped docker openvpn server on cent os and only able ping client-client there is no 192.168.255.X interface on my server