Keep the same IP

I am trying to make the DHCP to keep the same IP to my devices in the network, but, even when I add them on the list, they don’t renew with the edited IP that I want.
Plus, there is no way to force them to renew the IP from DHCP server end.

Any ideas?

IPs leased from the fixed leases pool are handed out based on the set of (MAC,IP) relations.
Means same MAC gets same IP at each request.
DHCP protocol defines a maximal lease time ( it is set in the DHCP WUI page):
DHCP clients should renew their lease some time in the second half of this period. The server ( IPFire ) can not force this. But the relation (MAC;IP) for fixed leases doesn’t time out. So a misbehaving DHCP client does not invalidate the client IP, if the fixed leases definition is unaltered.

2 Likes

If the wifi devices are yours.
In Andriod phone select the your local wifi settings.
and you can shut off the use of random MAC address.
Do not know about Iphones.
this will use the Phone MAC on the selected wifi. and random everywhere else.

2 Likes

I have upgraded one of my Ubuntu PCs and that now gets a random MAC, even on Ethernet connection.
Why is this the default behavior, blows my mind…

1 Like

Harder to track your device. if using public wifi.
Probably why Google is going to us Browser finger printing.

The Randomized MAC address is of no interest behind a firewall like IPFire.

To “Force” devices to use a Fixed DHCP address, I only declare fixed leases and leave empty the Start and End fields.

To add a new device, I “force” a single address, the one I want to assign to it in Start and End fields and then I add it in Fixed leases.

Then add the MAC address in Wireless Configuration (If Blue network used) and the IP in Hosts

And finally declare in Firewall Groups and Rules the specific rules for this device

Note : Even though the address is randomized, my mobiles always use the same MAC address on my Wifi network (as long as it is not declared forgotten).

1 Like

I wish they would stop fiddling with that.

Ok, here is the fix:

if you have 00-macrandomize.conf in /etc/NetworkManager/conf.d then you or an automatic script created that file. Delete it.

if not present, create file:

30-randomize-mac-address.conf

in /etc/NetworkManager/conf.d/

with the fallowing code:

[device-mac-randomization]
wifi.scan-rand-mac-address=no

[connection-mac-randomization]
ethernet.cloned-mac-address=preserve
wifi.cloned-mac-address=preserve 

Also if you have these entries in

/etc/NetworkManager/NetworkManager.conf

modify the entries with the same value as above.

1 Like

Windows at least is asking me about the network if it is public or private and acts accordingly.

I guess Ubuntu are trying to make it harder to host servers on our own computers…

My wireless devices started to use by default random MACs.
Even if their names are unique, I cannot add them as fixed leases based on their declared names.
Ubuntu started to do this on Ethernet connection too… because “muah, mo safe”

Its more like a developer fiddling with a new function to see how well its received or what settings it needs to be in the future. That is why I only use LTS versions of their OS, because they do that stuff with their experimental branch occasionally.

2 Likes

Force the specific IP to each device:

  • DHCP server gives each device ( identified by MAC ) a specific IP → fixed leases implement this
  • each device identifies by a fixed MAC → isn’t given by ‘MAC randomizing’, same MAC in a network isn’t guaranteed.
1 Like

yes, but the client machine is running an experimental 7.1 module that
can randomise the mac address of the interface at boot up and/or change the mac address after connection is being established. So this breaks the DHCP reservation - MAC control mechanism.

1 Like
~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 24.04.1 LTS
Release:        24.04
Codename:       noble