LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 07-25-2013, 02:40 PM   #1
ugob
Member
 
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


Hi,

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:

Code:
subnet 192.168.13.0 netmask 255.255.255.0 {

        class "Win" {
                match hardware;
        }

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

# Pools

        pool {
        range 192.168.13.50 192.168.13.150;
        option domain-name-servers      192.168.x.x,192.168.x.x;
        option domain-name                      "mydomain.lan";
        option routers 192.168.13.1;
        option subnet-mask 255.255.255.0;
        deny members of "Win";
        }

        pool {
        range 192.168.13.170 192.168.13.200;
        option domain-name-servers      192.168.x.x,192.168.x.x;
        option domain-name                      "mydomain.lan";
        option subnet-mask 255.255.255.0;
        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, 06:37 PM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,337

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:
Code:
class Win {
match pick-first-value (option dhcp-client-identifier, hardware);
}
You could try that and see if it makes a difference.
 
  


Reply



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 03:59 PM
Problem assigning default gateway to clients through dhcpd (ubuntu) milpoer Linux - Networking 2 04-16-2009 08:05 AM
Default gateway not being set when using DHCP ret602 Linux - Networking 1 09-20-2007 12:17 PM
How to set default gateway Harlin Linux - Networking 2 02-28-2006 03:17 AM
How can I tell what my default gateway is currently set as? abefroman Linux - Networking 6 09-10-2005 12:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:30 AM.

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