Problem with a conditional evaluation from Microsoft to ISC
Bruce Hudson
Bruce.Hudson at Dal.Ca
Mon Jan 19 21:50:55 UTC 2009
> Hi, I need to migrate a Microsoft DHCP configuration to ISC DCHP from a
> client. In the original configuration (Microsoft) they have this
> conditional evaluation:
>
> [($TIME ("integer")&1)==1 ?"file.a.bin":"file.b.bin"]
>
> As you can see the idea of the line it's like a random condition $TIME,
> the server offers a diferente file to the client request. They use this
> to obtain a basic balancing for two CMTS.
>
> I read dhcp-eval and I can't find anything like this... any ideas that
> allow me to obtain the same result with ISC ?
>
Off the top of my head, the following code should work. It uses the
last byte of the client supplied "XID" value (the 8th byte of the the
packet) as a source of randomness; converts it to is binary value as an
ASCII string; and extracts the final bit.
if (suffix (binary-to-ascii (2, 8, ".", packet(7, 1)), 1) = 0) {
myfile = "file.a.bin";
} else {
myfile = "file.b.bin";
}
This is not inline as your original expression seems to be. It stores
the file name into a variable. You can then use that in what-ever
statement the expression was taken from.
The client's hardware address might also serve to balance requests.
It would have the (dis)advantage that a client will always get the same
CMTS.
--
Bruce A. Hudson | Bruce.Hudson at Dal.CA
UCIS, Networks and Systems |
Dalhousie University |
Halifax, Nova Scotia, Canada | (902) 494-3405
More information about the dhcp-users
mailing list