<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 13, 2020 at 12:15 PM Geert Stappers <<a href="mailto:stappers@stappers.nl" target="_blank">stappers@stappers.nl</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, Apr 13, 2020 at 10:18:31AM -0400, John Siu wrote:<br>
> On Mon, Apr 13, 2020 at 4:54 AM Geert Stappers wrote:<br>
> > On Sun, Apr 12, 2020 at 03:14:33PM -0400, John Siu wrote:<br>
> > > I am running dnsmasq on a multiple port box. Following are dhcp config<br>
> > > for the lan and dmz ports:<br>
> > ><br>
> > > ---<br>
> > ><br>
> > > ## LAN<br>
> > > dhcp-range=tag:lan,::1,constructor:lan,ra-names,72h # IPv6<br>
> > > dhcp-range=tag:lan,172.16.168.130,172.16.168.250,72h # IPv4<br>
> > > dhcp-option=tag:lan,option:router,172.16.168.1 # option 3 default gw<br>
> > > dhcp-option=tag:lan,option:dns-server,172.16.168.1<br>
> > ><br>
> > > ## DMZ<br>
> > > dhcp-range=tag:dmz,::1,constructor:dmz,ra-names,72h # IPv6<br>
> > > dhcp-range=tag:dmz,10.10.10.100,10.10.10.120,72h # IPv4<br>
> > > dhcp-option=tag:dmz,option:router,10.10.10.1 # option 3 default gw<br>
> > > dhcp-option=tag:dmz,option:dns-server,10.10.10.1<br>
> > ><br>
> > > ---<br>
> > ><br>
> > > They work correctly for network connected to those ports.<br>
> ><br>
> > I wonder how.<br>
> ><br>
> > I mean: The provided information looks incomplete to me.<br>
> > Might be due an attempt to make the config more generic.<br>
> ><br>
> ><br>
> ><br>
> Following is the complete 92-dhcp.conf file I am using. It is not generic.<br>
> I have interface name "lan" and "dmz" setup in network config.<br>
<br>
Ah<br>
<br>
> ---<br>
> log-dhcp<br>
> quiet-dhcp<br>
> quiet-dhcp6<br>
> quiet-ra<br>
> <br>
> enable-ra<br>
> <br>
> ## LAN<br>
> dhcp-range=tag:lan,::1,constructor:lan,ra-names,72h # IPv6<br>
> dhcp-range=tag:lan,172.16.168.130,172.16.168.250,72h # IPv4<br>
> dhcp-option=tag:lan,option:router,172.16.168.1 # option 3 default gw<br>
> dhcp-option=tag:lan,option:dns-server,172.16.168.1 # option 6 dns<br>
> #dhcp-option=tag:lan,option:ntp-server,172.16.168.1<br>
> <br>
> ## DMZ<br>
> dhcp-range=tag:dmz,::1,constructor:dmz,ra-names,72h # IPv6<br>
> dhcp-range=tag:dmz,10.10.10.100,10.10.10.120,72h # IPv4<br>
> dhcp-option=tag:dmz,option:router,10.10.10.1 # option 3 default gw<br>
> dhcp-option=tag:dmz,option:dns-server,10.10.10.1 # option 6 dns<br>
> #dhcp-option=tag:dmz,option:ntp-server,10.10.10.1<br>
> <br>
> ## Lease<br>
> dhcp-hostsfile=/etc/dnsmasq.d/extra/dhcp.hosts<br>
> dhcp-leasefile=/etc/dnsmasq.d/extra/dhcp.lease<br>
> ---<br>
> <br>
> > > However, I am having issue with the switch which connect to both dmz<br>
> > > and lan ports with different VLANs. As those VLAN ports share the same<br>
> > > mac address, sometimes the switch will pick up IP from the lan side,<br>
> > > and sometimes from the dmz side.<br>
> > ><br>
> > > How can I make dnsmasq only serve IP on the lan side for this specific mac<br>
> > > address?<br>
> ><br>
> > Tell more about what you have.<br>
> ><br>
> The switch is a Netgear GS908E. It has 8 ports. I setup 2 vlan, one for<br>
> dmz, one for lan. So there is one cable from my server dmz port to the dmz<br>
> vlan, same for lan.<br>
<br>
Thanks.  I'm not used to interface names like 'lan' or 'dmz'.<br>
I'm used to interface names like 'eth0' and 'enp181s0f2'<br>
<br>
<br>
> The switch is configure to use dhcp for its ip.<br>
<br>
OK, Acknowledge.  (As in "I respect your design decission" )<br>
<br>
<br>
> However, it requests dhcp from all ports. As a result, sometime it pick up<br>
> 172.x.x.x, and sometimes it pickup 10.x.x.x address.<br>
<br>
(and that is the challenge we are facing)<br>
<br>
<br>
I have been reading the dnsmasq manual page  (again ;-) But I could not<br>
find a clear solution for coping with duplicate MAC-addresses.<br>
<br>
The is `--dhcp-ignore=tag:...` no use in this case.<br>
<br>
<br>
Idea  (wild idea?)<br>
<br>
  dhcp-host:01:00:18:4D:C0:3F:0E,172.16.168.251,12h<br>
<br></blockquote><div style="background-color:transparent">I tried , also with tag:lan, and set:lan, the switch will still pick up 10.x.x.x address.   <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
In other words: Make a "static reserveration" for the swith in LAN<br>
<br>
<br>
<br>
<br>
Regards<br>
Geert Stappers<br>
-- <br>
Silence is hard to parse<br>
<br>
_______________________________________________<br>
Dnsmasq-discuss mailing list<br>
<a href="mailto:Dnsmasq-discuss@lists.thekelleys.org.uk" target="_blank">Dnsmasq-discuss@lists.thekelleys.org.uk</a><br>
<a href="http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss" rel="noreferrer" target="_blank">http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss</a><br>
</blockquote></div></div>