Lost in DNS, unbound, DHCP configurations: Two IPs for a single host

Hello,

I use a Windows11 laptop
on wifi for nomadic use
on ethernet for use at my desktop (the wifi disconnects when I connect ethernet)

To use my desktop PC and my laptop with the same keyboard/mouse, i use the “Logitech Flow” mechanism (KVM by ethernet)

But I had a big problem because of the host name of the laptop (Logitech Flow Loss of connection for 30s every 5s) :

IPFire keeps the two addresses in its DNS while I declared a fixed DHCP address and a different host for ethernet and wifi:

  • 192.168.20.49 “huaweimb” (its the name on windows11)
  • 192.168.20.47 “huaweimbwifi”

I do not fully understand the mechanism used by IPFire to assign host names and update them in its DNS

To illustrate the problem, I reproduced it on my Test IPFire:

1 VM ipfiretest with 1 red lan and a green lan
1 VM virtual11 with 2 cards on green lan

At the first connection on the green network DHCP assigned the first card of virtual11 the address 192.168.10.100

Feb 17 14:51:00 ipfireTest dhcpd: DHCPDISCOVER from 00:0c:29:43:5e:1a via green0
Feb 17 14:51:01 ipfireTest dhcpd: DHCPOFFER on 192.168.10.100 to 00:0c:29:43:5e:1a (virtual11) via green0
Feb 17 14:51:01 ipfireTest dhcpd: DHCPREQUEST for 192.168.10.100 (192.168.10.1) from 00:0c:29:43:5e:1a (virtual11) via green0
Feb 17 14:51:01 ipfireTest dhcpd: DHCPACK on 192.168.10.100 to 00:0c:29:43:5e:1a (virtual11) via green0

I configured dns.cgi


then dhcp.cgi


I reconnected my windows client

Feb 17 14:55:44 ipfireTest dhcpd: uid lease 192.168.10.100 for client 00:0c:29:43:5e:1a is duplicate on 192.168.10.0/24
Feb 17 14:55:44 ipfireTest dhcpd: DHCPDISCOVER from 00:0c:29:43:5e:1a via green0
Feb 17 14:55:44 ipfireTest dhcpd: DHCPOFFER on 192.168.10.2 to 00:0c:29:43:5e:1a via green0
Feb 17 14:55:44 ipfireTest dhcpd: uid lease 192.168.10.100 for client 00:0c:29:43:5e:1a is duplicate on 192.168.10.0/24
Feb 17 14:55:44 ipfireTest dhcpd: execute_statement argv[0] = /usr/sbin/unbound-dhcp-leases-client
Feb 17 14:55:44 ipfireTest dhcpd: execute_statement argv[1] = commit
Feb 17 14:55:44 ipfireTest dhcpd: execute_statement argv[2] = ADDRESS=192.168.10.2
Feb 17 14:55:44 ipfireTest dhcpd: execute_statement argv[3] = NAME=virtual11
Feb 17 14:55:44 ipfireTest dhcpd: DHCPREQUEST for 192.168.10.2 (192.168.10.1) from 00:0c:29:43:5e:1a via green0
Feb 17 14:55:44 ipfireTest dhcpd: DHCPACK on 192.168.10.2 to 00:0c:29:43:5e:1a via green0

Then I enable the second network card on green to my Windows VM

Feb 17 14:57:06 ipfireTest dhcpd: DHCPDISCOVER from 00:0c:29:43:5e:24 via green0
Feb 17 14:57:07 ipfireTest dhcpd: DHCPOFFER on 192.168.10.101 to 00:0c:29:43:5e:24 (virtual11) via green0
Feb 17 14:57:07 ipfireTest dhcpd: execute_statement argv[0] = /usr/sbin/unbound-dhcp-leases-client
Feb 17 14:57:07 ipfireTest dhcpd: execute_statement argv[1] = commit
Feb 17 14:57:07 ipfireTest dhcpd: execute_statement argv[2] = ADDRESS=192.168.10.101
Feb 17 14:57:07 ipfireTest dhcpd: execute_statement argv[3] = NAME=virtual11
Feb 17 14:57:07 ipfireTest dhcpd: DHCPREQUEST for 192.168.10.101 (192.168.10.1) from 00:0c:29:43:5e:24 (virtual11) via green0
Feb 17 14:57:07 ipfireTest dhcpd: DHCPACK on 192.168.10.101 to 00:0c:29:43:5e:24 (virtual11) via green0

I assign a Fixed IP to my second card


And host names in hosts.cgi

I reconnect my second card

Feb 17 14:59:17 ipfireTest dhcpd: uid lease 192.168.10.101 for client 00:0c:29:43:5e:24 is duplicate on 192.168.10.0/24
Feb 17 14:59:17 ipfireTest dhcpd: DHCPDISCOVER from 00:0c:29:43:5e:24 via green0
Feb 17 14:59:17 ipfireTest dhcpd: DHCPOFFER on 192.168.10.20 to 00:0c:29:43:5e:24 via green0
Feb 17 14:59:17 ipfireTest dhcpd: uid lease 192.168.10.101 for client 00:0c:29:43:5e:24 is duplicate on 192.168.10.0/24
Feb 17 14:59:17 ipfireTest dhcpd: execute_statement argv[0] = /usr/sbin/unbound-dhcp-leases-client
Feb 17 14:59:17 ipfireTest dhcpd: execute_statement argv[1] = release
Feb 17 14:59:17 ipfireTest dhcpd: execute_statement argv[2] = ADDRESS=192.168.10.101
Feb 17 14:59:17 ipfireTest dhcpd: execute_statement argv[3] = NAME=virtual11
Feb 17 14:59:17 ipfireTest dhcp[5811]: Could not find lease for 192.168.10.101
Feb 17 14:59:17 ipfireTest dhcpd: execute_statement argv[0] = /usr/sbin/unbound-dhcp-leases-client
Feb 17 14:59:17 ipfireTest dhcpd: execute_statement argv[1] = commit
Feb 17 14:59:17 ipfireTest dhcpd: execute_statement argv[2] = ADDRESS=192.168.10.20
Feb 17 14:59:17 ipfireTest dhcpd: execute_statement argv[3] = NAME=virtual11
Feb 17 14:59:17 ipfireTest dhcpd: DHCPREQUEST for 192.168.10.20 (192.168.10.1) from 00:0c:29:43:5e:24 via green0
Feb 17 14:59:17 ipfireTest dhcpd: DHCPACK on 192.168.10.20 to 00:0c:29:43:5e:24 via green0

I restart IPFire
Then my windows11 VM

Feb 17 15:03:08 ipfireTest dhcpd: Server starting service.
Feb 17 15:03:08 ipfireTest sshd[3292]: Server listening on 0.0.0.0 port 222.
Feb 17 15:03:09 ipfireTest unbound: [1957:0] info: service stopped (unbound 1.22.0).
Feb 17 15:03:09 ipfireTest unbound: [1957:0] info: server stats for thread 0: 17 queries, 5 answers from cache, 12 recursions, 0 prefetch, 0 rejected by ip ratelimiting
Feb 17 15:03:09 ipfireTest unbound: [1957:0] info: server stats for thread 0: requestlist max 1 avg 0.166667 exceeded 0 jostled 0
Feb 17 15:03:09 ipfireTest unbound: [1957:0] info: average recursion processing time 0.103725 sec
Feb 17 15:03:09 ipfireTest unbound: [1957:0] info: histogram of recursion processing times
Feb 17 15:03:09 ipfireTest unbound: [1957:0] info: [25%]=0.032768 median[50%]=0.0873813 [75%]=0.16384
Feb 17 15:03:09 ipfireTest unbound: [1957:0] info: lower(secs) upper(secs) recursions
Feb 17 15:03:09 ipfireTest unbound: [1957:0] info:    0.004096    0.008192 1
Feb 17 15:03:09 ipfireTest unbound: [1957:0] info:    0.008192    0.016384 1
Feb 17 15:03:09 ipfireTest unbound: [1957:0] info:    0.016384    0.032768 1
Feb 17 15:03:09 ipfireTest unbound: [1957:0] info:    0.032768    0.065536 2
Feb 17 15:03:09 ipfireTest unbound: [1957:0] info:    0.065536    0.131072 3
Feb 17 15:03:09 ipfireTest unbound: [1957:0] info:    0.131072    0.262144 4
Feb 17 15:03:09 ipfireTest unbound: [1957:0] notice: Restart of unbound 1.22.0.
Feb 17 15:03:09 ipfireTest unbound: [1957:0] notice: init module 0: validator
Feb 17 15:03:09 ipfireTest unbound: [1957:0] notice: init module 1: iterator
Feb 17 15:03:09 ipfireTest unbound: [1957:0] info: start of service (unbound 1.22.0).
Feb 17 15:03:22 ipfireTest dhcpd: uid lease 192.168.10.101 for client 00:0c:29:43:5e:24 is duplicate on 192.168.10.0/24
Feb 17 15:03:22 ipfireTest dhcpd: DHCPDISCOVER from 00:0c:29:43:5e:24 via green0
Feb 17 15:03:22 ipfireTest dhcpd: DHCPOFFER on 192.168.10.20 to 00:0c:29:43:5e:24 via green0
Feb 17 15:03:22 ipfireTest dhcpd: uid lease 192.168.10.101 for client 00:0c:29:43:5e:24 is duplicate on 192.168.10.0/24
Feb 17 15:03:22 ipfireTest dhcpd: execute_statement argv[0] = /usr/sbin/unbound-dhcp-leases-client
Feb 17 15:03:22 ipfireTest dhcpd: execute_statement argv[1] = commit
Feb 17 15:03:22 ipfireTest dhcpd: execute_statement argv[2] = ADDRESS=192.168.10.20
Feb 17 15:03:22 ipfireTest dhcpd: execute_statement argv[3] = NAME=virtual11

I then deactivate the Wifi and restart windows11 with the Ethernet card

Feb 17 15:09:53 ipfireTest dhcpd: uid lease 192.168.10.100 for client 00:0c:29:43:5e:1a is duplicate on 192.168.10.0/24
Feb 17 15:09:53 ipfireTest dhcpd: DHCPDISCOVER from 00:0c:29:43:5e:1a via green0
Feb 17 15:09:53 ipfireTest dhcpd: DHCPOFFER on 192.168.10.2 to 00:0c:29:43:5e:1a via green0
Feb 17 15:09:53 ipfireTest dhcpd: uid lease 192.168.10.100 for client 00:0c:29:43:5e:1a is duplicate on 192.168.10.0/24
Feb 17 15:09:53 ipfireTest dhcpd: execute_statement argv[0] = /usr/sbin/unbound-dhcp-leases-client
Feb 17 15:09:53 ipfireTest dhcpd: execute_statement argv[1] = commit
Feb 17 15:09:53 ipfireTest dhcpd: execute_statement argv[2] = ADDRESS=192.168.10.2
Feb 17 15:09:53 ipfireTest dhcpd: execute_statement argv[3] = NAME=virtual11
Feb 17 15:09:53 ipfireTest dhcpd: DHCPREQUEST for 192.168.10.2 (192.168.10.1) from 00:0c:29:43:5e:1a via green0
Feb 17 15:09:53 ipfireTest dhcpd: DHCPACK on 192.168.10.2 to 00:0c:29:43:5e:1a via green0

And I get under windows11:

PS C:\Users\user> nslookup virtual11 192.168.10.1
Serveur :   ipfireTest.localdomainTest
Address:  192.168.10.1

Nom :    virtual11.localdomainTest
Addresses:  192.168.10.20
          192.168.10.2

PS C:\Users\user> nslookup virtual11wifi 192.168.10.1
Serveur :   ipfireTest.localdomainTest
Address:  192.168.10.1

Nom :    virtual11wifi.localdomainTest
Address:  192.168.10.20

Same under IPFire:

[root@ipfireTest ~]# nslookup virtual11 ipfireTest
Server:         ipfireTest
Address:        192.168.10.1#53

Name:   virtual11.localdomainTest
Address: 192.168.10.2
Name:   virtual11.localdomainTest
Address: 192.168.10.20

[root@ipfireTest ~]# nslookup virtual11wifi ipfireTest
Server:         ipfireTest
Address:        192.168.10.1#53

Name:   virtual11wifi.localdomainTest
Address: 192.168.10.20

IPFIre keeps both addresses registered in DNS

and obviously the Ping no longer responds

[root@ipfireTest ~]# ping virtual11
PING virtual11.localdomainTest (192.168.10.20) 56(84) bytes of data.
From ipfireTest.localdomainTest (192.168.10.1) icmp_seq=1 Destination Host Unreachable
From ipfireTest.localdomainTest (192.168.10.1) icmp_seq=2 Destination Host Unreachable
From ipfireTest.localdomainTest (192.168.10.1) icmp_seq=3 Destination Host Unreachable
^C
--- virtual11.localdomainTest ping statistics ---
4 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3086ms

[root@ipfireTest ~]# ping 192.168.10.2
PING 192.168.10.2 (192.168.10.2) 56(84) bytes of data.
64 bytes from 192.168.10.2: icmp_seq=1 ttl=128 time=0.554 ms
64 bytes from 192.168.10.2: icmp_seq=2 ttl=128 time=1.48 ms
64 bytes from 192.168.10.2: icmp_seq=3 ttl=128 time=1.78 ms
64 bytes from 192.168.10.2: icmp_seq=4 ttl=128 time=1.57 ms
64 bytes from 192.168.10.2: icmp_seq=5 ttl=128 time=1.32 ms
64 bytes from 192.168.10.2: icmp_seq=6 ttl=128 time=1.59 ms
64 bytes from 192.168.10.2: icmp_seq=7 ttl=128 time=1.29 ms
64 bytes from 192.168.10.2: icmp_seq=8 ttl=128 time=1.03 ms
^C
--- 192.168.10.2 ping statistics ---
8 packets transmitted, 8 received, 0% packet loss, time 7042ms

Restarting ipfire allows to find the correct configuration
But I can’t restart IPFire every time I connect my laptop to my Desktop

I also have this setup, with three of my laptops (all running linux) with a coonection by wifi, which is automatically switched over to wired connection when an ethernet plug is inserted into the laptop.

I have never had a problem with any of the laptops making a connection. However on my green network I have no dynamic clients at all. Everything has a fixed lease.

On my blue network I only have dynamic leases but occasionally in the past a laptop might connect to the blue dynamic dhcp access. (This was before I separated my green, blue and orange networks with vlans.)

You might want to try enabling the “Deny known clients:” checkbox on your green dhcp table.

This will prevent any device with a known fixed lease being able to obtain a dynamic lease.

Before I divide my home network into three vlans I also used this “Deny known clients:” checkbox on my blue network to prevent any of my fixed lease systems from being able to obtain a dynamic dhcp lease and that worked very well for me.

Thanks for you reply @bonnietwin

“Deny known clients” does not solve my problem.
I still have two IPs in my DNS when I disconnect wifi to connect Ethernet

I don’t understand what the command means

	set ClientName = concat(
		"NAME=",
		pick-first-value(option host-name, config-option-host-name, client-name, "")
	);

in dhcp.conf

What are arguments for “config-option-host-name” ? “client-name” ?

Shouldn’t we use the host value defined in /var/ipfire/main/hosts ?

I solved my “Logitech Flow” problem by assigning a different hostname

  • “huaweimb” for ethernet
  • “huaweimbwifi” for wifi

And Windows computer name “matebook”

I still have both addresses for “matebook” in IPFire DNS

Solution here

1 Like

Except that I break the rule that you specify there for everyone of the 18 hosts that I have connected on my network and I don’t see the problem you are experiencing.

1 Like