hary
Posts: 75
Joined: Wed Jan 18, 2017 8:17 am

Raspberry pi 4 stick on strange IP, even when static ip has been set from internet router

Sat Feb 22, 2020 9:13 am

Hi

I don't know what happened on my almost new install of BUSTER, but I can't get my raspberry pi 4/BUSTER on the static IP address I've set from my router.

I'm now quite used to assign a static IP address to my Pi from my DHCP router to easily reach (with ssh, VNC) my Pi locally or even from outside my LAN by opening/redirecting the right ports to the PI (ssh/22, VNC/5900, and so on for all my other services running on my Pi) and thanks to NOIP DNS service.

Now, I can't explain what happened but the Pi sticks to the IP 192.168.1.4, an IP that I never specified anywhere. It does it for both eth0 and wlan0.

The install is almost brand new. It was working ok at first. I installed some docker container following https://github.com/gcgarner/IOTstack. It was still working ok for some time. And now for no obvious reason, I get that static IP address problem.

Would it be possible to get help to solve that nex problem.

Code: Select all

[email protected]:~ $ sudo service dhcpcd status
● dhcpcd.service - dhcpcd on all interfaces
   Loaded: loaded (/lib/systemd/system/dhcpcd.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2020-02-22 07:39:39 CET; 1h 51min ago
  Process: 365 ExecStart=/usr/lib/dhcpcd5/dhcpcd -q -b (code=exited, status=0/SUCCESS)
 Main PID: 400 (dhcpcd)
    Tasks: 2 (limit: 4915)
   Memory: 6.5M
   CGroup: /system.slice/dhcpcd.service
           ├─400 /sbin/dhcpcd -q -b
           └─491 wpa_supplicant -B -c/etc/wpa_supplicant/wpa_supplicant.conf -iwlan0 -Dnl80211,wext

févr. 22 09:31:08 raspberrypi dhcpcd[400]: eth0: received approval for 192.168.1.4
févr. 22 09:31:08 raspberrypi dhcpcd[400]: eth0: received approval for 192.168.1.4
févr. 22 09:31:08 raspberrypi dhcpcd[400]: eth0: received approval for 192.168.1.4
févr. 22 09:31:08 raspberrypi dhcpcd[400]: eth0: received approval for 192.168.1.4
févr. 22 09:31:08 raspberrypi dhcpcd[400]: eth0: received approval for 192.168.1.4
févr. 22 09:31:08 raspberrypi dhcpcd[400]: eth0: received approval for 192.168.1.4
févr. 22 09:31:09 raspberrypi dhcpcd[400]: eth0: received approval for 192.168.1.4
févr. 22 09:31:09 raspberrypi dhcpcd[400]: eth0: received approval for 192.168.1.4
févr. 22 09:31:09 raspberrypi dhcpcd[400]: eth0: received approval for 192.168.1.4
févr. 22 09:31:09 raspberrypi dhcpcd[400]: eth0: received approval for 192.168.1.4
[email protected]:~ $ cat /etc/dhcpcd.conf 
# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.

# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel

# Inform the DHCP server of our hostname for DDNS.
hostname

# Use the hardware address of the interface for the Client ID.
clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
# Some non-RFC compliant DHCP servers do not reply with this set.
# In this case, comment out duid and enable clientid above.
#duid

# Persist interface configuration when dhcpcd exits.
persistent

# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit

# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Respect the network MTU. This is applied to DHCP routes.
option interface_mtu

# Most distributions have NTP support.
#option ntp_servers

# A ServerID is required by RFC2131.
require dhcp_server_identifier

# Generate SLAAC address using the Hardware Address of the interface
#slaac hwaddr
# OR generate Stable Private IPv6 Addresses based from the DUID
slaac private

# Example static IP configuration:
#interface eth0
#static ip_address=192.168.0.10/24
#static ip6_address=fd51:42f8:caae:d92e::ff/64
#static routers=192.168.0.1
#static domain_name_servers=192.168.0.1 8.8.8.8 fd51:42f8:caae:d92e::1

# It is possible to fall back to a static IP if DHCP fails:
# define static profile
#profile static_eth0
#static ip_address=192.168.1.23/24
#static routers=192.168.1.1
#static domain_name_servers=192.168.1.1

# fallback to static profile on eth0
#interface eth0
#fallback static_eth0

SSID SBMS-120
inform 192.168.1.4

SSID SBMS-120
inform 192.168.1.4

SSID SBMS-120
inform 192.168.1.4
[email protected]:~ $ ifconfig
br-aa8d4f84806f: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.18.0.1  netmask 255.255.0.0  broadcast 172.18.255.255
        inet6 fe80::42:f9ff:febf:820c  prefixlen 64  scopeid 0x20<link>
        ether 02:42:f9:bf:82:0c  txqueuelen 0  (Ethernet)
        RX packets 1042  bytes 70250 (68.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1435  bytes 1815805 (1.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        ether 02:42:60:e7:8a:9f  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.4  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::4b24:8adf:4cdc:50f6  prefixlen 64  scopeid 0x20<link>
        ether dc:a6:32:2f:6a:fe  txqueuelen 1000  (Ethernet)
        RX packets 53817  bytes 31062924 (29.6 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 78960  bytes 15218321 (14.5 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Boucle locale)
        RX packets 9  bytes 524 (524.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 9  bytes 524 (524.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.4  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::e6b0:70cc:eecb:dcef  prefixlen 64  scopeid 0x20<link>
        ether dc:a6:32:2f:6a:ff  txqueuelen 1000  (Ethernet)
        RX packets 51580  bytes 10526750 (10.0 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 225  bytes 57094 (55.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

pcmanbob
Posts: 8348
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Raspberry pi 4 stick on strange IP, even when static ip has been set from internet router

Sat Feb 22, 2020 9:26 am

looking at what I assume is you dhcpcd.conf file you appear to have 3 entries for IP 192.168.1.4 at the end of the file.

Code: Select all


# fallback to static profile on eth0
#interface eth0
#fallback static_eth0

SSID SBMS-120
inform 192.168.1.4      <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

SSID SBMS-120
inform 192.168.1.4      <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

SSID SBMS-120
inform 192.168.1.4      <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
so that's were you 192.168.1.4 static IP is coming from, try commenting the 6 lines out and then reboot your pi that should remove the static IP in question.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

User avatar
B.Goode
Posts: 9602
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Raspberry pi 4 stick on strange IP, even when static ip has been set from internet router

Sat Feb 22, 2020 9:30 am

For troubleshooting purposes, I suggest repeating what you have already tried.


Install a fresh version of the current Raspbian Buster Operating System on a new or spare microSD card.

Run that unmodified OS for some time to see if the problem recurs.

If all seems ok, add the third-party software.

If it then breaks it seems your source of support should be the developer/maintainer of that add-on software...
https://github.com/gcgarner/IOTstack/issues

hary
Posts: 75
Joined: Wed Jan 18, 2017 8:17 am

Re: Raspberry pi 4 stick on strange IP, even when static ip has been set from internet router

Sat Feb 22, 2020 12:55 pm

pcmanbob wrote:
Sat Feb 22, 2020 9:26 am
looking at what I assume is you dhcpcd.conf file you appear to have 3 entries for IP 192.168.1.4 at the end of the file.

Code: Select all


# fallback to static profile on eth0
#interface eth0
#fallback static_eth0

SSID SBMS-120
inform 192.168.1.4      <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

SSID SBMS-120
inform 192.168.1.4      <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

SSID SBMS-120
inform 192.168.1.4      <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
so that's were you 192.168.1.4 static IP is coming from, try commenting the 6 lines out and then reboot your pi that should remove the static IP in question.
SBMS-120 as static IP on its own 192.168.4.1 and I'm supposed to reach it only from a PC connected to that IP. I don't know how to explain, but SBMS-120 isn't meant to connect to a router, I can only connect to it from a close by PC wifi interface (this is for security purpose). SBMS-120 is an IOT like items that isn't supposed to be accessed from outside the house's , so its IP is set to another subnet (192.168.4.0/24 instead of 192.168.1.0/24)
I have no explanation why it's showing that 3 lines
"SSID SBMS-120
inform 192.168.1.4 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
as its static IP is supposed to be 192.168.4.1. I have no way to set that IP, the device always (should) show that IP (192.168.4.1) with no way to modify it.

This 192.168.1.4 IP showing everywhere is very strange.
B.Goode wrote: For troubleshooting purposes, I suggest repeating what you have already tried.


Install a fresh version of the current Raspbian Buster Operating System on a new or spare microSD card.

Run that unmodified OS for some time to see if the problem recurs.

If all seems ok, add the third-party software.

If it then breaks it seems your source of support should be the developer/maintainer of that add-on software...
https://github.com/gcgarner/IOTstack/issues
I'll prepare a new clean install.

edit :
@pcmanbob
I've supressed the 6 lines you've said and .... eth0 and wlan0 IPs went back to normal, they get back the IP assigned from my router's DHCP. Good.
But what added these 6 line to that dhcpcd.conf file ? I've never touched it before !

Now last point. I should be able to disconnect the Pi from the router (wlan0), then connect it to the other subnet SBMS-120 at the IP 192.168.4.1 but that seems not possible.

In the Wifi network available, I can see my router and the SBMS-120 SSID but I still cannot connect to SBMS-120 at 192.168.4.1.
Maybe there is still something that has been modified in an unknown.conf file.

pcmanbob
Posts: 8348
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Raspberry pi 4 stick on strange IP, even when static ip has been set from internet router

Sat Feb 22, 2020 1:30 pm

hary wrote:
Sat Feb 22, 2020 12:55 pm

But what added these 6 line to that dhcpcd.conf file ? I've never touched it before
I suspect what ever you installed when you did this " I installed some docker container following https://github.com/gcgarner/IOTstack. "

Now last point. I should be able to disconnect the Pi from the router (wlan0), then connect it to the other subnet SBMS-120 at the IP 192.168.4.1 but that seems not possible.

In the Wifi network available, I can see my router and the SBMS-120 SSID but I still cannot connect to SBMS-120 at 192.168.4.1.
Maybe there is still something that has been modified in an unknown.conf file.
I have no idea you should probably ask the person that created the tutorial that you are following or the owner/maintainer of the software you are installing as @B.Goode has already suggested.
B.Goode wrote:
Sat Feb 22, 2020 9:30 am
If it then breaks it seems your source of support should be the developer/maintainer of that add-on software...
https://github.com/gcgarner/IOTstack/issues
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

hary
Posts: 75
Joined: Wed Jan 18, 2017 8:17 am

Re: Raspberry pi 4 stick on strange IP, even when static ip has been set from internet router

Sat Feb 22, 2020 4:17 pm

Is there a way to find all files related to wifi ?

I would like replace all wifi related files with some from a working SD card.

I've already replaced ;
/etc/wpa_supplicant/wpa_supplicant.conf
/etc/dhcpcd.conf
/etc/dhcp with all the files inside in a recursive way

with brand new files, but it doesn't bring back my wifi to work.

User avatar
B.Goode
Posts: 9602
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Raspberry pi 4 stick on strange IP, even when static ip has been set from internet router

Sat Feb 22, 2020 4:48 pm

hary wrote:
Sat Feb 22, 2020 4:17 pm
Is there a way to find all files related to wifi ?

I would like replace all wifi related files with some from a working SD card.

I've already replaced ;
/etc/wpa_supplicant/wpa_supplicant.conf
/etc/dhcpcd.conf
/etc/dhcp with all the files inside in a recursive way

with brand new files, but it doesn't bring back my wifi to work.


If you
Install a fresh version of the current Raspbian Buster Operating System on a new or spare microSD card
as suggested, that will replace all the related files...



Edit: to add, for anyone with the specialised skills to assist - this is not a script that simply configures a basic Raspbian installation. It provides tools to configure, build and run something based on Docker containers.

I don't have experience in that area, so I have nothing further to contribute.
Last edited by B.Goode on Sat Feb 22, 2020 5:59 pm, edited 1 time in total.

hary
Posts: 75
Joined: Wed Jan 18, 2017 8:17 am

Re: Raspberry pi 4 stick on strange IP, even when static ip has been set from internet router

Sat Feb 22, 2020 5:48 pm

He He !
Yes, of course, but trying to fix things help to understand what's going on ....

epoch1970
Posts: 4482
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Raspberry pi 4 stick on strange IP, even when static ip has been set from internet router

Sat Feb 22, 2020 6:03 pm

Let me tell you what's going on.
You're using Docker by merely running images without checking what they do. Not good.
Worse than that, you're using that IOTthing which seems to be some sort of wrapper (not too tidy by the look of things) over Docker commands.

So this happens: You have a good working machine, you type one macro-command, the thing does something stupid and wrecks your host config files. So your container doesn't work, and neither does the host.

My advice, too, would be to restart from a clean system. Install docker, follow the tutorials they provide. Once you have a hang of how docker works, look again at what value that IOTstack really offers. I bet it's pretty thin.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

hary
Posts: 75
Joined: Wed Jan 18, 2017 8:17 am

Re: Raspberry pi 4 stick on strange IP, even when static ip has been set from internet router

Sat Feb 22, 2020 9:39 pm

I'm not exactly using that IOT thing witj docker command

Actualy, what I called the IOTthing work as an AP and has nothing to do with the docker things I try to make working.
The only reason I've been talking about these 2 things is because I didn't know what happened when the RPi went wrong, so I tried to give the more details I could.

That's right that the docker IOTstack was running at the moment I tried to connect to the SBMS-120 AP thing, but despite being on the same machine, that was 2 different things.

Now, I put a new brand new install in the RPi and it works the same as the previous one : every came back to normal, except I cannont connect back to the SBMS-120, but I tried from another computer and same connection problem ...

So there mighht be also smething wrong on that SBMS-120 device now.

But in fact, it means that my old BUSTER that I tried to fix with the solution given by pcmanbob in the second post was sufficent to fix the problem.

By the way, do you mean I should be aware of certain risk of using docker ?
Trying it is the only way to learn an dunderstand sometimes ...

epoch1970
Posts: 4482
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Raspberry pi 4 stick on strange IP, even when static ip has been set from internet router

Sun Feb 23, 2020 11:02 am

Bugs aside, there is nothing inherently wrong with docker in itself. It is used and scrutinized by a large community.
Running an unknown image coming from an unknown source is evidently a risk. Prefer “official” images from docker hub or build your own. For 1/3 parties, “inspect” images, take a look at the dockerfile(s) and the source repositories to get an idea of what they might actually do once they run.

Due to the intricacies of how WiFi interfaces work, using a WiFi adapter in a container is tricky. Quite possibly the container would require to run in host networking mode (option network=host), with elevated privileges.
This means the processes in the container use the network interfaces of the host directly, like regular applications would.

Upon further inspection it appears iotstack pulls something called rpieasy. That thing is another stack of python scripts supposed to make things “easy”. I’ve spotted at least one script in there that modifies dhcpcd.conf...
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

ganzgustav22
Posts: 34
Joined: Tue Feb 11, 2020 1:04 pm

Re: Raspberry pi 4 stick on strange IP, even when static ip has been set from internet router

Mon Feb 24, 2020 10:32 am

I've experienced similar behaviour when trying to configure interfaces via the "old" method (i.e. as it has been with Debian since it at least Debian 2.0, putting the interface configuration in /etc/network/interfaces).

It's not visible with ifconfig, but with "ip a" you can see the second IP address.
I am a non-medical doctor.

Return to “General discussion”