How does DHCPD determine what IP address to assign and...

Simon Hobson dhcp1 at thehobsons.co.uk
Fri Jan 4 23:27:49 UTC 2008


Ryan McCain wrote:

>As far as you know, unless we upgrade to v4.x, there is no way we 
>can accomplish this?

You can do it, but it's much harder !

The expression you already have should do it - we don't know why it 
doesn't as we don't have enough information (you've been given some 
suggestions on how to debug it). But essentially, as things currently 
stand you have to cater for each possible format (ie 1, 2, or 3 
digits after the "Async") by testing for multiple expressions.

With version 4 and regex support you can just match for a regex along 
the lines of "^[0-9.]+Async[0-9]+$" which means (if I've got it right 
!) "At the start of the string, any sequence of one or more of the 
characters zero through nine plus the point, followed by the 
characters 'Async', followed by 1 or more characters zero through 
nine, at the end of the string"

^ = match the start of the string
[0-9.] = any one character from the set 0 to 9, or '.', might have to 
be [0-9\.] to 'escape' the special meaning of '.'
+ = match one or more occurances of the previous part
Async = the literal characters "Async"
[0-9] = any of the characters 0 to 9
+ = match one or more of them
$ = match the end of the string

It's best to be as specific as practical, a regex of ".*Async.*" 
means "Any sequence of zero or more occurances of any character, 
followed by Async, followed by zero or more occurances of any 
character" would probably match clients you didn't want it to - 
specifically ANY string containing Async anywhere within it.


More information about the dhcp-users mailing list