LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 08-12-2010, 03:28 PM   #1
sinthetic
LQ Newbie
 
Registered: Aug 2010
Posts: 3

Rep: Reputation: 0
ISC DHCP - class matching based on mac address


We have a large number of devices on our LAN with the mac prefix of 00:60:60. We want to assign these addresses from a separate address pool. I've created two classes, one to match 00:60:60 and another that I want to contain any other device. When i try to start the server I get:

/etc/dhcp3/dhcpd.conf line 33: boolean expression expected
match if not binary-to-ascii(16,8,":",substring(hardware, 1, 3))
^#this carrot should be under the last parenthesis#
Configuration file errors encountered -- exiting


Here is the relevant section of /etc/dhcp3/dhcpd.conf

class "006060" {
match if binary-to-ascii(16,8,":",substring(hardware, 1, 3)) = "00:60:60";
}

class "other" {
match if not binary-to-ascii(16,8,":",substring(hardware, 1, 3)) = "00:60:60";
}

subnet 10.10.0.0 netmask 255.255.0.0 {
option routers 10.10.100.2;
pool {
allow members of "006060";
range 10.10.250.0 10.10.255.254;
}
pool {
allow members of "other";
range 10.10.0.1 10.10.249.255;
}
}

I've tried a few variations on that line. I've spent days trying to find any examples of "match if not" and haven't found anything. I assume it's going to be something to do with parenthesis/quote placement. Any Ideas? Oh and this is ISC DHCP Server V3.0.4.

Thanks

Last edited by sinthetic; 08-12-2010 at 03:36 PM.
 
Old 08-13-2010, 01:58 PM   #2
markf2
LQ Newbie
 
Registered: Sep 2008
Posts: 5

Rep: Reputation: 0
It looks like the test is backward

Not sure but by logic shouldn't you convert the binary-to-ascii first and then substring out the result.

Post you results when you get it working, I need to do the same test.
 
Old 08-16-2010, 12:06 PM   #3
sinthetic
LQ Newbie
 
Registered: Aug 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Ok I changed the line to:

match if not(binary-to-ascii(16,8,":",substring(hardware, 1, 3)) = "00:60:60");

and the server will start now, but all leases are coming from the "other" pool.

I have tried

match if binary-to-ascii(16,8,":",substring(hardware, 1, 3)) = "00:60:60";
and
match if substring(hardware, 1, 3) = 00:60:60;

Does anyone know of a way to add print statements? Something like:

print "substring(hardware, 1, 3)" > /var/log/dhcp_debug.log

Thanks
 
Old 08-17-2010, 12:48 PM   #4
sinthetic
LQ Newbie
 
Registered: Aug 2010
Posts: 3

Original Poster
Rep: Reputation: 0
I got it Here is the working config.

class "006060" {
match if binary-to-ascii (16,8,":",substring(hardware, 0, 4)) = "1:0:60:60";
}

class "other" {
match if not(binary-to-ascii (16,8,":",substring(hardware, 0, 4)) = "1:0:60:60");
}

subnet 10.10.0.0 netmask 255.255.0.0 {
option routers 10.10.100.2;
pool {
allow members of "006060";
range 10.10.250.0 10.10.255.254;
}
pool {
allow members of "other";
range 10.10.0.1 10.10.249.255;
}
}

The "1" at the front of the hardware string signifies ethernet.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ethernet MAC Addresses database; MAC address-based processing cctualatin Linux - Newbie 1 04-14-2009 09:59 AM
Force DHCP To Refuse Clients A DHCP Lease Depending On Client MAC Address blackfish Linux - Server 3 08-17-2007 01:54 AM
Single DHCP server ,to provide the ip address to a MAC address in two different subne alix123 Linux - Software 5 05-09-2007 12:16 AM
DHCP Server MAC Address found, IP address not assigned wmburke Linux - Wireless Networking 17 11-17-2004 11:33 AM
ISC DHCP Server MAC Address dlucas10 Linux - Networking 1 05-25-2004 06:49 PM


All times are GMT -5. The time now is 11:54 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration