[Dnsmasq-discuss] Ignore DHCP request based on "client name"?

Hugo Segovia hugoac2004 at gmail.com
Tue Aug 7 14:03:11 BST 2018


El Mon, 6 Aug 2018 20:39:53 +0100
Simon Kelley <simon at thekelleys.org.uk> escribió:
> Use dhcp-match to set a tag based on the existence of the "android"
> substring in the hostname option, and then dhcp-ignore to ignore all
> clients with that tag set.
> 
> 
> Simples!
> 
> 
> Simon.
> 
> 
> 
> On 04/08/18 16:32, Hugo Segovia wrote:
> > Hello! 
> > 
> > First, for "client name" I mean the fourth field in an typical
> > dnsmasq.lease line:
> >                                                * this one! *
> > 1532225279 aa:bb:cc:00:11:22 192.168.3.191 android-abcdexyx123456 *
> > 
> > Now, to my issue: I've been asked to setup a little WLAN for free
> > "Computers 101" courses, and the WLAN does not have any kind of
> > security (not my choice, BTW...). As you can imagine,
> > an open WLAN is VERY attractive for freeloaders.
> > 
> > I've been adding "dhcp-host=mac-address,ignore" entries for a
> > while, but I've been wondering if I could, for example, ignore all
> > DHCP requests from hosts with a client name like
> > "android-<somethingsomething>" (because we're not teaching "how to
> > use your Android smartphone", hence it must come from freeloaders) 
> > 
> > 

Hello again!

I've trying different forms for "dhcp-match", but none seems to work:

Example 1:
dhcp-match=set:android,option:hostname,android*
dhcp-ignore=tag:android

Example 2:
dhcp-match=set:android,option:hostname,*android*
dhcp-ignore=tag:android

Example 3:
dhcp-match=set:android,12,*android*
dhcp-ignore=tag:android

(since according to
https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml
tag 12 = "Hostname")

Whatever I try, it stills keeps giving DHCP leases for Android devices:
dnsmasq-dhcp[1234]: DHCPACK(ethX) <ip addr> <mac> android-whatever1234




More information about the Dnsmasq-discuss mailing list