Address by computer name instead of IP address in WireGuard VPN?

I can’t ping from an iPhone.

How do you usually access it ? From browser ?

He’s using his own VPN WG Server.

@ johnc

^It’s not the way I’d do it but I don’t see why it wouldn’t work. I’d set some static DHCP leases beforehand, just to be sure: GL GUI → Clients → Online Clients → $clientName → Action → Modify

Another or option is to use LuCI → Network → DHCP and DNS → Static Leases which will give you the equivalent of → Hostnames (result: iphone.lan). You can install LuCI via GL GUI → System → Advanced Settings. Be warned there’s been a lot of changes since 2005/2006.

I access it through the Files app on my iPhone.

10.0.0.2 / mac.local hosts an SMB server.

In the Files app on my iPhone, I connect to this computer by smb://mac.local

This works on my LAN, of course. I wish for this same connection to work over my WireGuard VPN. (I know that I could use smb://10.0.0.2 just fine on/off my LAN, but this is the scenario I’d like to resolve).

OpenWrt DHCP defaults to .lan instead. .local creates conflicts w/ other DNS-based software used by Windows/Linux because Apple decided some years ago to ‘hijack’ that particular pseudo-TLD.

LuCI → Network → DHCP and DNS → General Settings → Local server & Local domain

So, I replace as follows?

John, before you continue configuring various options for your Burme 2 (eg: editing your hosts file as @SpitzAX3000 suggested), I’d highly suggest you back up your current state.

See the following:

Hypothetically, yes… but keep in mind that caveat I mentioned re: pseudo-TLD. You could have some troubles in the future if you start mixing other client operating system on your LAN.

I would really preform a backup first. It’s all in that HOW-TO. Keep that resulting tarball in a safe place.

Instead of changing these settings just edit your Mac server name from mac.local to mac. Then disconnect it from the router and reconnect again to have it as mac.lan

1 Like

Thanks for the tip. Would these LuCI changes I’m making be reset if I hard-reset (10 seconds) the Brume 2?

It’s all in the HOW-TO.

Thanks for all your help, so far, but I’m still unable to connect at mac.local.

If I knew how to do this safely, on a mac, I would consider it… but the default/unchangeable computer name, through settings, must end in .local.

Can you ping your Mac via LuCI → Network → Diagnostics → IPv4 Ping w/ 10.0.0.2?

PING 10.0.0.2 (10.0.0.2): 56 data bytes
64 bytes from 10.0.0.2: seq=0 ttl=64 time=0.942 ms
64 bytes from 10.0.0.2: seq=1 ttl=64 time=1.033 ms
64 bytes from 10.0.0.2: seq=2 ttl=64 time=0.843 ms
64 bytes from 10.0.0.2: seq=3 ttl=64 time=0.851 ms
64 bytes from 10.0.0.2: seq=4 ttl=64 time=0.859 ms

— 10.0.0.2 ping statistics —
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 0.843/0.905/1.033 ms

Good stuff. Can you ping your Mac via its WG IP (eg: 10.0.8.2)?


Reference(s):

PING 10.0.8.2 (10.0.8.2): 56 data bytes
64 bytes from 10.0.8.2: seq=0 ttl=64 time=32.366 ms
64 bytes from 10.0.8.2: seq=1 ttl=64 time=150.096 ms
64 bytes from 10.0.8.2: seq=2 ttl=64 time=59.870 ms
64 bytes from 10.0.8.2: seq=3 ttl=64 time=61.765 ms
64 bytes from 10.0.8.2: seq=4 ttl=64 time=711.697 ms

— 10.0.8.2 ping statistics —
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 32.366/203.158/711.697 ms

Also, I added both mac.local and mac.lan to my ‘hosts’ file
127.0.0.1 localhost
10.0.0.2 mac.local
10.0.0.2 mac.lan
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

FWIW, I did these, also:

PING mac.local (10.0.0.2): 56 data bytes
64 bytes from 10.0.0.2: seq=0 ttl=64 time=0.985 ms
64 bytes from 10.0.0.2: seq=1 ttl=64 time=0.996 ms
64 bytes from 10.0.0.2: seq=2 ttl=64 time=1.219 ms
64 bytes from 10.0.0.2: seq=3 ttl=64 time=0.939 ms
64 bytes from 10.0.0.2: seq=4 ttl=64 time=0.975 ms

— mac.local ping statistics —
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 0.939/1.022/1.219 ms

PING mac.lan (10.0.0.2): 56 data bytes
64 bytes from 10.0.0.2: seq=0 ttl=64 time=1.048 ms
64 bytes from 10.0.0.2: seq=1 ttl=64 time=1.049 ms
64 bytes from 10.0.0.2: seq=2 ttl=64 time=1.205 ms
64 bytes from 10.0.0.2: seq=3 ttl=64 time=1.102 ms
64 bytes from 10.0.0.2: seq=4 ttl=64 time=1.143 ms

— mac.lan ping statistics —
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 1.048/1.109/1.205 ms

So we know WG is proper… which we already knew. What’s the result when you ping via the hostname(s) (eg: mac.lan, then mac.local)? I’m looking to see what IPv4 is returning.

PING mac.lan (10.0.0.2): 56 data bytes
64 bytes from 10.0.0.2: seq=0 ttl=64 time=0.966 ms
64 bytes from 10.0.0.2: seq=1 ttl=64 time=0.941 ms
64 bytes from 10.0.0.2: seq=2 ttl=64 time=0.914 ms
64 bytes from 10.0.0.2: seq=3 ttl=64 time=0.924 ms
64 bytes from 10.0.0.2: seq=4 ttl=64 time=0.929 ms

— mac.lan ping statistics —
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 0.914/0.934/0.966 ms


PING mac.local (10.0.0.2): 56 data bytes
64 bytes from 10.0.0.2: seq=0 ttl=64 time=0.880 ms
64 bytes from 10.0.0.2: seq=1 ttl=64 time=0.987 ms
64 bytes from 10.0.0.2: seq=2 ttl=64 time=0.848 ms
64 bytes from 10.0.0.2: seq=3 ttl=64 time=1.003 ms
64 bytes from 10.0.0.2: seq=4 ttl=64 time=0.994 ms

— mac.local ping statistics —
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 0.848/0.942/1.003 ms

I’m speculating if this will help but what happens if you set mac 10.0.8.2 as the mac.{lan,local} & remove all references to 10.0.0.2 in the GI GUI hostnames &/or LuCI Static Leases/Hostnames?

I’m wondering if that’ll be enough to resolve the DNS to the WG IP but I wouldn’t get my hopes up.

Please make sure you have a backup made first.