Static IP makes network unusable.

Are you able to disable DHCP inside your router completely? If yes, PiHole could take over DHCP functionality. If not, there are ways to work around. At least as long as you are able to set/define DHCP range inside the router.

BTW: I highly recommend using a global upstream DNS provider inside the system running PiHole. Means, set STATIC IP and change DNS to something like Cloudflare or Quad9. This is just the DNS configuration for the DietPi system itself and has no impact on how PiHole will connect to upstream DNS server.

I’ve disabled the DHCP inside the router indeed.
Noted regarding the DNS setup for Dietpi itself I’ll change that as I could see it was still using the DNS of my ISP.

Thanks for your help guys - really much appreciated.

Ah whoops, 194.168.x.100 instead of 192.168.x.100, so no private but public IPs, eagle eye :smile:.

1 Like

Hello, i also have similar problem with static IP.
Device: BPI M5 (Debian 11, Dietpi 0.7.1)
Services: nextcloud, netdata
Additional info: No SSL, no domain, no specific network settings only basic DNS 8.8.8.8 (from DHCP)
Behavior: After start of the device it works (1 to 5 minutes), after some time it will stop work (ping or access to nextcloud), and systemctl status networking.service shows:
– networking.service: Main proces exited, code=exited, status=1/FAILURE
– Failed to start Raise network interfaces.

Sorry, i could not provide any copy of errors as telnet not work (only HDMI)
Right now i use Mikrotik hAP, so i could temporarly switch (dietpi) to DHCP and in router set parameters, so that specific MAC will only get one IP and leave everthing in DHCP

Can you share following for DHCP as well as STATIC IP

ip a

Hi, right now i cannot reproduce the wrong scenario.
I just reboored the device and ran ping 8.8.8.8 for like 15 minutes,
But here are

ip a

for DHCP and next one is for STATIC (working status)

ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    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
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 02:00:00:25:0f:01 brd ff:ff:ff:ff:ff:ff
    inet 192.168.90.4/24 brd 192.168.90.255 scope global dynamic eth0
       valid_lft 363sec preferred_lft 363sec
ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    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
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 02:00:00:25:0f:01 brd ff:ff:ff:ff:ff:ff
    inet 192.168.90.4/24 brd 192.168.90.255 scope global dynamic eth0
       valid_lft 575sec preferred_lft 575sec

EDIT: finally it crashed :slight_smile:
Here is

ip a

ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    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
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 02:00:00:25:0f:01 brd ff:ff:ff:ff:ff:ff

What exactly did this means? Do you have done anything, or did it stop working out of the box?

At least on the last ip -a information, ther no ip address assigned at all.

No it was only impatience, i wanted to answer as fast as possible but, it worked for some time.
Right now it stops working after 10 minutes, i have edited DHCP server on Mikrotik router.
In the router we have DHCP server which assign IP to a new device. The Lease Time was set to 10 minutes. When we set up BananaPi M5 to mode Static IP and give it an IP. It should keep that IP no matter what happens. But it looks like in boot process it connects as DHCP, then switch to STATIC mode, after 10 minutes it disconnects (last row in image below) and never connects back it is very strange.

Right now we use feature Make Static on router and leave dietpi in mode DHCP.
We will see if it will work

Did you assigned a static IP from within the DHCP range? Maybe the router has assigned the IP to another device leading to an IP address conflict. If you assign a static IP, address would need to be located outside DHCP range.

Ther router has multiple dhcp servers. Ethernet connections will get IP from router`s DHCP server (dhcp3) in range 192.168.90.2 to 192.168.90.254 where gateway will be 192.168.90.1/24
On the network there are already some devices in this ip range some of them have dynamically assigned IP, some use the feature Make Static (which basically let device get ip from router, but on that specific MAC, router will lock specific ip, so technically no other device should get that IP if MAC is not the same) and lastly some of the devices got dynamic IP assigned and later they were (e.g. in windows settings) switched to static IP (uplug cable and plug back, computer will get static IP)

If there will be another device with the same IP, it will not work from the boot of device.

We noticed that when we use dietpi-launcher to change eth0 status from dhcp to static or vice versa, it will not make change in /etc/network/interfaces.d/eth0 (it is always dhcp)

A typical DietPi system do not have that configuration. Our settings are done within /etc/network/interfaces. There might be a conflict if you have /etc/network/interfaces.d/eth0 trying to configure same interface.

I tried to change the settings manually in file /etc/network/interfaces, we will try to use another network device, with new configuration to see if something changes