0

I can do ping 10.84.135.79 or ssh [email protected]. But I'm unable to succeed with ping mydevice.local or ssh [email protected].

I'm on macOS, trying to ssh to a Raspberry Pi 4 Model B Rev 1.2.

% ping 10.84.135.79 -ov
PING 10.84.135.79 (10.84.135.79): 56 data bytes
64 bytes from 10.84.135.79: icmp_seq=0 ttl=64 time=23.203 ms

--- 10.84.135.79 ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 23.203/23.203/23.203/0.000 ms

% ssh [email protected]
[email protected]'s password: 
Linux mydevice 5.4.83-v7l+ #1379 SMP Mon Dec 14 13:11:54 GMT 2020 armv7l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed Jun  2 13:18:06 2021 from 10.84.135.82

pi@mydevice:~ $ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

pi@mydevice:~ $ cat /etc/dhcpd.conf
cat: /etc/dhcpd.conf: No such file or directory

pi@mydevice:~ $ sudo ifconfig wlan0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.84.135.79  netmask 255.255.255.240  broadcast 10.84.135.95
        inet6 fe80::6065:6ccb:98ab:cd76  prefixlen 64  scopeid 0x20<link>
        ether dc:a6:32:9b:11:ca  txqueuelen 1000  (Ethernet)
        RX packets 174  bytes 37955 (37.0 KiB)
        RX errors 0  dropped 4  overruns 0  frame 0
        TX packets 260  bytes 43498 (42.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

But:

% ping mydevice.local -ov
ping: cannot resolve mydevice.local: Unknown host

% ssh [email protected] -vvv
OpenSSH_8.6p1, LibreSSL 2.7.3
debug1: Reading configuration data /Users/me/.ssh/config
debug1: /Users/me/.ssh/config line 1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 47: Applying options for *
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/Users/me/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/Users/me/.ssh/known_hosts2'
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug1: Connecting to mydevice.local port 22.
<nothing happens for hours>
4
  • With some routers you have to skip the .local part. and use just ping mydevice.
    – kwasmich
    Commented Jun 2, 2021 at 6:14
  • @kwasmich ssh: Could not resolve hostname mydevice: nodename nor servname provided, or not known and ping: cannot resolve mydevice: Unknown host
    – Cœur
    Commented Jun 2, 2021 at 6:47
  • From your macOS you can get a list of mdns hosts using.. dns-sd -B _ssh This will list all _ssh services that are advertised on the network.. Commented Jun 4, 2021 at 9:24
  • @SimonBanks I'm only seeing macOS devices listed by this command. I'm not seeing any raspberry pi in the list.
    – Cœur
    Commented Jun 4, 2021 at 12:15

2 Answers 2

0

This does work on macOS - I do it routinely. The requisite software is include in Raspberry Pi OS and recent macOS.

However this is dependent on your network, and occasionally it just fails to respond (my guess is networking caching).

If you really want to make it work restart your router, the Mac and your Pi.

If you don't want to go to this drastic step pinging the Mac from the Pi sometimes wakes it up.

I also use a script https://raspberrypi.stackexchange.com/a/125182/8697 to "WAKE UP" the network.

1
  • Unfortunately, rebooting everything did not resolve the issue. And pinging the mac from the pi does not solve it either. I was told today that I should be looking at the Cisco WiFi router: it might be interfering with magic names such as mydevice.local.
    – Cœur
    Commented Jun 3, 2021 at 4:15
0

I've been told this might be a WiFi router configuration issue, interfering with magic names such as mydevice.local.

Not the most elegant way to solve it, but here is what did work and did solve both ping and ssh issues to my raspberry pi:

Edit /private/etc/hosts and hardcode your raspberry ip address:

10.84.135.79    mydevice.local
1
  • I seriously doubt that routers interfere with zeroconf (although it is not impossible, this decades old protocol could be defeated). The host sends a multicast UDP packet to a specific reserved address/port on local links. There is no name based translation of .local addresses by routers (although Microsoft historically used .local in a non standard way, but this changed over time). If you actually know the IP Address there are many ways of providing fallback if zeroconf fails.
    – Milliways
    Commented Jun 3, 2021 at 6:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.