I have an installation of openSUSE 15.4 with NetworkManager. It is configured with a dynamic IP address. I noticed that every 1 or 2 days NetworkManager for some reason changes the assigned IP address. If the computer has been left up for more than 24 hours, then the IP address changes during a session. This causes my ssh connections to freeze and time out. I would like to find out how to stop the dynamic IP address from changing spontaneously. The installation is a desktop computer with wired ethernet.
This is what I find in the log file after the IP change happens:
2024-03-04T10:08:56.981665-08:00 venere avahi-daemon[684]: Withdrawing address record for 192.168.1.112 on eth1.
2024-03-04T10:08:56.981791-08:00 venere avahi-daemon[684]: Leaving mDNS multicast group on interface eth1.IPv4 with address 192.168.1.112.
2024-03-04T10:08:57.058001-08:00 venere avahi-daemon[684]: Interface eth1.IPv4 no longer relevant for mDNS.
2024-03-04T10:08:57.058213-08:00 venere avahi-daemon[684]: Joining mDNS multicast group on interface eth1.IPv4 with address 192.168.1.128.
2024-03-04T10:08:57.140039-08:00 venere avahi-daemon[684]: New relevant interface eth1.IPv4 for mDNS.
2024-03-04T10:08:57.140173-08:00 venere avahi-daemon[684]: Registering new address record for 192.168.1.128 on eth1.IPv4.
2024-03-04T10:08:57.169931-08:00 venere dbus-daemon[685]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service' requested by ':1.4' (uid=0 pid=686 comm="/usr/sbin/NetworkManager --no-daemon ")
2024-03-04T10:08:57.210522-08:00 venere systemd[1]: Starting Network Manager Script Dispatcher Service...
2024-03-04T10:08:57.362555-08:00 venere dbus-daemon[685]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
2024-03-04T10:08:57.363880-08:00 venere systemd[1]: Started Network Manager Script Dispatcher Service.
2024-03-04T10:09:08.420640-08:00 venere systemd[1]: NetworkManager-dispatcher.service: Deactivated successfully.
Is there a particular parameter that I can adjust to avoid this?
I am using a Linksys router. In the Setup for DHCP it says:
Client Lease Time: 0 minutes (0 means one day)
But I am confused. I have a openSUSE 15.2 installation on a laptop also with NetworkManager and dynamic IP. There, I get the exact same IP address day after day. So, what changed between openSUSE 15.2 and openSUSE 15.4? Why is NetworkManager in 15.4 checking the lease of the IP address and asking for a new one while the system is up and running? Why can’t it just keep the same dynamic IP address?
I’m assuming the mac addr in the client list of the router is the same across the ip assignments? Maybe some difference in the result of a command like:
nmcli con show myconnectionname |grep -i client
between the two PCs where “myconnectionname” is the name shown in something like
I’m assuming the mac addr in the client list of the router is the same across the ip assignments?
I assume that the MAC address of my desktop network card stays the same every day. Why would that change? I can find that with ip addr show. Maybe I’ll check tomorrow again to see whether it changes.
nmcli con returns:
NAME UUID TYPE DEVICE
Wired connection 1 … ethernet eth1
eth0 … ethernet –
I replaced the numbers with “…” to keep them private.
nmcli con show "Wired connection 1" | grep -i client
I probably should let someone using your version comment. I see a result like:
ipv4.dhcp-client-id: –
ipv4.dhcp-client-id: –
DHCP4.OPTION[2]: dhcp_client_identifier = my mac address
I was expecting a client identifier result. I would think unless the show command has some mac address mask setting and the client identifier is the mac address you’d be getting the same ip.
I believe the syntax to set the id and hostname looks something like:
nmcli con modify myconnectionname ipv4.dhcp-client-id my:mac:addr:here:
You could always use the Reserve IP Address function in your router to assign the same IP address to the client MAC every time you connect. I find that very useful for internal maintenance and connections between the devices on my private network.
I just checked the configuration in my laptop with openSUSE 15.2. There I also do not see the MAC address in nmcli con show "Wired connection 1". And yet, even after a few days of not using that laptop it still uses the exact same IP address. Something must have changed between the two distributions or by me by adding the domain search name.
How many machines do you have on your LAN?
I’m assuming you’ve restarted your router.
Do you know the address range your DHCP server assigns?
Personally, if a LAN has 20 or less network attached devices, I statically assign the local machines a static IP and eliminate all similar headaches.
The PC has been up for four days and I have still not seen the behavior where it changes the dynamic IP address. It is possible that the past observation where the dynamic IP changed was due to a service interruption from my internet service provider (ISP) and for some reason the OS (dhcp client or NetworkManager) decided to ask for a different address from the router. This is still strange because the dhcp client normally should ask for the same IP address it had before. There is a file that lists all the leased IP addresses:
<identifier> is a long hexadecimjal string. My understanding is that whenever you reconnect to the same router the OS (dhcp or NetworkManager) requests the same IP address as in the last lease, besides the fact that the router also reserves a specific IP address for the same MAC address for a set period of time (in the case of my router this is 1 day). Is there maybe a setting somewhere that instructs dhcp/NetworkManager to ask for a different IP address whenever there is an internet service interruption? The file: /etc/NetworkManager lists:
meaning that it periodically checks connectivity to the above website and asks for a new IP address if not able to connect?
In any case, if this keeps happening I will either assign a static IP or instruct the router to reserve a dynamic IP address for the MAC address of the network card. I just want to understand why the IP address change happens or happened with the current installation. I will post the log if I observe again the address change.