Ifup service showing error

My intel nuc is not change DHCP to static LAN ip. in logs it shows me ifup service fail

root@nuc:~# systemctl status ifup@eth0
× ifup@eth0.service - ifup for eth0
     Loaded: loaded (/lib/systemd/system/ifup@.service; static)
    Drop-In: /etc/systemd/system/ifup@.service.d
             └─dietpi.conf
     Active: failed (Result: exit-code) since Sat 2024-06-22 19:30:24 MDT; 32min ago
    Process: 1880 ExecStart=/sbin/ifup --allow=hotplug eth0 (code=exited, status=1/FAILURE)
   Main PID: 1880 (code=exited, status=1/FAILURE)
        CPU: 142ms

Can you share following

journalctl -u ifup*
Jun 23 10:03:44 XXX.YYY.xyz systemd[1]: Failed to start ifup@eth0.service - ifup for eth0.
Jun 23 10:04:07 XXX.YYY.xyz systemd[1]: Starting ifup@eth0.service - ifup for eth0...
Jun 23 10:04:07 XXX.YYY.xyz dhclient[11571]: Internet Systems Consortium DHCP Client 4.4.3-P1
Jun 23 10:04:07 XXX.YYY.xyz ifup[11571]: Internet Systems Consortium DHCP Client 4.4.3-P1
Jun 23 10:04:07 XXX.YYY.xyz ifup[11571]: Copyright 2004-2022 Internet Systems Consortium.
Jun 23 10:04:07 XXX.YYY.xyz ifup[11571]: All rights reserved.
Jun 23 10:04:07 XXX.YYY.xyz ifup[11571]: For info, please visit https://www.isc.org/software/dhcp/
Jun 23 10:04:07 XXX.YYY.xyz dhclient[11571]: Copyright 2004-2022 Internet Systems Consortium.
Jun 23 10:04:07 XXX.YYY.xyz dhclient[11571]: All rights reserved.
Jun 23 10:04:07 XXX.YYY.xyz dhclient[11571]: For info, please visit https://www.isc.org/software/dhcp/
Jun 23 10:04:07 XXX.YYY.xyz dhclient[11571]:
Jun 23 10:04:07 XXX.YYY.xyz dhclient[11571]: Listening on LPF/eth0/80:ee:73:af:50:65
Jun 23 10:04:07 XXX.YYY.xyz ifup[11571]: Listening on LPF/eth0/80:ee:73:af:50:65
Jun 23 10:04:07 XXX.YYY.xyz ifup[11571]: Sending on   LPF/eth0/80:ee:73:af:50:65
Jun 23 10:04:07 XXX.YYY.xyz ifup[11571]: Sending on   Socket/fallback
Jun 23 10:04:07 XXX.YYY.xyz dhclient[11571]: Sending on   LPF/eth0/80:ee:73:af:50:65
Jun 23 10:04:07 XXX.YYY.xyz ifup[11571]: DHCPREQUEST for 10.0.0.10 on eth0 to 255.255.255.255 port 67
Jun 23 10:04:07 XXX.YYY.xyz dhclient[11571]: Sending on   Socket/fallback
Jun 23 10:04:07 XXX.YYY.xyz dhclient[11571]: DHCPREQUEST for 10.0.0.10 on eth0 to 255.255.255.255 port 67
Jun 23 10:04:07 XXX.YYY.xyz dhclient[11571]: DHCPACK of 10.0.0.10 from 10.0.0.1
Jun 23 10:04:07 XXX.YYY.xyz ifup[11571]: DHCPACK of 10.0.0.10 from 10.0.0.1
Jun 23 10:04:07 XXX.YYY.xyz ifup[11579]: RTNETLINK answers: File exists
Jun 23 10:04:07 XXX.YYY.xyz dhclient[11571]: bound to 10.0.0.10 -- renewal in 74071 seconds.
Jun 23 10:04:07 XXX.YYY.xyz ifup[11571]: bound to 10.0.0.10 -- renewal in 74071 seconds.
Jun 23 10:04:07 XXX.YYY.xyz ifup[11611]: RTNETLINK answers: File exists
Jun 23 10:04:07 XXX.YYY.xyz ifup[11563]: ifup: failed to bring up eth0
Jun 23 10:04:07 XXX.YYY.xyz systemd[1]: ifup@eth0.service: Main process exited, code=exited, status=1/FAILURE
Jun 23 10:04:07 XXX.YYY.xyz systemd[1]: ifup@eth0.service: Failed with result 'exit-code'.
Jun 23 10:04:07 XXX.YYY.xyz systemd[1]: Failed to start ifup@eth0.service - ifup for eth0.

can you share your current interface configuration

cat /etc/network/interfaces

my system is directly connected via eithernet wire & no wireless connection

root@nuc:~# cat /etc/network/interfaces
# Location: /etc/network/interfaces
# Please modify network settings via: dietpi-config
# Or create your own drop-ins in: /etc/network/interfaces.d/

# Drop-in configs
source interfaces.d/*

# Ethernet
allow-hotplug eth0
iface eth0 inet static
address 10.0.0.10
netmask 255.255.255.0
gateway 10.0.0.1
#dns-nameservers 1.1.1.1 1.0.0.1

# WiFi
#allow-hotplug wlan0
iface wlan0 inet dhcp
address 192.168.0.100
netmask 255.255.255.0
gateway 192.168.0.1
#dns-nameservers 64.59.135.135 64.59.128.112
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

through routher dhcp[ reservation this machine lan ip 10.0.0.10, & router/gateway 10.0.0.1. i am able to ssh via local machines.

interface seems to be set to static but you are running a DHCP client as well.

Question: should it be static or DHCP??

i want to use static, but system fail each time while i gave the execution command through dietpi-config, network adapter GUI

can you check following

dpkg -l | grep dhcp

I still have some ??? If you switch to STATIC IP, your system is booting still but you are not able to connect? Or is it possible to connect via SSH still?

root@nuc:~# dpkg -l | grep dhcp
ii  isc-dhcp-client               4.4.3-P1-2                     amd64        DHCP client for automatically obtaining an IP address

i am able to ssh the system. but system not switching dhcp to static through dietpi gui & while i gave command process exit with error. locally my system available 10.0.0.10.

that should be fine.

let’s put dietpi-config aside.

/etc/network/interfaces is chowing iface eth0 inet static still? Correct? And on a reboot, you see dhclient request within system log?

this is my file

root@nuc:~# cat /etc/network/interfaces
# Location: /etc/network/interfaces
# Please modify network settings via: dietpi-config
# Or create your own drop-ins in: /etc/network/interfaces.d/

# Drop-in configs
source interfaces.d/*

# Ethernet
allow-hotplug eth0
iface eth0 inet static
address 10.0.0.10
netmask 255.255.255.0
gateway 10.0.0.1
#dns-nameservers 1.1.1.1 1.0.0.1

# WiFi
#allow-hotplug wlan0
iface wlan0 inet dhcp
address 192.168.0.100
netmask 255.255.255.0
gateway 192.168.0.1
#dns-nameservers 64.59.135.135 64.59.128.112
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

i am going to reboot system, what thing/command you want to execute after reboot?

journalctl -u ifup*
root@nuc:~# journalctl -u ifup*
Jun 24 09:51:08 XXX.XXX.XXX systemd[1]: Starting ifupdown-pre.service - Helper to synchronize boot up for ifupdown...
Jun 24 09:51:09 XXX.XXX.XXX systemd[1]: Finished ifupdown-pre.service - Helper to synchronize boot up for ifupdown.
Jun 24 09:51:10 XXX.XXX.XXX systemd[1]: Starting ifup@eth0.service - ifup for eth0...
Jun 24 09:51:10 XXX.XXX.XXX dhclient[423]: Internet Systems Consortium DHCP Client 4.4.3-P1
Jun 24 09:51:10 XXX.XXX.XXX ifup[423]: Internet Systems Consortium DHCP Client 4.4.3-P1
Jun 24 09:51:10 XXX.XXX.XXX ifup[423]: Copyright 2004-2022 Internet Systems Consortium.
Jun 24 09:51:10 XXX.XXX.XXX ifup[423]: All rights reserved.
Jun 24 09:51:10 XXX.XXX.XXX ifup[423]: For info, please visit https://www.isc.org/software/dhcp/
Jun 24 09:51:10 XXX.XXX.XXX dhclient[423]: Copyright 2004-2022 Internet Systems Consortium.
Jun 24 09:51:10 XXX.XXX.XXX dhclient[423]: All rights reserved.
Jun 24 09:51:10 XXX.XXX.XXX dhclient[423]: For info, please visit https://www.isc.org/software/dhcp/
Jun 24 09:51:10 XXX.XXX.XXX dhclient[423]:
Jun 24 09:51:10 XXX.XXX.XXX dhclient[423]: Listening on LPF/eth0/80:ee:73:af:50:65
Jun 24 09:51:10 XXX.XXX.XXX ifup[423]: Listening on LPF/eth0/80:ee:73:af:50:65
Jun 24 09:51:10 XXX.XXX.XXX ifup[423]: Sending on   LPF/eth0/80:ee:73:af:50:65
Jun 24 09:51:10 XXX.XXX.XXX ifup[423]: Sending on   Socket/fallback
Jun 24 09:51:10 XXX.XXX.XXX dhclient[423]: Sending on   LPF/eth0/80:ee:73:af:50:65
Jun 24 09:51:10 XXX.XXX.XXX ifup[423]: DHCPREQUEST for 10.0.0.10 on eth0 to 255.255.255.255 port 67
Jun 24 09:51:10 XXX.XXX.XXX dhclient[423]: Sending on   Socket/fallback
Jun 24 09:51:10 XXX.XXX.XXX dhclient[423]: DHCPREQUEST for 10.0.0.10 on eth0 to 255.255.255.255 port 67
Jun 24 09:51:15 XXX.XXX.XXX dhclient[423]: DHCPREQUEST for 10.0.0.10 on eth0 to 255.255.255.255 port 67
Jun 24 09:51:15 XXX.XXX.XXX ifup[423]: DHCPREQUEST for 10.0.0.10 on eth0 to 255.255.255.255 port 67
Jun 24 09:51:15 XXX.XXX.XXX dhclient[423]: DHCPACK of 10.0.0.10 from 10.0.0.1
Jun 24 09:51:15 XXX.XXX.XXX ifup[423]: DHCPACK of 10.0.0.10 from 10.0.0.1
Jun 24 09:51:15 XXX.XXX.XXX dhclient[423]: bound to 10.0.0.10 -- renewal in 73019 seconds.
Jun 24 09:51:15 XXX.XXX.XXX ifup[423]: bound to 10.0.0.10 -- renewal in 73019 seconds.
Jun 24 09:51:16 XXX.XXX.XXX ifup[474]: RTNETLINK answers: File exists
Jun 24 09:51:16 XXX.XXX.XXX ifup[409]: ifup: failed to bring up eth0
Jun 24 09:51:16 XXX.XXX.XXX systemd[1]: ifup@eth0.service: Main process exited, code=exited, status=1/FAILURE
Jun 24 09:51:16 XXX.XXX.XXX systemd[1]: ifup@eth0.service: Failed with result 'exit-code'.
Jun 24 09:51:16 XXX.XXX.XXX systemd[1]: Failed to start ifup@eth0.service - ifup for eth0.
root@nuc:~#

Ok, let’s check if there is a conflicting Ethernet configuration file

ls -la /etc/network/interfaces.d/

still strange that an IP address is request via DHCP while the interface has been set to STATIC

root@nuc:~# ls -la /etc/network/interfaces.d/
total 12
drwxr-xr-x 2 root root 4096 Nov  6  2023 .
drwxr-xr-x 7 root root 4096 Jun 24 09:48 ..
-rw-r--r-- 1 root root   54 Nov  6  2023 eth0

Wuppsi did you recall something happening on November 6th 2023?

There a concurrent eth0 configuration has been created. At least our tools are not able to do so :wink:

Let’s see what is inside

cat /etc/network/interfaces.d/eth0
root@nuc:~# cat /etc/network/interfaces.d/eth0
auto eth0
iface eth0 inet dhcp
        ethernet-wol g

my system this time doing Wake over lan, i guess these items may be come that time configuring WOL

You would need to remove that file if not needed.

thanks, i remove the file and reboot after that system looks works ok now

root@nuc:~# systemctl status ifup@eth0
● ifup@eth0.service - ifup for eth0
     Loaded: loaded (/lib/systemd/system/ifup@.service; static)
    Drop-In: /etc/systemd/system/ifup@.service.d
             └─dietpi.conf
     Active: active (exited) since Mon 2024-06-24 12:22:59 MDT; 1min 33s ago
    Process: 411 ExecStart=/sbin/ifup --allow=hotplug eth0 (code=exited, status=0/SUCCESS)
   Main PID: 411 (code=exited, status=0/SUCCESS)
        CPU: 109ms

Jun 24 12:22:59 XXX.XXX.XXX systemd[1]: Starting ifup@eth0.service - ifup for eth0...
Jun 24 12:22:59 XXX.XXX.XXX systemd[1]: Finished ifup@eth0.service - ifup for eth0.

Please somebody suggest me eth0 file compatible to dietpi. as this file allow WOL capability to PC.
`

root@nuc:~# cat /etc/network/interfaces.d/eth0
auto eth0
iface eth0 inet dhcp
        ethernet-wol g

`
this time this file make machine WOL compatible but interfere with static/DHCP LAN ip address functionality of dietpi. please suggest the edited version of this file which compatible with dietpi & make PC WOL ready. thanks