1829770 Members
3129 Online
109992 Solutions
New Discussion

linux dhcp server

 
SOLVED
Go to solution
linuxtolinux
Frequent Advisor

linux dhcp server

Hi all
I am using a linux dhcp server(redhat 7.3) on my lan with the below configuration:
ddns-update-style none;
allow booting;
allow bootp;

option domain-name "xxxxxx.com.lb";
option subnet-mask 255.255.255.0;
option broadcast-address 193.100.200.255;
option domain-name-servers 193.100.200.139;
option routers 193.100.200.5;

subnet 193.100.200.0 netmask 255.255.255.0 {
range 193.100.200.201 193.100.200.230;
default-lease-time 86400;
max-lease-time 259200;
}
The problem that I am facing is as follow:
when I connect a laptop for the first time,it takes an automatic ip and everything works fine.When trying to connect the same laptop after a week or couple of days it signals an ip conflict and I am sure that the ip offered isn't used by any other machine.I tried once to delete the lease related to the mac address of the laptop and it worked (the ip conflict signal didn't appear).
I need to know why this problem occurs and what is the better solution to solve it?Should I always delete the corresponding lease?

Thanks
12 REPLIES 12
Steven E. Protter
Exalted Contributor
Solution

Re: linux dhcp server

Shalom LinuxtoLinux,

You may be sure the IP is not in use but the dhcpd server is not so sure. It may have a problem recognizing that you are off the network so when you come back on its confused because it thinks the lease is still open when in fact it should have been shut down when you disconnected.

Are you disconnecting normally or dumping the laptop into quick standby with a close and run?

The bottom line here is your product is pretty old and you may find it easier to upgrade the entire OS than track this down.

You can try increasing the range of the dhcpd server.

Also, if you have any other device on your network, like a wireless access point offering dhcpd services, this may be interfering with normal server operations. There should be one DHCPD server on a local area network.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Andrew Bruce
Valued Contributor

Re: linux dhcp server

Hi Linuxtolinux,

Another option to try is to set up static IP addresses for devices you know to connect to your lan.

This is all controlled by the MAC address of the NICs in each device. A simple addition to your DHCPD config would be something like:

group {
ddns-updates off;
use-host-decl-names on;
host laptop {
hardware ethernet XX:XX:XX:XX:XX:XX;
fixed-address 193.100.200.100;
}
}

To add more than one device, just create multiple 'host { }' entries.

Obviously, you should be careful to assign fixed IP addresses outside the dynamic range you specified.

Maybe try that and see if your laptop still has problems.

The other advantage of this is that you can turn off dynamic IPs (*slightly* better security), and you always know what IP addresses are allocated to which devices.

Kind regards,

Andy Bruce

ps Don't forget to assign points! :-)
I Love it when a plan comes together!
Andrew Bruce
Valued Contributor

Re: linux dhcp server

Hi Linuxtolinux,

Just curious: Did you manage to resolve the issue?

Regards,

Andy Bruce
I Love it when a plan comes together!
linuxtolinux
Frequent Advisor

Re: linux dhcp server

Hi guys again,
Regarding my previous problem,I found something interesting but somewhat confusing.
I have a server on my lan with centos 4.3 installed.This server has an eth0 configured with a static ip address but each time I reboot this machine it takes a dynamic ip and than the static ip.I can only telnet the machine via the static ip.
I searched in deep in the configuration files of the server and i am not able to know how this dynamic ip is being issued by this machine?
why it is requesting a dynamic ip even am configuring it staticly?
Please any idea.....
NB:I installed the centos via http

thanks
Andrew Bruce
Valued Contributor

Re: linux dhcp server

Hi Linuxtolinux,

That is a curious one.

Have a look in /etc/sysconfig/network-scripts/ifcfg-eth0

Look for a line that starts:

BOOTPROTO=

if the parameter is 'static' then it shoud not use dhcp. If it is dynamic...

also check to make sure there are no aliases for the eth0 device (are there any other ifcfg-* files other than eth0 and lo?).

I am assuming, of course, that your talking about the difference between dhcp and static (non-dhcp) allocation, as opposed to dhcp assigning either the same IP every time, or chosing an IP from a pool?

If you're still having problems, post the your ifcfg file and dhcp.conf file and I can take a look to see if there's anything fishy...

Regards,

Andy Bruce
I Love it when a plan comes together!
Andrew Bruce
Valued Contributor

Re: linux dhcp server

Hi Linuxtolinux,

That is a curious one.

Have a look in /etc/sysconfig/network-scripts/ifcfg-eth0

Look for a line that starts:

BOOTPROTO=

if the parameter is 'static' then it shoud not use dhcp. If it is dynamic...

also check to make sure there are no aliases for the eth0 device (are there any other ifcfg-* files other than eth0 and lo?).

I am assuming, of course, that your talking about the difference between dhcp and static (non-dhcp) allocation, as opposed to dhcp assigning either the same IP every time, or chosing an IP from a pool?

If you're still having problems, post the your ifcfg file and dhcp.conf file (is it the same one you posted originally?) and I can take a look to see if there's anything fishy...

Regards,

Andy Bruce
I Love it when a plan comes together!
Alexander Chuzhoy
Honored Contributor

Re: linux dhcp server

I saw something similar after making definitions in both places: configuration file (/etc/sysconfig/network-scripts/ifcfg-ethX) and GUI (system-config-network).
If you used GUI - then I suggest you to delete all entries from there and to redefine everything from scratch in the configuration file.

Furthermore, you mentioned eth0 card. Is this the only card on your machine?
linuxtolinux
Frequent Advisor

Re: linux dhcp server

Hi,
I tried to eliminate everything Alexander form gui and reconfigure throught the scripts:same problem.
here are my ifcfg-eth0 and dhcpd.conf files:
####dhcpd.conf####
ddns-update-style none;
allow booting;
allow bootp;

option domain-name "xxxxxx.com.lb";
option subnet-mask 255.255.255.0;
option broadcast-address 193.100.200.255;
option domain-name-servers 193.100.200.139;
option routers 193.100.200.5;

subnet 193.100.200.0 netmask 255.255.255.0 {
range 193.100.200.201 193.100.200.230;
default-lease-time 86400;
max-lease-time 259200;
}


####ifcfg-eth0########
DEVICE=eth0
BOOTPROTO=static
BROADCAST=193.100.200.255
HWADDR=00:0E:0C:09:C3:6A
IPADDR=193.100.200.74
NETMASK=255.255.255.0
NETWORK=193.100.200.0
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
PEERDNS=yes
GATEWAY=193.100.200.5
IPV6INIT=no

########dhcp log file#######3
Sep 4 13:05:27 quebec dhcpd: DHCPREQUEST for 193.100.200.213 (193.100.200.200) from 00:0e:0c:09:c3:6a via eth0
Sep 4 13:05:27 quebec dhcpd: DHCPACK on 193.100.200.213 to 00:0e:0c:09:c3:6a via eth0


10x
Andrew Bruce
Valued Contributor

Re: linux dhcp server

Have you checked to see if there is a dhcp client running on your fixed-IP box?

ps -ef | grep dhclient

If you *had* the box on dynamic IP, then changed to static, you may still have this client running.

If so, just kill it. If not, then we need to scratch our chins a bit more! :-)

Regards,

Andy Bruce
I Love it when a plan comes together!
linuxtolinux
Frequent Advisor

Re: linux dhcp server

hi
there is no dhclient running
Thomas Callahan
Valued Contributor

Re: linux dhcp server

What is the output of "rpm -qa | grep dhcp*"

Thanks,
Tom Callahan
linuxtolinux
Frequent Advisor

Re: linux dhcp server

rpm -qa | grep dhcp*
dhcp-devel-3.0.1-12_EL.centos4
dhcpv6-0.10-8
dhcpv6_client-0.10-8
dhclient-3.0.1-12_EL.centos4
dhcp-3.0.1-12_EL.centos4

10x