0

I'm having trouble successfully matching a mix of different mac address classes to their appropriate subnet declarations. These classes are meant to differentiate IP phones, kvm guests and desktops from each other. So far only the IP Phones (grandstream class) correctly. The pcs class is a mix of different kinds of mac addresses but they all fall into the same (wrong category). I'm wondering if anyone can review my configuration, and set me straight what I am doing improperly?

    class "grandstream" {
    match if (substring(hardware, 1, 3) = 00:0b:82);
    }
    class "vms" {
    match if (substring(hardware, 1, 3) = 52:54:00);
    }

    class "pcs" {
    #match if not 
    #(substring(hardware, 1, 3) = 00:0b:82);
    match if (binary-to-ascii (16,8,":",substring(hardware, 1, 3)) = "24:BE:05")
    or   (binary-to-ascii (16,8,":",substring(hardware, 1, 3)) = "00:1C:C0")
    or   (binary-to-ascii (16,8,":",substring(hardware, 1, 3)) = "A4:BA:DB")
    or  (binary-to-ascii (16,8,":",substring(hardware, 1, 3)) = "02:80:FD")
    or   (binary-to-ascii (16,8,":",substring(hardware, 1, 3)) = "5C:F8:A1");
    log (debug, (binary-to-ascii (16,8,":",substring(hardware, 1, 3))));
    }

    #shared-network we-we {
    subnet  192.168.1.0 netmask 255.255.255.0 {
    pool {
    range 192.168.1.10      192.168.1.210;
    deny members of "grandstream";
    allow members of "pcs";
    allow members of "vms";
    }
    # Subnet for management network
subnet 192.168.10.0 netmask 255.255.255.0 {
    pool {
    deny members of "grandstream";
    deny members of "pcs";
    range 192.168.10.200 192.168.10.253;
    }
    # Subnet for future lan network
subnet 192.168.20.0 netmask 255.255.255.0 {
    pool{
    deny members of "grandstream";
    deny members of "pcs";
    range 192.168.20.10 192.168.20.210;
    }
    # Subnet for future servers network
subnet 192.168.30.0 netmask 255.255.255.0 {
    pool {
    deny members of "grandstream";
    deny members of "pcs";
    range 192.168.30.200 192.168.30.253;
    }
    # Subnet for future phone network
subnet 192.168.40.0 netmask 255.255.255.0 {
    pool {
    allow members of "grandstream";
    deny members of "pcs";
    range 192.168.40.200 192.168.40.240;
    }
    # Subnet for future wifi-guests network
subnet 192.168.50.0 netmask 255.255.255.0 {
    pool {
    deny members of "grandstream";
    deny members of "pcs";
    range 192.168.50.200 192.168.50.253;
    }
  • Wow. No comments. At all. – SinaOwolabi Jul 14 '15 at 11:19
  • From first view I see that in the first two class definitions you compare the values and in class pcs you use binary-to-ascii to implement the same thing. But that's not the solution, that's only an inconsistency. I have a very similar problem in my question serverfault.com/questions/715011/…: the classes are just not assigned. – Daniel Alder Aug 18 '15 at 14:45
  • Thanks. I finally got a comment. I was able to fix it, way back then. You're right, I wasn't matching. – SinaOwolabi Aug 19 '15 at 17:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.