Static IP setting ignored after package upgrades

The other day I ssh’ed into my piaware and ran an apt update and upgrade. Now it’s pulling a dynamic address on boot rather than honoring the static address that I’ve specified in the piaware-config. I’m sure I can just reflash the original image to fix it but I thought I’d first see if anyone else has experienced this and was able to resolve it without a full reset. Thanks!

1 Like

Check your settings in the bootconfig file

For a static wired IP address, add the following lines to the end of /boot/piaware-config.txt (edit addresses to match your subnet):

wired-type static
wired-address 192.168.1.202
wired-netmask 255.255.255.0
wired-broadcast 192.168.1.255
wired-gateway 192.168.1.1

Maybe your update has had an dhcpd package upgrade that overrules the settings you made earlier.
If that doesn’t work post your paiaware-config.txt file so we can determine what is going on.

Yep I confirmed that my settings in piaware-config.txt remain as they were before I ran the upgrade. I have the settings you describe in the file except they’re prefixed with wireless- because that’s what i’m using.

What does the command ifconfig tell you when you ssh into the equipment?
Is the interface name still the same ?
I sometimes see that wlan0 or eth0 getting renamed.
If the interface name is still the same, please post your dhcpcd.conf file to see what is defined there

Yes, it remains wlan0. Here are the contents of the dhcpcd.conf file:

# Generated automatically by /usr/lib/piaware-support/generate-network-config
# This file will be overwritten on reboot.

# Defaults based on those shipped with Raspbian.

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

# Persist interface configuration when dhcpcd exits.
persistent

# Rapid commit support
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 Stable Private IPv6 Addresses based from the DUID
slaac private

# 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, set 'allow-dhcp-duid no' in piaware-config.txt
duid

denyinterfaces eth0

I’ve always set my fixed IP address in the /etc/dhcpcd.conf file and not in any piaware config file.

There is an example hashed out so can use that, changing subnet if yours is different.

That may resolve your issue.

Geoff

What’s the output of piaware-config?

@obj here is the output of piaware-config, redacted for security:

allow-auto-updates             yes                            # value set at /boot/piaware-config.txt:72
allow-manual-updates           yes                            # value set at /boot/piaware-config.txt:76
allow-mlat                     yes                            # value set at /boot/piaware-config.txt:80
allow-modeac                   yes                            # value set at /boot/piaware-config.txt:84
image-type                     piaware                        # value set at /usr/share/piaware-support/piaware-image-config.txt:5
manage-config                  yes                            # value set at /usr/share/piaware-support/piaware-image-config.txt:4
network-config-style           buster                         # value set at /usr/share/piaware-support/piaware-image-config.txt:6
rtlsdr-gain                    max                            # value set at /boot/piaware-config.txt:65
wired-network                  no                             # value set at /boot/piaware-config.txt:27
wireless-address               xxx.xxx.xxx.3                  # value set at /boot/piaware-config.txt:51
wireless-gateway               xxx.xxx.xxx.1                  # value set at /boot/piaware-config.txt:53
wireless-nameservers           xxx.xxx.xxx.1                  # value set at /boot/piaware-config.txt:54
wireless-netmask               255.255.255.0                  # value set at /boot/piaware-config.txt:52
wireless-network               yes                            # value set at /boot/piaware-config.txt:33
wireless-password              <hidden>                       # value set at /boot/piaware-config.txt:49
wireless-ssid                  <hidden>                       # value set at /boot/piaware-config.txt:48
wireless-type                  static                         # value set at /boot/piaware-config.txt:50

That seems fine. Can you run sudo /usr/lib/piaware-support/generate-network-config and see what it says?

Output of running generate-network-config:

Updating /etc/apt/apt.conf.d/50http-proxy ..
Updating /etc/dhcpcd.conf ..
Updating /etc/wpa_supplicant/wpa_supplicant.conf ..

Contents of dhcpcd.conf:

# Generated automatically by /usr/lib/piaware-support/generate-network-config
# This file will be overwritten on reboot.

# Defaults based on those shipped with Raspbian.

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

# Persist interface configuration when dhcpcd exits.
persistent

# Rapid commit support
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 Stable Private IPv6 Addresses based from the DUID
slaac private

# 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, set 'allow-dhcp-duid no' in piaware-config.txt
duid

denyinterfaces eth0

interface wlan0
# static address, no DHCP
static ip_address=xxx.xxx.xxx.3
static subnet_mask=255.255.255.0
static routers=xxx.xxx.xxx.1
static domain_name_servers=xxx.xxx.xxx.1

and the contents of wpa_supplicant.conf:

# Generated automatically by /usr/lib/piaware-support/generate-network-config
# This file will be overwritten on reboot.
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
country=00
network={
  ssid="<hidden>"
  scan_ssid=1
  key_mgmt=WPA-PSK
  psk="<hidden>"
}

I mean, that now looks correct (and is different to what was posted earlier) – does it actually assign a static IP now?

@obj after reboot it remained on the dynamic address and everything after the denyinterfaces line disappeared

That’s… very weird. If it reverted then either (a) your sdcard is having trouble with writes or (b) the config was regenerated, but for some reason the boot-time generation sees a different piaware-config state to what you see after it’s done (but not a “blank” state either!)

I’d try reimaging if you don’t have anything you need to preserve. And maybe try a different sdcard…

1 Like

@obj thanks for trying. It won’t be a problem to reflash a different card. I’ll come back and post it here if I ever do figure out what the heck is going on.

Yep I’m curious what’s going on there as well :wink:

Following this instructions sudo /usr/lib/piaware-support/generate-network-config corrected the issue on my SDCard piaware setup. Thank you!

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.