Fwd: To add some filter rules in conf file

Ashmath Khan hashmat.email at gmail.com
Tue Oct 13 13:43:05 UTC 2009


---------- Forwarded message ----------
From: Ashmath Khan <hashmat.email at gmail.com>
Date: Tue, Oct 13, 2009 at 6:50 PM
Subject: To add some filter rules in conf file
To: Users of ISC DHCP <dhcp-users at lists.isc.org>


Hello,

I want to add some filter rules into the configuration file.
For example, If I find string "Amino" in the option dhcp-client-identifier,
then the range would be  A, options B and if the string is "Phone*" then the
range would be C and options D.
I tried this:
subnet 192.168.1.0 netmask 255.255.255.0 {
default-lease-time 86400;
max-lease-time 86400;
option routers 192.168.1.254;
option domain-name-servers 192.168.1.254;

if substring (option dhcp-client-identifier, 0, 5) = "Amino" {
range 192.168.1.64 192.168.1.253;
option time-offset -12345;
option boot-size 65000;
} elsif substring (option dhcp-client-identifier, 0, 5) = "Phone" {
range 192.168.1.66 192.168.1.253;
option time-servers 1.2.3.4,10.232.167.89;
option host-name "something.com";
ignore known-clients;
} else {
range 192.168.1.68 192.168.1.253;
option perform-mask-discovery false;
option policy-filter 3.4.5.6,255.255.255.0;
}

But its giving error:
/etc/dhcpd.conf line 8: right brace expected.
range
 ^
/etc/dhcpd.conf line 11: expecting a declaration
} elsif
 ^
/etc/dhcpd.conf line 16: expecting a declaration
} else
 ^
/etc/dhcpd.conf line 20: expecting a declaration
}
 ^
Configuration file errors encountered -- exiting


what could be the reason ? Or how do I put these in conf file ?
Thanks for help.

-Ashmath
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20091013/2291242c/attachment.html>


More information about the dhcp-users mailing list