3

When I connect my Mac to the Raspberry Pi directly via an ethernet cable, in the terminal, I can type:

ssh pi@raspberrypi.local

No special configuration is required.

On my Ubuntu Linux machine, I cannot seem to find the address raspberrypi.local on a direct Ethernet connection. On the other hand, if I connect to a MiFi device (which I have previously configured the Pi to connect to), I can find raspberrypi.local and do a regular SSH into it. I am hesitant to do this, however, as I have the Pi recording data resulting in a large data file, which is slow to transfer via the MiFi device, and would much prefer an Ethernet connection.

I recognize that this is most likely a network connectivity issue. How do I go about troubleshooting this, and enabling my Ubuntu machine such that I can ultimately just type:

ssh (or scp) pi@raspberrypi.local
3
  • This is almost certainly not due to Ubuntu configuration (unless you want to make drastic changes to networking). On the Pi (at least recent versions) dhcpcd allows routing over link-local addresses, but this is not used in Ubuntu. If the Ubuntu machine is connected to a network pi@raspberrypi.local should work over the network. I can certainly connect a Pi2 running Ubuntu MATE to another Pi over the network. You could check if your Ubuntu machine has zero-conf (I use avahi for this - the Pi has it by default)
    – Milliways
    Jan 14, 2016 at 2:47
  • Yes, if both devices are connected to my MiFi network, then pi@raspberrypi.local works. However, it does not work as such when I try to connect the Pi to my Ubuntu box directly via Ethernet. Will zero-conf allow for the direct connection setup? I will get back an answer in a few hours.
    – ericmjl
    Jan 14, 2016 at 14:06
  • The reason it does not work is because the Pi does not have as IP Address when plugged into an Ethernet port (unless there is a DHCP server). There is a link-local address (usually 169.something), normally used for configuration. You can ssh to this from the Mac, not sure about Ubuntu. Another option is to use inet6 addr: (also link-local). Not all services work over these direct links.
    – Milliways
    Jan 14, 2016 at 23:10

1 Answer 1

1

It's a naming issue in DNS resolving. Edit hosts file like in this tutorial add a line :

1.2.3.4 raspberrypi.local

where 1.2.3.4 is the IP address in your Pi. You can also try to use Bounjour multicast DNS, but it's - IMHO - it's a too overwhelming approach

4
  • This is NOT a DNS issue and this approach is deprecated. Most modern machines support zero-conf. See en.wikipedia.org/wiki/.local
    – Milliways
    Jan 14, 2016 at 3:44
  • @milliways it's a DNS resolving issue, it can't resolve the name Jan 14, 2016 at 3:57
  • 1
    If you read the Wiki page you will see "Although .local is an officially reserved Special-Use Domain Name and such host names will never be resolvable by the global Domain Name System" hosts is file that associates IP addresses with hostnames. I did not say this won't work, merely that it is deprecated. After all if you already know the IP address why not use it? The .local name allows clients to resolve the IP address which may change.
    – Milliways
    Jan 14, 2016 at 4:38
  • @milliways I agree about IP address using - doing it myself. +1 Jan 14, 2016 at 15:40

Your Answer

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

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