Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Our Current DHCPD.conf looks like the following.

subnet 10.0.32.0 netmask 255.255.255.0
{
        range 10.0.32.100 10.0.32.254;
        option subnet-mask 255.255.255.0;
        option broadcast-address 10.0.32.255;
        option domain-name-servers 208.67.222.222,208.67.220.220;
        option routers 10.0.32.5;

        host Dev-ABaird-W {
                hardware ethernet 00:1D:09:3E:49:13;
                fixed-address 10.0.32.94;
    }

    ... more static hosts ....

}

About as basic as it gets. The old router is 10.0.32.1, our company wanted to implement a squid proxy to better monitor web traffic while at work, and if necessary block large time-wasters, IE Facebook.com.

However, we've quickly realized that this change has played a mean prank on our Polycom SIP Phones. Occasionally our phones will not ring, the end recipient hears ringing (this is artificially created by our PBX) however the handset never rings. The ONLY thing that has changed in our network is the option routers line.

So, Since all Polycom MAC addresses begin with 00:04:F2 would it be possible in DHCP to say any 00:04:F2:::* MAC addresses get option routers 10.0.32.1, and anything else must talk with our Gateway?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

You can use a conditional expression to match against the MAC address of the phones:

if substring(hardware, 1, 3) = 00:04:f2 {
    option routers 10.0.32.1;
} else {
    option routers 10.0.32.5;
}

I tested this inside a subnet stanza, but I believe it will work anywhere that an option command will work. Tested with ISC DHCPD 3.1.2.

share|improve this answer
    
+1 this is exactly what i am looking for -- i didn't know DHCPD config supported IF logic. Thanks. –  GruffTech Apr 26 '10 at 20:50
1  
The documentation isn't the best, but your system should have a dhcp-eval(5) manpage that describes it it more detail. Good luck! –  James Sneeringer Apr 26 '10 at 21:39

I believe what your looking for is groups. Groups will allow to you pass different options, such as routers, to different groups of hosts.

For example.

subnet 10.0.32.0 netmask 255.255.255.0
{
        range 10.0.32.100 10.0.32.254;
        option subnet-mask 255.255.255.0;
        option broadcast-address 10.0.32.255;
        option domain-name-servers 208.67.222.222,208.67.220.220;
        option routers 10.0.32.1;
}


group {
     # Group uses a different router.
     option routers 10.0.32.5;

     host Dev-ABaird-W {
                hardware ethernet 00:1D:09:3E:49:13;
                fixed-address 10.0.32.94;
     }

     ... more hosts ...
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.