LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 08-13-2007, 09:14 AM   #1
blackfish
Member
 
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


Hi,

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,

Blackfish
 
Old 08-13-2007, 01:55 PM   #2
jeenam
Member
 
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 09:37 AM.
 
Old 08-13-2007, 03:41 PM   #3
finegan
Guru
 
Registered: Aug 2001
Location: Dublin, Ireland
Distribution: Slackware
Posts: 5,700

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

http://www.linuxmanpages.com/man5/dhcpd.conf.5.php

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.

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

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by finegan View Post
Hate to just reply with a link, but this is what you're looking for:

http://www.linuxmanpages.com/man5/dhcpd.conf.5.php
Thanks very much, thats exactly what I wanted

Many Thanks,

Blackfish
 
  


Reply


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 10:53 AM
how do I renew a dhcp client lease? susefan Linux - Networking 2 03-07-2005 11:49 AM
Can not get DHCP client lease on startup AlgebraicSpore Linux - Networking 2 06-14-2004 11:16 PM
dhcp clients not renewing lease tuxguy Linux - Networking 0 03-21-2004 11:27 AM
DHCP client fails to renew lease NiPNi Linux - Networking 2 04-06-2002 06:01 PM


All times are GMT -5. The time now is 06:40 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration