OpenVPN Server work with HAproxy

Good afternoon all!

I’m sure you’ve already answered this question many times but from all I researched and tested on my environment I’m unable to reach my web services by it’s DNS record through HAproxy when connected remotely via OpenVPN.

I have my HAproxy pointing to my WAN and this works perfectly when I’m local, I’ve added the records to unbound pointing to my WAN address (and this I’m not if it’s correct or not). I’ve added the OpenVPN server network to unbound ACL to allow the queries go through. The firewall rules for the OpenVPN is set to allow any traffic. (note to mention that I can reach the servers/services by its IP address).

Thanks in advance!

When connected via OpenVPN and you do a dig what IP comes up for that DNS? Is it different than the one when not connected?

It returns the same IP (my WAN IP) when connected with the VPN. I don’t have HAproxy exposed to the internet, this is only to handle internal requests.

If you don’t have it exposed to the internet then you should have HAProx bound to an internal IP.

Sorry if I’m being thick now, but would that internal IP be the LAN address? Because the services are running on different VLAN’s. Also I tried bounding HAproxy with my LAN IP and changed the DNS record to LAN IP but that just broke the connections internally.

If you have rules blocking some VLANs from accessing that internal IP then you will have to make exceptions to those so they can access it.

Mannnn I’m so stubborn sometimes I refuse to see the answer right in front of my eyes, apologies and thank you so much for taking your time to help me with this.

It’s fully working now, keep up with the awesome content and support!