<div dir="ltr">Hi there,<div><br></div><div>I have an oddball situation that I'm happy to work around in the short term, but it is sufficiently flummoxing that it'd be nice to see it fixed in a future version of dnsmasq. (Or I am simply missing something and y'all can enlighten me.) </div><div><br></div><div>I have a single interface, e.g. eth0, with two addresses assigned to it: <a href="http://192.168.0.1/24">192.168.0.1/24</a> and <a href="http://192.168.0.20/24">192.168.0.20/24</a>. The .1 is the primary address; the .20 is a VIP that floats around. This system uses iproute2 (i.e. `ip`) instead of net-tools (i.e. `ifconfig`), and the interface is configured on boot by systemd-networkd (via everyone's favorite netplan). Here's (roughly) what the eth0.network file looks like:</div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="monospace">[Match]</font></div><div><font face="monospace">Name=eth0</font></div><div><font face="monospace"><br></font></div><div><font face="monospace">[Network]</font></div><div><font face="monospace">Address=<a href="http://192.168.0.1/24">192.168.0.1/24</a></font></div><div><font face="monospace">Address=<a href="http://192.168.0.20/24">192.168.0.20/24</a></font></div><div><font face="monospace">DNS=127.0.0.1</font></div></blockquote><div><br></div><div>I am explaining this the long way to make it super clear that there exists only a single eth0 interface with two addresses; there is no separate eth0:<n> interface for the .20 address. This is an important distinction because of how dnsmasq sets up its listening interfaces and addresses per my understanding. Here's (roughly) how it looks on a live system:</div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="monospace">$ ip addr show eth0</font></div><div><font face="monospace">2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000</font></div><div><font face="monospace">    link/ether dc:a6:de:ad:be:ef brd ff:ff:ff:ff:ff:ff</font></div><div><font face="monospace">    inet <a href="http://192.168.0.1/24">192.168.0.1/24</a> brd 192.168.0.255 scope global eth0</font></div><div><font face="monospace">       valid_lft forever preferred_lft forever</font></div><div><font face="monospace">    inet <a href="http://192.168.0.20/24">192.168.0.20/24</a> brd 192.168.0.255 scope global secondary eth0</font></div><div><font face="monospace">       valid_lft forever preferred_lft forever</font></div><div><font face="monospace">$ ip link show eth0</font></div><div><font face="monospace">2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000</font></div><div><font face="monospace">    link/ether dc:a6:de:ad:be:ef brd ff:ff:ff:ff:ff:ff</font></div><div><font face="monospace">$ ip link show eth0:0</font></div><div><font face="monospace">RTNETLINK answers: No such device</font></div><div><font face="monospace">Cannot send link get request: No such device</font></div><div><font face="monospace">$ ip link show eth0:1</font></div><div><font face="monospace">RTNETLINK answers: No such device</font></div><div><font face="monospace">Cannot send link get request: No such device</font></div></blockquote><div><br></div><div>Here's my starting dnsmasq (2.79) configuration and then I'll actually (finally!) explain what I'm trying to do:</div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><span style="font-family:monospace">bind-dynamic # needed for lxd</span><br></div><div><font face="monospace">listen-address=127.0.0.1</font></div><div><span style="font-family:monospace">listen-address=192.168.0.20</span></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div></div></blockquote><div><font face="monospace">listen-address=192.168.0.1</font></div><div><font face="monospace"></font></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="monospace">no-dhcp-interface=lo</font></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="monospace"><br></font></div><div><font face="monospace"># DNS</font></div><div><font face="monospace">no-resolv</font></div><div><font face="monospace">server=1.1.1.1</font></div><div><font face="monospace">server=1.0.0.1</font></div><div><font face="monospace">bogus-priv</font></div><div><font face="monospace">domain-needed</font></div><div><font face="monospace">localise-queries</font></div><div><font face="monospace">stop-dns-rebind</font></div><div><font face="monospace"><br></font></div><div><font face="monospace">## performance</font></div><div><font face="monospace">all-servers</font></div><div><font face="monospace">cache-size=600</font></div><div><font face="monospace">dns-forward-max=300</font></div><div><font face="monospace">query-port=0</font></div><div><font face="monospace"><br></font></div><div><font face="monospace"># DHCP</font></div><div><div><font face="monospace">dhcp-authoritative</font></div></div><div><font face="monospace">expand-hosts</font></div><div><font face="monospace">read-ethers</font></div><div><font face="monospace"><br></font></div><div><font face="monospace">## eth0</font></div><div><font face="monospace">domain=<a href="http://powphoto.net">powphoto.net</a>,<a href="http://192.168.0.0/24">192.168.0.0/24</a></font></div><div><font face="monospace">dhcp-range=tag:eth0,192.168.0.100,192.168.0.200,12h</font></div><div><font face="monospace">dhcp-option=tag:eth0,option:router,192.168.0.1</font></div><div><font face="monospace">dhcp-option=tag:eth0,option:dns-server,192.168.0.1,192.168.0.2</font></div><div><span style="font-family:monospace">dhcp-option=tag:eth0,option:ntp-server,192.168.0.20</span></div><div><div></div><div><div></div></div></div></blockquote><div></div><div><div></div><br></div><div>My ultimate goal is to have a single instance of dnsmasq (A) listening for DNS queries on .1 and (B) listening for DHCP discovery and request messages on .20 <i>and</i> using .20 as the server address  (i.e. the SIADDR field in the header and option 54 in the payload) for offer and acknowledgement messages. <i>If</i> this system used net-tools <i>and</i> there existed a separate eth0:0 interface for the .20 address, it would be a one-line configuration change:</div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="monospace">no-dhcp-interface=eth0</font></div></blockquote><div><br></div><div>Unfortunately, with iproute2, this statement disables DHCP on both addresses. And it seems as though this is the only configuration statement available within dnsmasq to disable DHCP on a given interface or listen-address. I've tried various solutions with no luck, such as:</div><div><ol><li><font face="monospace">no-dhcp-interface=192.168.0.1</font><br><div><i><font face="arial, sans-serif">=> same result as `=eth0`</font></i></div><div></div></li><li><div>only allowing DHCP to/from 192.168.0.20 via iptables<br><i>=> dnsmasq seems to prefer this address if both are specified (and won't even listen for DHCP discovery messages on the .20?)</i></div></li><li><div><font face="monospace">dhcp-relay=192.168.0.1,192.168.0.20</font><br><i>=> this off-label use definitely did not work as intended</i></div></li></ol><div>It looks like iproute2 has the ability to label or alias an address, but it's not clear whether this would play nice with dnsmasq's existing interface alias logic. It doesn't seem to be supported in systemd-networkd or netplan anyway. </div></div><div><br></div><div>As I said in my opening note, I have several workarounds that I'm tinkering with, so this definitely isn't a show-stopper. Just thinking aloud, I suppose what I'd really like is a more granular and/or flexible solution for mapping service listeners to addresses/interfaces and vice-versa. Or at least a way to say no-dhcp-listen-address!</div><div><br></div><div>Thank you,</div><div><br></div><div>Mike</div></div>