LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Blocking IP Address ranges in dhcpd.conf (https://www.linuxquestions.org/questions/linux-networking-3/blocking-ip-address-ranges-in-dhcpd-conf-191038/)

pmcdaid 06-08-2004 05:36 AM

Blocking IP Address ranges in dhcpd.conf
 
Hi,
I need to block a range of IP Addresses in dhcpd.conf on my Linux system. I would like to exclude the range 192.168.20.200 - 192.168.20.220

Here's a snippet of my dhcpd.conf file which defines a range 192.168.20.100 - 192.168.20.150

subnet 192.168.20.0 netmask 255.255.255.0
{
pool
{
range 192.168.20.100 192.168.20.150;
}

}

Can I add a pool, range using allow or deny to block the dhcpd daemon from issuing IP addresses in the range 192.168.20.200 - 192.168.20.220?

Thanks,
Paul.

unforgivn 06-08-2004 07:57 AM

Hmmmmmmmm...
I don't know how on earth those addresses can be leased with your current configuration that you gave here...or maybe i'm just not looking straight today:P
I usually just use:

subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.2 192.168.0.250;
}

for the whole range of adress 2 - 250

In your example your pool is only 100 - 150 meanining that addresses between 200-220 will never be leased to computers from the DHCP server, because it isn't set!
in my example to exclude them from a list do the following...

subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.2 192.168.0.199;
range 192.168.0.221 192.168.0.250;
}
thats what I use

Astro 06-08-2004 01:39 PM

The correct configuration to do excludes, even tho these dont exist in linux, only windows, is as follows...

subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.2 192.168.0.199;
range 192.168.0.222 192.168.0.250;
}

You missed one number unforgivn, 192.168.0.222 instead of 221, *pushes your head back to the other side* there ya go

pmcdaid 06-09-2004 09:09 AM

Thanks for the response. I'm implementing a DHCP Configuration utility for Linux and I was looking at Windows as an example. I didn't know that excludes didn't exist in Linux.

Paul.

Astro 06-09-2004 09:18 AM

It's a technicality really. In windows you have to set the exclusions... in linux with dhcpd you set the ranges you want but no exclusions. you can pick a range from .100 - .200 and then another range from .205 - .210 and the technical "exclusion" if you, will is from .201 to .204


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