Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 08-13-2007, 10:14 AM   #1
Registered: May 2006
Location: England
Distribution: CentOS, Ubuntu Server, Untangle, pfSense
Posts: 78

Rep: Reputation: 15
Force DHCP To Refuse Clients A DHCP Lease Depending On Client MAC Address


I have a setup at home where I have a network consisting of two servers each on a different subnet. There is one linux server between the two subnets that runs as a DHCP Server. One of my other servers also runs DHCP Server. This is a Windows server.

The problem I have is that I want to be able to make the Linux Server refuse IP addresses that should be handled on the other subnet. The two subnets are using the same media between the server room in the garage and the main house and I have no way of being able to change this as the is only one trunk cable.

I have configured my Windows Server to only allow clients listed in the reservations section to obtain DHCP leases on subnet 2 server

The Linux server I am using as a firewall, It has three NIC's installed:

Card One - Internet (WAN)
Card Two - Subnet 1 (General LAN)
Card Three - Subnet 2 (DMZ LAN)

Unfortunately As I mentioned above these two subnets share the same cable from the server room to the house.

So, My question is:

Can I make my linux server on subnet 1 refuse DHCP leases to clients in subnet 2 if i somehow program the MAC addresses of the clients into the Server? If it can be done, How can this be Done?

Any help will be much apprieciated

Many Thanks,

Old 08-13-2007, 02:55 PM   #2
Registered: Dec 2006
Distribution: Slackware 11
Posts: 144

Rep: Reputation: 15
Use iptables with the MAC match: http://iptables-tutorial.frozentux.n....html#MACMATCH

e.g. iptables -A INPUT -p UDP --destination-port 67:68 -m mac --mac-source XX:XX:XX:XX:XX:XX -j DROP

Add a rule for each mac address of the machines that the DHCP server should not service.

Last edited by jeenam; 08-14-2007 at 10:37 AM.
Old 08-13-2007, 04:41 PM   #3
LQ Guru
Registered: Aug 2001
Location: Dublin, Ireland
Distribution: Slackware
Posts: 5,700

Rep: Reputation: 65
Hate to just reply with a link, but this is what you're looking for:

The location of dhcpd.conf varies from distro to distro, usually in /etc/ or /etc/dhcp. You probably just want to put in a group with a bunch of declared mac to host mappings.

Old 08-17-2007, 01:54 AM   #4
Registered: May 2006
Location: England
Distribution: CentOS, Ubuntu Server, Untangle, pfSense
Posts: 78

Original Poster
Rep: Reputation: 15
Originally Posted by finegan View Post
Hate to just reply with a link, but this is what you're looking for:
Thanks very much, thats exactly what I wanted

Many Thanks,



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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
DHCP server and client lease question rickyinman Linux - Networking 0 04-14-2006 11:53 AM
how do I renew a dhcp client lease? susefan Linux - Networking 2 03-07-2005 12:49 PM
Can not get DHCP client lease on startup AlgebraicSpore Linux - Networking 2 06-15-2004 12:16 AM
dhcp clients not renewing lease tuxguy Linux - Networking 0 03-21-2004 12:27 PM
DHCP client fails to renew lease NiPNi Linux - Networking 2 04-06-2002 07:01 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:08 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
Open Source Consulting | Domain Registration