Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 07-25-2013, 03:40 PM   #1
Registered: Nov 2003
Distribution: RH, Fedora, Debian, Knoppix
Posts: 436

Rep: Reputation: 31
DHCPD configuration to not give default gateway to a set of clients


In a specific subnet, there are some DHCP clients that I don't want to have a default gateway, but I want all the other clients to have a default gateway set.

I can identify the exception hosts by MAC address without problem, but what would I use as config in dhcpd.conf?

For the curious, I need this config because most clients in this subnet are regular clients, with only one IP address, but a few of them are Windows clients that are in 2 vlans and if I provide two default gateway to a Windows machine, it doesn't know which one to use or chooses randomly, and when it uses the wrong one, it can't reach its destination.

Here is what I tried:

subnet netmask {

        class "Win" {
                match hardware;

        subclass "Win" 64:31:50:33:B5:23; 
        subclass "Win" 40:0e:85:03:61:17;  

# Pools

        pool {
        option domain-name-servers      192.168.x.x,192.168.x.x;
        option domain-name                      "mydomain.lan";
        option routers;
        option subnet-mask;
        deny members of "Win";

        pool {
        option domain-name-servers      192.168.x.x,192.168.x.x;
        option domain-name                      "mydomain.lan";
        option subnet-mask;
        allow members of "Win";
        deny unknown-clients;
However, clients that match the configured MAC addresses still get the same IP address and still get the default gateway.
Old 07-25-2013, 07:37 PM   #2
Ser Olmy
Senior Member
Registered: Jan 2012
Distribution: Slackware
Posts: 2,322

Rep: Reputation: Disabled
Have you been able to determine whether the problem is with the class/subclass definition or if the second pool incorrectly "inherits" the gateway setting from the first pool? Temporarily changing another, common pool parameter (like the domain name) should help narrow it down.

FWIW, in the sample configurations I've seen, the syntax for MAC address matching has always looked like this:
class Win {
match pick-first-value (option dhcp-client-identifier, hardware);
You could try that and see if it makes a difference.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] dhcpd not giving deafult gateway and dns to clients Peter_Karlsen Linux - Server 7 12-01-2009 04:59 PM
Problem assigning default gateway to clients through dhcpd (ubuntu) milpoer Linux - Networking 2 04-16-2009 09:05 AM
Default gateway not being set when using DHCP ret602 Linux - Networking 1 09-20-2007 01:17 PM
How to set default gateway Harlin Linux - Networking 2 02-28-2006 04:17 AM
How can I tell what my default gateway is currently set as? abefroman Linux - Networking 6 09-10-2005 01:15 PM

All times are GMT -5. The time now is 01:57 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration