Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 02-22-2008, 10:05 AM   #1
LQ Newbie
Registered: Feb 2008
Posts: 2

Rep: Reputation: 0
How can i exclude an ip address from given range in dhcp server?

How can i exclude an ip or some ip addresses form given range in dhcp server
for example:
if the range is to
and i want to exclude to addresses not to be given
Old 02-22-2008, 02:58 PM   #2
LQ Newbie
Registered: Nov 2006
Location: Ventura California USA
Distribution: openSUSE
Posts: 23

Rep: Reputation: 3
Hmmm. I'm not sure of that is possible. My suggestion is to make your range -, leaving .001 - .015 for static IPs. Or, move the static range to .001 - .005 and make the DHCP range .006 - .254.
Old 02-22-2008, 11:38 PM   #3
LQ Newbie
Registered: Feb 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Originally Posted by bwayson View Post
Hmmm. I'm not sure of that is possible. My suggestion is to make your range -, leaving .001 - .015 for static IPs. Or, move the static range to .001 - .005 and make the DHCP range .006 - .254.

Yes it will work but is there any file where i can enter some ips to be excluded within the range?
Old 02-23-2008, 12:00 AM   #4
Registered: Dec 2004
Distribution: Slackware, Arch, FreeBSD
Posts: 202

Rep: Reputation: 34
bwayson's solution sounds pretty valid. Why exactly do you want to include all of the addresses in the dhcp server config, then exclude some, rather than just use a range that does not include the addresses that you want excluded?

That said, has some good info:

Even though DHCP gives out IP address dynamically, it also has the ability to reserve an IP address for a certain computer. In this sense it's almost as if the client computer has a static IP even though it uses DHCP to get it. This is useful if you want to be able to put entries in your /etc/hosts file and not have to worry about the entry becoming invalid over time.

The first thing we must do is to specify a name for the computer as a helpful identifier

host box1

Note that similarly to the subnet grouping, we are now starting a sub-group as seen by the addition of the curly braces. This allows us to have multiple host definitions within one subnet group.

This next line is what allows us to uniquely identify one computer from another. The hardware ethernet address is the same as the MAC address. This information can be found by running the command ifconfig <interface> | grep HWaddr on a client computer for linux and ipconfig /all for a client computer running windows.

hardware ethernet 00:50:AB:AB:AB:AB;

And finally this next line tells the dhcpd server what IP address you always want to be assigned to this computer. Note that I intentionally make all IP's assigned this way outside of the DHCP range we specified earlier. This is not a must as the dhcp server is smart enough to not give out two IP's simultaneously but it helps in being able to quickly recognize which clients used this feature.


If you have multiple ranges of IP addresses on the same subnet, you can add multiple range options to a subnet declaration.

subnet netmask
Old 03-05-2009, 03:39 AM   #5
LQ Newbie
Registered: Mar 2009
Posts: 5

Rep: Reputation: 0
DHCP and GateWay

Hi, guys how are you doing?

I have configured the DHCP from the server and entered the Gateway but there is no internet access I mean it is not working i don't now may be they are in deferent subnet or I made a mistake during the configuration?


1. Server IP is in class A which is and the included address in the Range are (

The excluded Address from the Range is the server IP ( and the printer server (

2. The Router Gateway is (which is Dynamic IP Address from ISP)

Please guys I need help I think I miss some thing in the configuration


Last edited by danyee22; 03-05-2009 at 04:11 AM.


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
Single DHCP server ,to provide the ip address to a MAC address in two different subne alix123 Linux - Software 5 05-08-2007 11:16 PM
Exclude a mac Address in Dhcp server alnmostafa Linux - Networking 3 12-30-2006 09:20 AM
How To know if a host configured with DHCP has obtained IP address from DHCP server? Prassanta SUSE / openSUSE 1 06-29-2006 09:48 AM
DHCP Server MAC Address found, IP address not assigned wmburke Linux - Wireless Networking 17 11-17-2004 10:33 AM
Apache2 Server - not working outside local ip address range Robstro Linux - Networking 3 06-14-2004 05:32 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:43 AM.

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