0

I will need to use my Raspberry Pi soon without an internet connection and am trying to set it up to run headless through an ethernet connection.

I am using a Chromebook Samsung 3 running Linux in a Crostini container to connect with a Raspberry Pi 3 B. I am able to SSH into my Raspberry Pi with my Chromebook just fine over a WiFi connection. I followed this guide to do the following:

1) SSH into the Pi

sudo ssh pi@192.168.0.61

2) Turn on predictable network names using raspi-config

3) Gather info using

ip -4 addr show | grep global
ip route | grep default | awk ‘{print $3}’
cat /etc/resolv.conf

4) Based on results above, append dhcpcd.conf file by adding these lines to the end of the file

interface eth0
static ip_address=10.1.1.99/24
static routers=10.1.1.1
static domain_name_servers=10.1.1.1
static domain_search=raspberrypi.local

interface eth0
fallback static_eth0

interface wlan0
static ip_address=10.1.1.98/24
static routers=10.1.1.1
static domain_name_servers=10.1.1.1

interface wlan0
fallback static_wlan0

5) Update and upgrade

sudo apt-get update
sudo apt-get upgrade
sudo reboot

However when I turn off WiFi on my Chromebook, turn on my Pi, connect the ethernet cable from the Pi to my Chromebook (through an ethernet to USB converter), and try to enter either with sudo ssh pi@192.168.0.99 or sudo ssh pi@raspberrypi.local, I still receive the errors ssh: connect to host 192.168.0.99 port 22: Network is unreachable or ssh: Could not resolve hostname raspberrypi.local: Name or service not known respectively

What troubleshooting can I do to try to remedy this?


Update:

Method 1)

  • I completely wiped my Pi's SD card and re-wrote the 'Raspbian Stretch with desktop and recommended software' image to the SD card.
  • All I did next to the Pi was put a blank 'SSH' file into 'boot' (to enable SSH) and then popped the SD Card back into my Pi.
  • With avahi-daemon, libnss-mdns, and SSH all installed on my Chromebook's Linux terminal and with my ethernet cable to USB plugged in between my Pi and my Chromebook, and my Chromebook saying it was trying to connect to a new ethernet connection, I tried the command ssh pi@raspberrypi.local but still got the error

    ssh: Could not resolve hostname raspberrypi.local: Name or service not known

Alternative Method (no ethernet cable)

This doesn't quite answer the original question because it doesn't involve an ethernet cable, but does allow wireless, headless access to the Raspberry Pi by making it into an access point. Source 1, Source 2

  • Wiped Pi SD card, rewrote 'Raspbian Stretch with desktop and recommended software' image to SD card, added wpa_supplicant.conf with my home network info and blank SSH file into boot folder of SD card, added reinserted SD card in Pi
  • SSH'd into my Pi with sudo ssh pi@192.168.0.61 (note that your IP address will differ and that the default Raspberry Pi login/password is pi/raspberry) and then ran the following:

    sudo apt update
    sudo git clone https://github.com/simondlevy/RPiAdHocWiFi
    cd RPiAdHocWiFi
    sudo ./install.sh
    sudo reboot
    sudo ssh pi@192.168.2.2
    

2 Answers2

3

There is no need to do much configuration when using an ethernet cable. With default Raspbian Stretch everything works out of the box. Just flash the image, and boot it on your RasPi. If there is a DHCP server running on the other side of the ethernet cable then the RasPi will get its configuration from it including an ip address. If there is no DHCP server running then it uses avahi aka Zeroconf aka Bonjour with a Link-local address using mDNS name raspberrypi.local.

So just make sure that your Linux machine have avahi and mDNS installed. On a Debian distribution it would be the packages avahi-daemon and libnss-mdns.

Then you should be able to

linux ~$ ping raspberrypi.local

and if you have ssh enabled on the RasPi then

linux ~$ ssh pi@raspberrypi.local

should also do. If not then it is a problem of your Chromebook, not of the Raspberry Pi.

Ingo
  • 42,961
  • 20
  • 87
  • 207
0

You have used 2 fallback static_wlan0 static_eth0 but not defined either, although as you have assigned static addresses this is unlikely to do anything.

If you enabled predictable network names then you WILL NOT have an eth0 interface!

dhcpcd has likely tried to access a DHCP server and failed to obtain an IP address.

"static domain_search=raspberrypi.local" is meaningless

I don't know why you would use sudo ssh pi@192.168.0.99 when you are attempting to assign 10.1.1.99 to the Pi.

It is difficult to know what to suggest, as it is unclear what you are trying to do. I suggest re-reading the linked tutorial.

If you did NOTHING to the Pi, and connected the Ethernet cable to a Linux machine ssh pi@raspberrypi.local should work over a Link-local address (although I know nothing of chromebooks).

If you are merely trying to access your Pi when it has no internet access you could try Raspberry Pi as an Access Point OR WiFi client which I use when travelling.

Milliways
  • 62,573
  • 32
  • 113
  • 225