LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 04-05-2012, 12:24 AM   #1
hknoener
LQ Newbie
 
Registered: Mar 2012
Posts: 14

Rep: Reputation: Disabled
Fixed IP being taken - DHCP Server - CentOS 6


Hi.

I'm facing a problem with my DHCP server. I have a linux box using CentOS 6. My DHCP server is up and running.

I've needed to format my server and reconfigure my DHCP and everything else. After that all the computer on my Network needed to have their IP back and they took all sorts of IP addresses that they where not supposed to take. I even assigned 15 minutes as lease time to solve this problem at the beginning. It actually worked to put some order on my IP leases, but the problem persists.

For instance, the IP 192.168.1.138 (a real example, in this case) is stated to be given to a certain MAC address and there's another computer using this IP at the moment. My IP range goes from 192.168.1.2 up to .170. The fixed IPs are in the range of 2-15 and 120-170. All the rest is free to be taken but even though sometimes random computers just take fixed IPs and take them.

My Squid rules are based on IP range so it causes me all sorts of problems cause some users have rules applied that are note supposed to be apply to them.

Never had a IP conflict, but it looks-like that when the assigned computer is offline, any other computer that renews the IP can, by chance take that IP. I don't think it's supposed to be that way. Just because the MAC address is not online doesn't mean that my server should give this IP to any other computer, specially if I have a big IP Range that is empty and can be used for this purpose.

Is there anything that I'm missing?

Here is part of my dhcpd.conf, up to 5-6 fixed address. All the rest is basically the same.

Code:
#
# DHCP Server Configuration file.
#   see /usr/share/doc/dhcp*/dhcpd.conf.sample
#   see 'man 5 dhcpd.conf'
#

ddns-update-style interim;
#ignore client-updates
authoritative;

subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.1 192.168.1.170;
default-lease-time 900;
max-lease-time 900;
  option routers 192.168.1.1;
  option broadcast-address 192.168.1.255;
  option subnet-mask 255.255.255.0;
#  option ntp-servers 192.168.1.1;
  option domain-name-servers 192.168.1.2;
#  option domain-name "sda.sdasystem.com";
#  option domain-name-servers 117.103.88.33,71.163.249.97;
  option netbios-name-servers 192.168.1.2;

host HSLABTEACHER01 {
  hardware ethernet 00:25:64:be:3f:48;
  fixed-address 192.168.1.3;
  }
host ESLABTEACHER01 {
  hardware ethernet 00:25:64:c2:c4:d7;
  fixed-address 192.168.1.5;
  }
host NOTE2 {
  hardware ethernet e0:cb:4e:37:2b:92;
  fixed-address 192.168.1.4;
  }
host ACCOUNTANT {
  hardware ethernet 44:87:fc:95:de:3f;
  fixed-address 192.168.1.6;
  }
host SECRETARY {
  hardware ethernet 00:26:2d:2e:19:c1;
  fixed-address 192.168.1.7;
  }
host PRINCIPAL {
  hardware ethernet 44:87:fc:94:80:8c;
  fixed-address 192.168.1.8;
 
Old 04-05-2012, 02:02 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,374

Rep: Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962
just keep the fixed range outside of the dynamic range - make your "range" value start at 192.168.1.20 or similar.
 
Old 04-05-2012, 02:14 AM   #3
hknoener
LQ Newbie
 
Registered: Mar 2012
Posts: 14

Original Poster
Rep: Reputation: Disabled
Acid, pretty clever. I haven't thought about it.

If my fixed-IP-machines are out of range, is that a problem? I can make my range goes from .20 till .119, then all my fixed range is protected, the lower part and the higher part. Is that ok?

Didn't know that I could have computers out of my DHCP range. Is there any major consequence applying this new configuration?
 
Old 04-05-2012, 02:18 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,374

Rep: Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962
it's not a problem, no. They just need to have a suitable subnet declaration to match with to pick up the other details like routers and masks.
 
Old 04-05-2012, 02:30 AM   #5
hknoener
LQ Newbie
 
Registered: Mar 2012
Posts: 14

Original Poster
Rep: Reputation: Disabled
Acid, where do I place that info? I just have IP there, no subnet.

Code:
host ACCOUNTANT {
  hardware ethernet 44:87:fc:95:de:3f;
  fixed-address 192.168.1.6;
  }
 
Old 04-05-2012, 02:49 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,374

Rep: Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962
Quote:
When dhcpd tries to find a host declaration for a client, it first
looks for a host declaration which has a fixed-address declaration that
lists an IP address that is valid for the subnet or shared network on
which the client is booting. If it doesn't find any such entry, it
tries to find an entry which has no fixed-address declaration.
So from this it should be fine where it currently is, this suggests that there's no syntactical scoping required in the config, it'll all be parsed and made sense of without further relation between the fixed-address and the subnet definitions.
 
Old 04-05-2012, 04:23 AM   #7
hknoener
LQ Newbie
 
Registered: Mar 2012
Posts: 14

Original Poster
Rep: Reputation: Disabled
Ok, I'll try to make the changes that you've proposed and will run some tests. Accordingly to this explanation, I think what I need to modify is pretty basic.

Thanks for your help. I'll come back with some feedback.
 
Old 04-06-2012, 03:57 AM   #8
hknoener
LQ Newbie
 
Registered: Mar 2012
Posts: 14

Original Poster
Rep: Reputation: Disabled
Acid, it worked like a charm. Thank you very much. Just changed the range and that was it.
 
  


Reply

Tags
centos, dhcp, dhcpdconf


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
New install of Centos 5.5 will not work on net work with fixed IP or DHCP JohnScub164 Linux - Networking 2 01-15-2011 12:46 PM
DHCP server on CentOS 5.5 not working banexx Linux - Server 4 12-02-2010 07:09 AM
fixed address in dhcp server digsecurity Linux - Server 6 07-09-2010 01:33 AM
CentOS VMware Server 2X and DHCP metallica1973 Linux - Virtualization and Cloud 8 04-30-2010 06:34 PM


All times are GMT -5. The time now is 02:19 AM.

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