1

I want to connect through SSH my Raspberry Pi 3 B+ to my laptop running Ubuntu 18.04 just with an Ethernet cable without any internet connection.

1) Wi-Fi on for Pi and laptop [ok]

2) Wi-Fi off for Pi and laptop [problem]


1) Wi-Fi on for Pi and laptop [ok]

If I turn Wi-Fi on for my laptop and my Pi, I can get the IP address of the Pi with hostname -I, which returns two addresses for my Pi 169.254.176.100 192.168.178.80, see picture below.

enter image description here

As far as I understand it, 192.168.178.80 is the IP address of the Pi due to Wi-Fi.

I can connect to pi@192.168.178.80 through ssh from my laptop (user fernandez), see picture below

enter image description here

While Wi-Fi is on, ip route returns on my laptop

fernandez@emmabook5:~$ ip route
default via 192.168.178.1 dev wlp3s0 proto dhcp metric 600 
169.254.0.0/16 dev wlp3s0 scope link metric 1000 
192.168.178.0/24 dev wlp3s0 proto kernel scope link src 192.168.178.77 metric 600 
fernandez@emmabook5:~$ 

and on the Pi

pi@emmapi1:~ $ ip route
default via 192.168.178.1 dev wlan0 src 192.168.178.80 metric 303 
169.254.0.0/16 dev eth0 proto kernel scope link src 169.254.176.100 metric 202 
192.168.178.0/24 dev wlan0 proto kernel scope link src 192.168.178.80 metric 303 
pi@emmapi1:~ $ 

2) Wi-Fi off for Pi and laptop [problem]

When I turn Wi-Fi off for the Pi and my laptop, hostname -I returns only 169.254.176.100 for the Pi, and nothing for my laptop (the address 192.168.178.77 was the one I had for my laptop while Wi-Fi was on), see picture below

enter image description here

I try to naively connect from my laptop to the Pi through SSH to 169.254.176.100 after connecting both with an Ethernet cable (the orange light for Ethernet connection of the Pi is on, so I assume, it is properly connected)

enter image description here

but it fails and I only get the error:

enter image description here

What does this mean or how can I connect through SSH to my Pi without internet connection only with an Ethernet cable?

For Wi-Fi off, ip route returns nothing on my laptop

fernandez@emmabook5:~$ ip route
fernandez@emmabook5:~$ 

and on the Pi

pi@emmapi1:~ $ ip route
default dev eth0 proto kernel scope link src 169.254.176.100 metric 202 
169.254.0.0/16 dev eth0 proto kernel scope link src 169.254.176.100 metric 202 
pi@emmapi1:~ $ 
4
  • @goldilocks I added the output of ip route for each scenario – Mauricio Fernández Jul 4 '18 at 14:27
  • Based on that, the problem is not the Pi; its routing is correct in both cases. The problem is with the Ubuntu system. It is using the wrong interface for 169.254.0.0/16 in the first case and obviously has a problem in the second. For that reason I am moving this to Ask Ubuntu. – goldilocks Jul 4 '18 at 14:55
  • 1
    Did you assign an IP address to each device? – danzel Jul 4 '18 at 15:06
  • @danzel no, sorry, I dont know how to do that, I just started with Ubuntu. – Mauricio Fernández Jul 4 '18 at 15:18
2

This should work if you have both your RPi and your Ubuntu machine on the same subnet. Set the IP address and subnet mask on your Ubuntu machine manually such that it's on the same subnet as your RPI, but with a different IP. Do this:

pi@raspberrypi3b:~ $ ifconfig eth0 eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.0.14 netmask 255.255.255.0 broadcast 192.168.0.255 inet6 fe80::53b3:8c82:c0d6:57d5 prefixlen 64 scopeid 0x20<link> ether b8:27:eb:cd:2f:ff txqueuelen 1000 (Ethernet) RX packets 143870 bytes 30387506 (28.9 MiB) RX errors 0 dropped 65635 overruns 0 frame 0 TX packets 32375 bytes 4042276 (3.8 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

In this case you would manually set the IP address on your Ubuntu machine to 192.168.0.100 (for example), and set the subnet mask to 255.255.255.0. Or, to put this in CIDR notation: 192.168.1.100/24. And the Ubuntu docs already explain how to set your IP address manually, so I'll not repeat that here. (And here's the "GUI Approach" to manual network configuration)

I've not done this in a while, but I think it will work. Let us know how you get on.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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