Thanks Glenn. I already posted this to the list.<br>No, I need mac address range, i.e, how the input is going to be. The user would provide start and end range.<br><br><b><span style="background-color: rgb(255, 255, 0);">Beshir, Simon</span></b>, do you have any idea ?<br>
<br>thanks<br>Ashmath<br><br><div class="gmail_quote">On Thu, Oct 15, 2009 at 7:35 PM, Glenn Satchell <span dir="ltr"><<a href="mailto:Glenn.Satchell@uniq.com.au">Glenn.Satchell@uniq.com.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">>From: Ashmath Khan <<a href="mailto:hashmat.email@gmail.com">hashmat.email@gmail.com</a>><br>
</div>>Date: Thu, 15 Oct 2009 19:13:13 +0530<br>
>Subject: Re: Fwd: To add some filter rules in conf file<br>
<div class="im">>To: Glenn Satchell <<a href="mailto:Glenn.Satchell@uniq.com.au">Glenn.Satchell@uniq.com.au</a>><br>
><br>
</div><div class="im">>Thank you very much Glenn.<br>
>For question #5, I don't have known MAC addressess. But I have a range. I<br>
>already looked into subclasses, I don't think i can use that for range. Is<br>
>there a way to define range of MAC addresses with start and end ?<br>
<br>
</div>No.<br>
<br>
The most common way is where the class matches against a substring of<br>
the mac address, often the first three bytes, eg something like this:<br>
<br>
match if substring(hardware, 1, 3) = 00:11:22;<br>
<br>
Does that get you closer?<br>
<br>
Otherwise, please post to the list what goal you are trying to<br>
achieve. There may be an entirely different and easier way to achieve<br>
the it. There are a lot of experts here who know how to best use the<br>
capabilities of dhcpd.conf statements...<br>
<br>
regards,<br>
<font color="#888888">-glenn<br>
</font><div><div></div><div class="h5"><br>
<br>
>thanks<br>
>Ashmath<br>
><br>
>On Thu, Oct 15, 2009 at 7:07 PM, Glenn Satchell<br>
><<a href="mailto:Glenn.Satchell@uniq.com.au">Glenn.Satchell@uniq.com.au</a>>wrote:<br>
><br>
>><br>
>> >From: Ashmath Khan <<a href="mailto:hashmat.email@gmail.com">hashmat.email@gmail.com</a>><br>
>> >Date: Thu, 15 Oct 2009 18:50:52 +0530<br>
>> >Subject: Fwd: To add some filter rules in conf file<br>
>> >To: Glenn Satchell <<a href="mailto:Glenn.Satchell@uniq.com.au">Glenn.Satchell@uniq.com.au</a>>,<br>
>> <a href="mailto:tinzauro@ha-solutions.net">tinzauro@ha-solutions.net</a><br>
>> ><br>
>> >Can you please reply ? thanks.<br>
>> ><br>
>> >---------- Forwarded message ----------<br>
>> >From: Ashmath Khan <<a href="mailto:hashmat.email@gmail.com">hashmat.email@gmail.com</a>><br>
>> >Date: Thu, Oct 15, 2009 at 4:07 PM<br>
>> >Subject: Re: To add some filter rules in conf file<br>
>> >To: Users of ISC DHCP <<a href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a>>, <a href="mailto:dhcp1@thehobsons.co.uk">dhcp1@thehobsons.co.uk</a>,<br>
>> ><a href="mailto:dhcp-users@isc.org">dhcp-users@isc.org</a>, Reissom Beshir <<a href="mailto:Reissom_Beshir@mitel.com">Reissom_Beshir@mitel.com</a>><br>
>> ><br>
>> ><br>
>> >More questions:<br>
>> >4. Can I scan for a particular option which client has sent from the<br>
>> option<br>
>> >dhcp-parameter-request-list ?<br>
>><br>
>> Not easily. You could use substring to test each possible position, but<br>
>> there is no regular expression or wildcard matching.<br>
>><br>
>> >5. How do I filter clients based on their h/w addresses. I tried this, but<br>
>> >it gives error:<br>
>> >class "rule1" {<br>
>> >match if substring (hardware, 1, 6) >= 00:19:7D:72:B7:7A and substring<br>
>> >(hardware, 1, 6) <= FF:FF:FF:FF:FF:FF;<br>
>> >}<br>
>><br>
>> You can't use > or < for string comparisons. The evaluation engine in<br>
>> dhcpd is very basic.<br>
>><br>
>> If you have particular known mac addresses then you can add them as a<br>
>> sub-class. This is explained in dhcpd.conf man page, look for the<br>
>> section SUBCLASSES. Then you can use allow or deny of that class inthe<br>
>> pool.<br>
>><br>
>> More answers below.<br>
>><br>
>> >subnet 192.168.1.0 netmask 255.255.255.0 {<br>
>> ><br>
>> >pool {<br>
>> >option router-discovery off;<br>
>> >option domain-name-servers 192.168.1.250;<br>
>> >range 192.168.1.66;<br>
>> >allow members of "rule1";<br>
>> >}<br>
>> >default-lease-time 86500;<br>
>> >max-lease-time 86500;<br>
>> >option routers 192.168.1.254;<br>
>> >}<br>
>> ><br>
>> >Thanks in Advance.<br>
>> ><br>
>> >-Ashmath<br>
>> ><br>
>> ><br>
>> >On Thu, Oct 15, 2009 at 3:26 PM, Ashmath Khan <<a href="mailto:hashmat.email@gmail.com">hashmat.email@gmail.com</a><br>
>> >wrote:<br>
>> ><br>
>> >> Sorry.. i missed that, client didn't request those options. Its working<br>
>> >> now. But I had these further:<br>
>> >><br>
>> >> 1. Is it possible to group the options together so that I refer them by<br>
>> >> some name ? like in the below example instead of giving router-discovery<br>
>> and<br>
>> >> boot-size, I can just give a group name, which will select those<br>
>> options.<br>
>><br>
>> No.<br>
>><br>
>> >> 2. is it possible to have wild chars in the search string ? like if I<br>
>> want<br>
>> >> to search the string "Phone*client" or "Alcatel?client" etc. I think i<br>
>> can<br>
>> >> use the existing eval expressions to search the strings, but then I need<br>
>> to<br>
>> >> parse these wild char strings, understand them, and apply eval<br>
>> expressions.<br>
>> >> Is there any direct method which would recognize wild chars ?<br>
>><br>
>> No.<br>
>><br>
>> >> 3. Say I have this rule below: And rule1 passes, rule2 fails, and I saw<br>
>> >> that it doesn't go into third pool i.e, rule2 deny one, which seems to<br>
>> be<br>
>> >> correct. It means once it finds a pool match, then it won't evaluate<br>
>> other<br>
>> >> pools. Is this understanding correct ?<br>
>> >><br>
>> >> class "rule1" {<br>
>> >> match if substring (option vendor-class-identifier, 0, 4) = "MSFT";<br>
>> >> }<br>
>> >><br>
>> >> class "rule2" {<br>
>> >> match if substring (option dhcp-option-overload, 0, 4) = "NSFT";<br>
>> >> }<br>
>> >><br>
>> >><br>
>> >> subnet 192.168.1.0 netmask 255.255.255.0 {<br>
>> >><br>
>> >> pool {<br>
>> >> option router-discovery off;<br>
>> >> option domain-name-servers 192.168.1.254;<br>
>> >> range 192.168.1.66;<br>
>> >> allow members of "rule1";<br>
>> >> }<br>
>> >><br>
>> >> pool {<br>
>> >> option router-discovery off;<br>
>> >> option domain-name-servers 192.168.1.111;<br>
>> >> range 192.168.1.100;<br>
>> >> allow members of "rule2";<br>
>> >> }<br>
>> >><br>
>> >> pool {<br>
>> >> option router-discovery on;<br>
>> >> option domain-name-servers 192.168.1.222;<br>
>> >> option boot-size 512;<br>
>> >> range 192.168.1.200;<br>
>> >> deny members of "rule2";<br>
>> >> }<br>
>> >><br>
>> >><br>
>> >> default-lease-time 86500;<br>
>> >> max-lease-time 86500;<br>
>> >> option routers 192.168.1.254;<br>
>> >><br>
>> >> }<br>
>> >><br>
>> >> thanks<br>
>> >> Ashmath<br>
>><br>
>> A particular client can be a member of multiple classes. My<br>
>> understanding is the first pool that matches is used.<br>
>><br>
>> Allowing a class denies all other classes, denying a class allows all<br>
>> others. Mixing allow and deny in the same class can have unexpected<br>
>> results, so use carefully.<br>
>><br>
>> HTH.<br>
>><br>
>> regards,<br>
>> -glenn<br>
>> --<br>
>> Glenn Satchell mailto:<a href="mailto:glenn.satchell@uniq.com.au">glenn.satchell@uniq.com.au</a> | Miss 9: What do you<br>
>> Uniq Advances Pty Ltd <a href="http://www.uniq.com.au" target="_blank">http://www.uniq.com.au</a> | do at work Dad?<br>
>> PO Box 70 Paddington NSW Australia 2021 | Miss 6: He just<br>
>> tel:0409-458-580 fax:02-9380-6416 | types random stuff.<br>
>><br>
>> >><br>
>> >><br>
>> >><br>
>> >> On Wed, Oct 14, 2009 at 8:50 PM, Simon Hobson <<a href="mailto:dhcp1@thehobsons.co.uk">dhcp1@thehobsons.co.uk</a><br>
>> >wrote:<br>
>> >><br>
>> >>> Ashmath Khan wrote:<br>
>> >>><br>
>> >>> I tried this:<br>
>> >>>> class "rule1" {<br>
>> >>>> match if substring (option dhcp-client-identifier, 0, 5) =<br>
>> >>>> 01:00:19:7d:72;<br>
>> >>>> option time-offset -12345;<br>
>> >>>> option boot-size 65000;<br>
>> >>>> }<br>
>> >>>> subnet 192.168.1.0 netmask 255.255.255.0 {<br>
>> >>>> pool {<br>
>> >>>> allow members of "rule1";<br>
>> >>>> range 192.168.1.66;<br>
>> >>>> }<br>
>> >>>> default-lease-time 86400;<br>
>> >>>> max-lease-time 86400;<br>
>> >>>> option routers 192.168.1.254;<br>
>> >>>> option domain-name-servers 192.168.1.254;<br>
>> >>>> }<br>
>> >>>><br>
>> >>>> => it didn't work completely. I did get dhcp offer message but the<br>
>> >>>> options: time-offset and boot-size were not sent as part of dhcp<br>
>> offer. Any<br>
>> >>>> reasons ? How do I make it work ?<br>
>> >>>><br>
>> >>><br>
>> >>> Did the client request those options ?<br>
>> >>><br>
>> >>> If not then the server won't send them. You can force it to (see the<br>
>> >>> recent thread "how to get slp-directory-agent option working"). But if<br>
>> the<br>
>> >>> client doesn't request it, there's a good chance it doesn't know what<br>
>> to do<br>
>> >>> with it and will ignore it.<br>
>> >>><br>
>> >>><br>
>> >>> --<br>
>> >>> Simon Hobson<br>
>> >>><br>
>> >>> Visit <a href="http://www.magpiesnestpublishing.co.uk/" target="_blank">http://www.magpiesnestpublishing.co.uk/</a> for books by acclaimed<br>
>> >>> author Gladys Hobson. Novels - poetry - short stories - ideal as<br>
>> >>> Christmas stocking fillers. Some available as e-books.<br>
>> >>> _______________________________________________<br>
>> >>> dhcp-users mailing list<br>
>> >>> <a href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a><br>
>> >>> <a href="https://lists.isc.org/mailman/listinfo/dhcp-users" target="_blank">https://lists.isc.org/mailman/listinfo/dhcp-users</a><br>
>> >>><br>
>> >><br>
>> >><br>
>><br>
>><br>
<br>
_______________________________________________<br>
dhcp-users mailing list<br>
<a href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a><br>
<a href="https://lists.isc.org/mailman/listinfo/dhcp-users" target="_blank">https://lists.isc.org/mailman/listinfo/dhcp-users</a><br>
</div></div></blockquote></div><br>