Easiest way to split users into separate classes?
Peter Rathlev
peter at rathlev.dk
Tue Feb 22 18:14:05 UTC 2011
On Tue, 2011-02-22 at 09:19 -0700, Jon Chesnut wrote:
> On our public access subnet, I'm hoping to use DHCP to assign 50% of
> users (approx.) to one access controller, and 50% to another. If
> usage continues to grow, I'll need to split it up further so that
> usage is split between 3 access controllers.
>
> So far, the only way I've managed to get this to work is to to match
> the last byte of the hardware (even bytes to class A and odd bytes to
> class B). While this works, it's taking 260 lines of config, which is
> neither elegant nor efficient. Can anyone think of an easier way to
> accomplish this? How the 50% split is accomplished doesn't really
> matter.
How about matching the last bit of the hardware address instead? That
would leave you with only two classes to match:
class "test_a" {
match if substring(binary-to-ascii(2, 8, "", substring(hardware, 6, 1)), 1, 1) = "0";
}
class "test_b" {
match if substring(binary-to-ascii(2, 8, "", substring(hardware, 6, 1)), 1, 1) = "1";
}
Beware that I couldn't get this to work correctly using subclasses for
some reason, but the above seems to work fine.
--
Peter
More information about the dhcp-users
mailing list