1

I am trying to use my raspberry through SSH, in order to connect to it I wanted to set a static IP address for it. While being connected to my home network, it works fine, the IP is probably set by my router So i can access it easily. But when offline it just won't connect. I have installed RaspAP and this service also doesn't work properly without a network access so wlan0 interface is not usable.

I have tried to configure my dhcpcd.conf file in order to configure a static IP address for eth0. I am very new in terms of network connections and such, and as RaspAP uses dhcpcd, I was told not to configure /etc/network/interfaces

Do you have any tips or something I should look into?

EDIT2:

When I plug in my ethernet cable from PC to raspberry I can access it with SSH for a brief 5 second then the connection is shut down.

This is what ip a shows:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:e7:22:be brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.126/24 brd 192.168.1.255 scope global noprefixroute eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::9df9:aefa:d435:4c68/64 scope link
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:b2:77:eb brd ff:ff:ff:ff:ff:ff
    inet 10.3.141.1/24 brd 10.3.141.255 scope global noprefixroute wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::bf7e:a6b4:72eb:14cd/64 scope link
       valid_lft forever preferred_lft forever

ip r

default via 192.168.1.1 dev eth0 src 192.168.1.126 metric 202
default via 10.3.141.1 dev wlan0 src 10.3.141.1 metric 303
10.3.141.0/24 dev wlan0 proto dhcp scope link src 10.3.141.1 metric 303
192.168.1.0/24 dev eth0 proto dhcp scope link src 192.168.1.126 metric 202

When I say offline, I mean my computer AND my raspberry are both not connected to the internet/home network/router. The only physical connection I want is an ethernet cable connecting both devices.

Update:

When the RPI and the PC are connected together with an ethernet cable, Wireshark throws these messages from the raspberry:

Who has 192.168.1.1? Tell 192.168.1.126

Why is the raspberry trying to find the router? there isn't one...

1
  • What do yo mean by "offline"? What is connected to what? How did you "force a static IP address"? What does ip a; ip r show?
    – Milliways
    Apr 30, 2021 at 12:17

1 Answer 1

0

So by reading the last line of my post, it raised a question in my head:

When the RPI and the PC are connected together with an ethernet cable, Wireshark throws these messages from the raspberry:

Who has 192.168.1.1? Tell 192.168.1.126

Why is the raspberry trying to find the router? there isn't one..

I manually set the dhcp settings of my computer in adapter/IPv4 protocol, to a static gateway by default (same as the router the RPI is trying to find). My rasp would try to connect and somehow, it works fine now.

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.