Page 1 of 1

OpenVPN clients can "see" each other, but can't access the server. (10.8.0.1 gets routed back to the client)

Posted: Wed Oct 19, 2022 6:28 pm
by SparkyTD
I'm configuring an OpenVPN network to let external clients connect to an internal server (and each other) through a secure channel. I have configured the server with the client-to-client option, to ensure that all the clients can ping each other, but I want them to also be able to access server-side resources running on the same VPS as the OpenVPN server itself.

Looking at the man pages, and the server interfaces, I can see that the server automatically assigns the address 10.8.0.1 for itself, but strangely, from the client's perspective, this address doesn't actually represent the server, but instead points back towards the client itself. So for example, if I want to access a web server that's running beside the OpenVPN server, I would normally try to connect to http://10.8.0.1:80/, but for some reason this gets routed back to my own workstation, and connects to my local web server instead. Because of this, what should be the server's address, effectively acts as a localhost address, making it impossible to access other server-side resources.

I know that optimally we should deploy the OpenVPN server to its own dedicated VPS, and let clients access other resources on the network, but in our current situation this is not possible, so we have to install OpenVPN on the same machine that is also hosting out internal web server (and some other resources).

So to summarize my questions: Why is 10.8.0.1 routed back towards the client as if it was a loopback adapter? How can I configure the server in a way that allows clients to "see" other services running beside the OpenVPN server process on the same VPS?

Server Config

server 10.8.0.0 255.255.255.0
topology subnet
port 52278
proto udp
dev tun
dh none
cipher AES-256-GCM
auth SHA256
persist-key
persist-tun
client-to-client

keepalive 10 120
max-clients 100
explicit-exit-notify 1
management 0.0.0.0 7505
machine-readable-output

client-config-dir "/opt/openvpn-admin/ccd/"
ca "/opt/openvpn-admin/ca.crt"
cert "/opt/openvpn-admin/server.crt"
key "/opt/openvpn-admin/server.pk"
tls-crypt "/opt/openvpn-admin/server.psk"

push "dhcp-option DNS 10.8.0.1"
push "dhcp-option DOMAIN local"
push "dhcp-option DISABLE-NBT"
push "block-outside-dns"

verb 3


Client Config

client
remote redacted 52278
proto udp
dev tun
cipher AES-256-GCM
auth SHA256
persist-key
persist-tun

resolv-retry infinite
nobind
remote-cert-tls server
key-direction 1
user nobody
group nogroup

<ca> redacted </ca>
<cert> redacted </cert>
<key> redacted </key>
<tls-crypt> redacted </tls-crypt>

verb 3

Re: OpenVPN clients can "see" each other, but can't access the server. (10.8.0.1 gets routed back to the client)

Posted: Wed Oct 19, 2022 8:31 pm
by Pippin
Hi,

A possibility I can think of is that you have an overlapping network, check here:
https://community.openvpn.net/openvpn/w ... gConflicts


Remarks:
Not sure about having --management on 0.0.0.0 is a good idea.
Please read section Management Interface Options in manual 2.5: https://build.openvpn.net/man/openvpn-2 ... vpn.8.html

--tls-crypt does not need --key-direction

Re: OpenVPN clients can "see" each other, but can't access the server. (10.8.0.1 gets routed back to the client)

Posted: Wed Oct 19, 2022 8:43 pm
by SparkyTD
Pippin wrote:
Wed Oct 19, 2022 8:31 pm
A possibility I can think of is that you have an overlapping network, check here:
https://community.openvpn.net/openvpn/w ... gConflicts
Now that you're mentioning it... I think I accidentally installed the regular OpenVPN package instead of the OpenVPN Connect client earlier today. After I realized that I downloaded the wrong installer, I just kind of ignored it. But apparently it already configured the TAP adapter for itself, which caused my configuration to break.

Now I just have to figure out how to fully uninstall OpenVPN from my windows machine (just running the uninstaller didn't get rid of the TAP adapter).

Do you have a suggestion as to how I could uninstall the OpenVPN that I accidentally installed?

If no, you still helped me realize what's causing this behavior, so thank you!

Re: OpenVPN clients can "see" each other, but can't access the server. (10.8.0.1 gets routed back to the client)

Posted: Wed Oct 19, 2022 9:01 pm
by Pippin
Hi,

I´m not a Windows user but read that TAP adapter can be uninstalled through Device Manager, including software for the device...?

Re: OpenVPN clients can "see" each other, but can't access the server. (10.8.0.1 gets routed back to the client)

Posted: Wed Oct 19, 2022 9:10 pm
by SparkyTD
Pippin wrote:
Wed Oct 19, 2022 9:01 pm
I´m not a Windows user but read that TAP adapter can be uninstalled through Device Manager, including software for the device...?
Hi,

Yes, that was it. Everything works now. Thank you again!

Re: OpenVPN clients can "see" each other, but can't access the server. (10.8.0.1 gets routed back to the client)

Posted: Wed Oct 19, 2022 9:20 pm
by Pippin
Nice, glad it helped.