Problem with ISC DHCPD Lease variabels in combination with "Match if"

Discussion in 'Linux Networking' started by Niels Basjes, Apr 9, 2004.

  1. Niels Basjes

    Niels Basjes Guest

    Hoi,

    I'm trying something with the ISC DHCP server (version 3.0.1rc12) and
    I can't get it to do what I had in mind.

    I want to link certain systems to a class depending on dynamically
    found information. I've reduced the problem I found to the config file
    placed below and the resulting output when an unknown system is
    booting.

    Somehow the used class is "Do Rotterdam" even though the value that
    is used to check against is "Amsterdam".
    In the dhcpd.leases file correctly states the line
    set do-the-special-thing = "Amsterdam";

    What is happening here ? Have I misunderstood the way it works or is
    this a bug in the system ?


    ===============================================================
    # dhcpd.conf
    allow booting;
    ddns-update-style none;
    default-lease-time 7200;
    max-lease-time 72000;
    authoritative;

    # Define the default value if nothing is specified
    set do-the-special-thing = "Rotterdam";

    log (info, concat ("GLOBAL CHECK 1: ",do-the-special-thing));

    subnet 172.21.13.0 netmask 255.255.255.0 {
    option domain-name-servers 172.21.13.1;
    option routers 172.21.13.1;
    next-server 172.21.13.1;
    pool {
    range 172.21.13.100 172.21.13.110;
    allow unknown clients;
    deny known clients;
    set do-the-special-thing = "Amsterdam";
    log (info, concat ("AFTER SETTING TO AMSTERDAM:
    ",do-the-special-thing));
    }
    }

    log (info, concat ("GLOBAL CHECK 2: ",do-the-special-thing));

    class "Do Amsterdam" {
    match if do-the-special-thing = "Amsterdam";
    log (info, concat ("DOING AMSTERDAM: ",do-the-special-thing));
    }

    log (info, concat ("GLOBAL CHECK 3: ",do-the-special-thing));

    class "Do Rotterdam" {
    match if do-the-special-thing = "Rotterdam";
    log (info, concat ("DOING ROTTERDAM: ",do-the-special-thing));
    }

    log (info, concat ("GLOBAL CHECK 4: ",do-the-special-thing));
    ===============================================================

    My logfile output:
    ===============================================================
    Apr 6 23:46:34 dhcptester dhcpd: GLOBAL CHECK 1: Rotterdam
    Apr 6 23:46:34 dhcptester dhcpd: GLOBAL CHECK 2: Rotterdam
    Apr 6 23:46:34 dhcptester dhcpd: GLOBAL CHECK 3: Rotterdam
    Apr 6 23:46:34 dhcptester dhcpd: GLOBAL CHECK 4: Rotterdam
    Apr 6 23:46:34 dhcptester dhcpd: AFTER SETTING TO AMSTERDAM:
    Amsterdam
    Apr 6 23:46:34 dhcptester dhcpd: DOING ROTTERDAM: Amsterdam
    Apr 6 23:46:34 dhcptester dhcpd: DHCPDISCOVER from 00:0c:29:4f:09:19
    via eth0
    Apr 6 23:46:34 dhcptester dhcpd: DHCPOFFER on 172.21.13.110 to
    00:0c:29:4f:09:19 via eth0
    ===============================================================



    --
    Niels.

    Drs. ir. Niels Basjes - http://niels.basjes.nl/ - VCV 20000302
    mailto:`echo 'Niels Basjes'|awk '{print$1"@"$2".nl"}'`
    Hacker: One who enjoys the intellectual challenge of
    creatively overcoming or circumventing limitations.
     
    Niels Basjes, Apr 9, 2004
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.