0

Setup: I have two servers A and B. Server A runs dnsmasq and should assign a static IP to B (using hostname "vm03"). This IP is set in /etc/dnsmasq.conf (extract below):

domain-needed
local=/my-private-domain/
interface=eth0
interface=eth1
interface=tun0
dhcp-range=192.168.100.100,192.168.100.130
dhcp-host=vm03,192.168.100.103

Problem: This used to work just fine, but after I now upgraded server B from openSUSE 13.1 to 42.1, it doesn't work anymore = server B no longer gets assigned 192.168.100.103, but something different such as 192.160.100.124 (which is still in the general IP range I defined above).

On server A I see that dnsmasq in itself realizes that something is not right (since I also set the IP for vm03 in the /etc/hosts file of server A):

dnsmasq-dhcp: not giving name vm03 to the DHCP lease of 192.168.100.124 because the name exists in /etc/hosts with address 192.168.100.103

TcpDump: I compared the output put of "tcpdump -i eth1 -vvv -s 0 port bootps" from server B against the output from server C (still running the old openSUSE 13.1 and gets the correct IP from dnsmasq).

Old server C communicaton with A [Discover, Offer, Request ACK]. Full trace here:

lsm1:~ # tcpdump -i eth1  port 67 or port 68 -e -n
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 65535 bytes
13:31:51.106018 52:54:00:bd:8a:6e > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 52:54:00:bd:8a:6e, length 300
13:31:51.106369 52:54:00:a3:7c:db > 52:54:00:bd:8a:6e, ethertype IPv4 (0x0800), length 342: 192.168.100.1.67 > 192.168.100.102.68: BOOTP/DHCP, Reply, length 300
13:31:51.106752 52:54:00:bd:8a:6e > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 354: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 52:54:00:bd:8a:6e, length 312
13:31:51.263232 52:54:00:a3:7c:db > 52:54:00:bd:8a:6e, ethertype IPv4 (0x0800), length 346: 192.168.100.1.67 > 192.168.100.102.68: BOOTP/DHCP, Reply, length 304

New server B communication with A [Request, NACK, Discover, Offer, Request, ACK]. Full trace here:

lsm1:~ # tcpdump -i eth1  port 67 or port 68 -e -n
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 65535 bytes
13:31:59.743740 52:54:00:be:0b:ab > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 52:54:00:be:0b:ab, length 300
13:31:59.744122 52:54:00:a3:7c:db > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: 192.168.100.1.67 > 255.255.255.255.68: BOOTP/DHCP, Reply, length 300
13:32:00.744866 52:54:00:be:0b:ab > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 52:54:00:be:0b:ab, length 300
13:32:00.745244 52:54:00:a3:7c:db > 52:54:00:be:0b:ab, ethertype IPv4 (0x0800), length 342: 192.168.100.1.67 > 192.168.100.124.68: BOOTP/DHCP, Reply, length 300
13:32:00.745711 52:54:00:be:0b:ab > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 351: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 52:54:00:be:0b:ab, length 309
13:32:00.813972 52:54:00:a3:7c:db > 52:54:00:be:0b:ab, ethertype IPv4 (0x0800), length 346: 192.168.100.1.67 > 192.168.100.124.68: BOOTP/DHCP, Reply, length 304

I have no idea why the behavior changed. Is this correct or an issue with wicked? Any ideas / things to test?


Things I already checked / tried:

  1. The network settings on server B are unchanged (only difference: after the upgrade it is no longer managed by ifup/ifdown but wicked).
  2. I manually removed the lease file /var/lib/misc/dnsmasq.leases
  3. Restarted dnsmasq on server A and forced Ip renewls on server B via ifdown eth0 and ifup eth0
3
  • Did you try to add the MAC address of B to the dnsmasq configuration. dhcp-host=11:22:33:44:55:66,fvm03,192.168.100.103?
    – Thomas
    Oct 8, 2016 at 12:19
  • @Thomas With the MAC address it works. But shouldn't it also work without (as it did before the upgrade)? Oct 8, 2016 at 12:26
  • I think that dnsmasq released the lease for that specific MAC address and you got a new random one then. Which is mismatching with the hostname and IP address in '/etc/hosts`.
    – Thomas
    Oct 8, 2016 at 12:33

1 Answer 1

0

To pick up the correct IP address, one has to configure the MAC address in dnsmasq.conf as well.

dhcp-host=11:22:33:44:55:66,fvm03,192.168.100.103
1
  • Not according to the documentation of dnsmasq: "It is also allowable to omit the hardware address and include the hostname, in which case the IP address and lease times will apply to any machine claiming that name." So my settings are valid (and worked exactly as described before the openSUSE upgrade). Oct 8, 2016 at 13:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.