How do I SSH into my Rasperry Pi which is directly connected to my Linux Laptop via an Ethernet cable? As far as my research went, it does not get assigned an IP, which is the reason why I can not reach it via SSH, as I normally would. Any help appreciated.
Notes:
- I have no access to the Pi's CLI, only to my Laptop.
- I can not connect my Pi to a router.
Edit 1:
I now know that the Pi gets assigned some Link-local address. I noticed that when I plug the Ethernet cable in, the enp0s25
interface changes from DOWN
to UP
(output of ip a
). However, nothing else changes.
Edit 2:
I installed and configured a dhcp
server on my laptop.
Here are the debug messages that show it is working:
DHCPDISCOVER from dc:a6:32:86:7f:97 via enp0s25
DHCPOFFER on 192.168.0.1 to dc:a6:32:86:7f:97 (pi) via enp0s25
DHCPREQUEST for 192.168.0.1 (192.168.0.0) from dc:a6:32:86:7f:97 (pi) via enp0s25
DHCPACK on 192.168.0.1 to dc:a6:32:86:7f:97 (pi) via enp0s25
However, I still can not reach my Pi. What do I have to do now?
Edit 3:
I now used the IP range 172.16.0.0/12
with this configuration of dhcpd
:
option domain-name-servers 8.8.8.8, 8.8.4.4;
option subnet-mask 255.240.0.0;
option routers 172.16.0.1;
subnet 172.16.0.0 netmask 255.240.0.0 {
range 172.16.0.2 172.16.0.10;
}
Here is the relevant part of the output of ip addr
:
enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 3c:97:0e:22:85:da brd ff:ff:ff:ff:ff:ff
inet 172.16.0.0/12 scope global enp0s25
valid_lft forever preferred_lft forever
Here are the dhcp
debug messages that again show it is working:
DHCPDISCOVER from dc:a6:32:86:7f:97 via enp0s25
DHCPOFFER on 172.16.0.2 to dc:a6:32:86:7f:97 (pi) via enp0s25
DHCPREQUEST for 172.16.0.2 (172.16.0.0) from dc:a6:32:86:7f:97 (pi) via enp0s25
DHCPACK on 172.16.0.2 to dc:a6:32:86:7f:97 (pi) via enp0s25
However, when I ping 172.16.0.2
, I get this error:
PING 172.16.0.2 (172.16.0.2) 56(84) bytes of data.
From 172.16.0.0 icmp_seq=1 Destination Host Unreachable
From 172.16.0.0 icmp_seq=5 Destination Host Unreachable
From 172.16.0.0 icmp_seq=6 Destination Host Unreachable
Meaning I still can not SSH into my Pi. Any ideas?
route -n
orip route get 172.16.0.2
ortraceroute 172.16.0.2
on your laptop. You can add the output ofroute -n
to your question. – Kate Jan 02 '22 at 17:12