Static IP entry for Raspberry PI not working?
Hello :),
I would like to assign a static IP address to my Raspberry Pi 5. I have a Huawei router that also offers this option, but when I create a rule that assigns an IP address to the Pi's MAC address, it doesn't work. The DHCP server's address range is set so that the IP address the Pi is supposed to receive doesn't fall within it (the range goes up to .253, and the Pi is supposed to receive .254). It gets the same address from the router every time I restart the Pi, etc., but never the address I chose myself. I've also tried creating a static entry on the Pi, but as soon as I restart the router, I can no longer connect to the Pi via cable (it's actually connected via a LAN cable). It doesn't work via Wi-Fi either. The MAC address entered on the router is 100% the same as the Pi's actual address, and I don't know what else to do. Regards
To assign static IP addresses to terminals is not an option of the router.
The fact that these clients requesting the addresses via an integrated DHCP server is, on the other hand, an option (or better function) of the router if it offers this.
The manual configuration of a terminal with IP addresses always works. If the router is DHCP, it has an address pool with IP addresses that it manages and distributes. These IPs should be avoided for manual assignment so that there are no conflicts.
Okay. Then you’ve already thought about using an IP outside the area.
If it receives an IP from the router, it has not received a manual (static) specification in its network configuration, but it still uses DHCP from the router.
Wasn’t that the target?
In addition to the IP address, the computer then needs its subnet mask, the router IP as gateway and at least one IP for the DNS server to be used. If the data is not complete, it may use the set IP, but has no connection to the network.
I said in the Config of PI what IP he should take, what is the default gateway (router) and what dns should be (also the router). only as soon as I restarted the router the PI has no longer joined. “Wasn’t that the target?” -> yes, that’s true only though I made an entry on the router with IP .253 and the MAC address from PI, the PI has not accepted it and does not refer it anymore after I restarted the router.
You write LAN connection and Wi-Fi connection of PI. You have to decide which 2 MAC addresses to receive xxx.xxx.xxx.254 from the DHCP server. If there is a ~cribable IP address anyway, as it is the last in the pool, 254 will be used for repeaters and other things (e.g. also as a default). Try another IP, for example 200, is also a nice number.
Both MAC addresses Wi-Fi and LAN of PI are Other, select/reserve the “right” MAC address. Whether two different network interfaces LAN-Mac and WLAN-MAC can lead to the same IP address can be doubted.
If the router restarts after such DHCP changes, maybe it will.
Good luck!
So I left my Pis the DHCP address and set these addresses permanently in the router. It’s been working for years. Isn’t that how you are?
Yes, this option then leads me to the settings for the static entries, which unfortunately does not work, but thanks:)
The Raspi stands for DHCP and in the router I set this IP permanently. My pi-hole and stubby have been working for years. Not in the Raspi Config. set a fixed IP.
Of course, the IP must be within the range
If you want to use DHCP. Not if you want to specify the IP statically on the terminal.
And probably something was done here by both….
At the Fritzbox it already works
I don’t think because I want the PI to always have .253 and if this IP is in the area, it can be that the DHCP server will pass this IP. However, if this IP is outside the area, the server cannot forgive it and there is no conflict, I thought.
I don’t know if the 253 on your router is a reserved IP.
And if you enter a free IP as a static IP in the server, it will no longer be dynamically assigned
Why not set up the fixed IP directly on the Pi?
I also tried what then worked for the first time only as soon as I restarted the router LAN did not go any more or he hasn’t joined. With WLAN, the whole entry on PI has not worked.
I use WLAN and static IP works very well with me.
Of course I also use an IP within the router area