A Syntax issue with match

Martin McCormick martin at dc.cis.okstate.edu
Fri Nov 19 16:38:22 UTC 2010


Simon Hobson writes:
> Can you post both your config and the error message produced ?

Certainly. This is a stripped-down version of our config with
all the sensitive stuff removed and the class that is causing
the trouble in place:

#/usr/local/etc/dhcpd.conf for primary DHCP server
#
authoritative;
ddns-update-style interim;
failover peer "stw" {
  primary; # declare this to be the primary server
  address 192.168.1.20;
  port 520;
  peer address 192.168.1.21;
  peer port 520;
  max-response-delay 30;
  max-unacked-updates 10;
  load balance max seconds 3;
  mclt 1800;
  split 128;
}
authoritative;
# option definitions common to all supported networks...
one-lease-per-client true;
#boot-unknown-clients false;
option domain-name "okstate.edu";
option subnet-mask 255.255.255.0;
option tftp-server-address code 150 = { ip-address };
deny duplicates;
ignore client-updates;
set vendor_class = option vendor-class-identifier;
set dhcpd-host-name = lcase(host-name);
set client_id = lcase(option host-name);

omapi-port 7911;
if substring (option dhcp-client-identifier, 0, 5) = "\001RAS " {
ignore booting;
}
# deny booting;

#private zones

#Point of Sale terminals
class "POS-terminals" {
match if ((substring (option host-name,0,6) = "TEST2C") & (substring (hardware,0,4) = 1:0:A9:A2));
}


option cisco-call-manager code 150 = ip-address;

class "ras-clients" {
match if substring (option dhcp-client-identifier, 0, 5) = "\001RAS ";
}

filename "null";
option server.ddns-hostname =
pick (option fqdn.hostname, option host-name,
binary-to-ascii (16, 8, "-", substring (hardware, 1, 6)));
update-optimization false;
default-lease-time 172800; # 2 days
max-lease-time 172800; # 2 days
subnet 10.192.0.0 netmask 255.255.248.0 {
#bennett
option subnet-mask 255.255.248.0;
option routers 10.192.7.254;
option domain-name "bennett.rl";
ddns-updates on;
option broadcast-address 10.192.7.255;
pool {
range 10.192.0.1 10.192.6.128;
deny dynamic bootp clients;
failover peer "stw";
	}
} #end network 10.192.0.0

dhcpd passes this configuration if the POS-terminals class
definition is gone. With it in, we get:

Internet Systems Consortium DHCP Server 4.1.1-P1
Copyright 2004-2010 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
dhcpd.conf line 40: expecting numeric expressions
match if ((substring (option host-name,0,6) = "TEST2C") & (substring (hardware,0
^
Configuration file errors encountered -- exiting

Martin McCormick



More information about the dhcp-users mailing list