Score:0

dnsmasq as dhcp server using wrong src ip

aw flag

I'm running dnsmasq as a DHCP server on an interface that has multiple IP addresses. The problem is that dnsmasq is not using its server IP (10.13.7.33) as the src IP in its replies but instead another IP (I assume the first one) configured on that interface (192.168.34.1):

192.168.34.1.67 > 255.255.255.255.68: BOOTP/DHCP, Reply, length 319, xid 0xeee372a, secs 28, Flags [Broadcast]
  Your-IP 10.13.7.38
  Server-IP 10.13.7.33
  Client-Ethernet-Address 3c:ec:af:73:0f:b6

Normal DHCP client seem not to care, but PXE booting fails because of this on some machines. If I force the src to be 10.13.7.33 using iptables it works fine.

I already tried to make dnsmasq bind to the correct IP by using:

interface=eth0
listen-address=10.13.7.33
dhcp-range=eth0,10.13.7.34,10.13.7.62,255.255.255.224,1h

Unfortunately, this isn't working. Is there a cleaner way to make dhcp use the correct src IP instead of having to use iptables and SNAT?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.