OPNsense Forum

Archive => 20.1 Legacy Series => Topic started by: dilby on June 29, 2020, 04:18:17 PM

Title: WireGuard unable to access devices via hostname
Post by: dilby on June 29, 2020, 04:18:17 PM
I managed to get Wiregard working so that I could remotly access my home network. I can access all devices by IP address.. for example http://192.168.0.6:80 works when connected, but http://myserver.local:80 doesn't work.

VPN-WireGuard->Local
DNS Server : 192.168.0.1
Tunnell Address : 10.252:0.0/24

VPN->WireGuard->Endpoints
Allowed IPs : 10.252.0.3/32

Firewall->Rules->Wireguard
Protocol : IPv4
Direction : In
Source : WireGuard net
Source Port, Dest, Dest Port, Schedule : *

Firewall->Rules->WAN
Protocol : UDP
Destination : WAN Address
Port : 51820

Client configuraion with relevenent IP 10.252.0.3 and DNS as 192.168.0.1.

Thanks
Title: Re: WireGuard unable to access devices via hostname
Post by: amichel on June 29, 2020, 08:23:35 PM
Hi,
did you create a rule so that traffic to Port 53 is allowed from the VPN?
192.168.0.1 is this the IP of your DNS server?
amichel
Title: Re: WireGuard unable to access devices via hostname
Post by: dilby on June 30, 2020, 11:12:29 AM
Thanks for the reply. Does the below not do that ?

Firewall->Rules->Wireguard
Protocol : IPv4
Direction : In
Source : WireGuard net
Source Port, Dest, Dest Port, Schedule : *

I did see your suggestion in one of the tutorials, but wasn's sure where to add it and also assumed the above rule passed through all thje ports ?
Title: Re: WireGuard unable to access devices via hostname
Post by: amichel on June 30, 2020, 11:48:51 AM
You are correct that should work.
Is your DNS Server the firewall or another DNS Server in your network?
If you do a nslookup and set it to query 192.168.0.1 and the query for google.com do you get a reply?
If you get one, are you sure that your DNS Server can resolve your internal DNS zone?
If not it might be a good apprroach to start here in troubleshooting.
If http://myserver.local works internally without a DNS server it is likely you use broadcast to identify the proper servre and I am not sure if that is doable through VPN.
Amichek