Wireguard + Web GUI connection problem

Started by Scrambler77, February 15, 2025, 11:13:49 AM

Previous topic - Next topic
Hi everyone. I want to share with you a strange behaviour of my opnsense installation.

Here's my setup:

OPNSense LAN interface with IP 10.0.0.1/22 - hostname "gateway.[mydomain].net";
OPNSense WAN interface with carrier assigned IP address;
Wireguard VPN interface with IP 10.10.0.1/24;
PC with local IP 10.0.2.11/22 connected to LAN interface.

I'm sometimes having issues connecting to the OPNSense GUI using URL https://gateway.[mydomain].net and sometimes https://10.0.0.1 from my PC with IP 10.0.2.11.

Rebooting OPNSense it will work regularly but after a few hours it stops responding showing the following issue: looking for a misconfiguration problem i found strange firewall logs (see attached file).

It seems that my GUI connection coming from 10.0.2.11 to LAN ip address 10.0.0.1 is "routed" to the wireguard VPN IP address 10.10.0.1 and, obviously, it will not work.

Restarting lighttpd does not fix the problem (lighttp.conf is configured for listening on 10.0.0.1 ip address only).

What can i do to address the problem?

Many thanks to anybody can point me to the right direction.

If you need "gateway.[mydomain].net" to resolve to one specific IP address (as opposed to all addresses that Unbound is listening on), you can use [Services > Unbound DNS > General > Do not register system A/AAAA records] and add a host override with the address that you want to use.

You saved my day...

What threw me off is the fact that pinging URL gives me the right ip address.

With your suggestion in mind i looked at my PC outgoing connections with iptraf and Firefox is effectively trying to connect to the wrong (VPN) IP address. I dunno why it is choosing that address instead the right one used by ping.

..and this is probably the reason why you have "Hero Member" tag under your nickname.

Thank you very much!