I have an OpenVPN server up and running for the last few years, all working well for me to access my home's LAN by IP address when I'm remote.
Recently I found myself having to access it from within a location where outbound internet access is restricted to ports 80 and 443. I have routed my external port 443 to my internal 1194 port, so I can still connect to the VPN.
Now, the challenge is that I have services on my home server that use other ports, so I can't access them directly via mydomain.com:<port> .
I was wondering if OpenVPN would be a possible solution to enable me to route [mydomain.com] traffic via that same VPN connection, but my attempts so far to route the traffic explicitly led to me getting a recursive routing error, which I understand.
This one works for the IP access:
config
client
proto udp
remote mydomain.com 443
dev tun
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
verify-x509-name server_djYFLGfxghURaVtn name
auth SHA256
auth-nocache
cipher AES-128-GCM
tls-client
tls-version-min 1.2
tls-cipher TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256
setenv opt block-outside-dns # Prevent Windows 10 DNS leak
verb 3
route-nopull
route 192.168.86.10 255.255.255.255
proto udp
remote mydomain.com 443
dev tun
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
verify-x509-name server_djYFLGfxghURaVtn name
auth SHA256
auth-nocache
cipher AES-128-GCM
tls-client
tls-version-min 1.2
tls-cipher TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256
setenv opt block-outside-dns # Prevent Windows 10 DNS leak
verb 3
route-nopull
route 192.168.86.10 255.255.255.255
Adding (or replacing the last line with) this fails with recursive routing, which I understand:
config
route mydomain.com 255.255.255.255
The reason I'd benefit from having access via mydomain.com rather than <ip address> is because of client-side application configurations that access the services via domain name so that they work outside my home.
I know, it's a bit convoluted and not too common a scenario, but I thought I'd ask.
Thanks in advance for your time.