LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   dhcp not writing leases (https://www.linuxquestions.org/questions/linux-newbie-8/dhcp-not-writing-leases-309447/)

oberon-ken-obi 04-03-2005 10:55 PM

dhcp not writing leases
 
Hi all

Fedora Core2

Error message is as follows, excuse the format but im re-typing it from a screenshot.png.
dhcpd failed. The error was: Starting dhcpd Internet Systems Consortium DHCP Server V3.0.1rc14.
Copywrite etc blah blah.
For more info see www.isc.org/sw/dhcp/
[went here and it had no solution that I could understand]

Wrote 0 deleted host decls to leases file.
Wrote 0 new dynamic host decls to leases file.
Wrote 0 leases to leases file.

Not configured to listen on any interfaces!

Goes on to say if i didnt get this from isc.org dont ask for help.
Read the readme before complaining, etc etc.

Problem began when I was told I would get better performance if I use static ip addresses. After backing up and writing down all the relevant config info that I thought I was changing, I tried it and I was unable to get it right. So I figured I will just go back to dhcp. Now it seems something other than the things I changed by hand have been altered as well.

Sending this via a WinXP box ... sorry the FC box PSU died so I installed the drive in a slid in cradle and failed to write the exact path/file name. I didnt change this file when I tried to set static ip addresses.

This is from memory.

/etc/dhcp(d?).conf is empty except for the # comments at the beginning.

I have man both dhcp.leases and dhcpd.conf and could not quite understand what was required.

I used the example dhcpd.conf file but it didnt work and I dont know what I needed to change for my implementation.

Dont know what else to post, please tell me of any other info needed to resolve my problem.

Regards

Allan

EDIT
fixed with reinstall of FC2, kinda makes my tag a bit redundant :+\
how do i remove the whole thread

ahwkong 04-04-2005 06:30 AM

Well, it is very confusing message indeed.

So,
1) Your linux is currently dead due to a malfunctional PSU. You plug the original linux harddrive into a XP box such that you can access the Linux files, right? (Why u did this, BTW?)

2) You tried to use static IP address for your Linux machine. For this cause, you altered something. Did that include the dhcpd.conf or not? What kind of manual changes you have made?

Actually, when you said, "/etc/dhcp(d?).conf is empty except for the # comments at the beginning.", doesn't it explain why the error message come up? You must define something such that dhcpd knows about the range of IPs that it has to distribute to.


Honestly, the sample dhcpd.conf is very very plain and easy to understand. If you cannot follows it, I do not think anyone else can do it better. Basically you follows each items defined in the conf file and substitute the dummy values with yours setting.

DavidPhillips 04-04-2005 06:57 AM

When you get it powered up again post the output of ifconfig and the contents of the dhcpd.conf file you have tried.

You may also need to create the leases file if it does not exist.

oberon-ken-obi 04-04-2005 11:28 PM

Hi all

Maybe I was not so clear initially.

In answer to ahwkong questions 1. and 2.

I did this so i could post a question. WinXP box had windows OS drive removed. FC2 was used via a slide in carriage, ie. not dual boot.

I did not manually alter any .conf files making the static ip address changes. All of the things I manually changed were written down and all were changed back when I couldnt get statics to work. Obviously things I didnt back up AND did not change manualy were altered by the OS somehow.

Quote---
Actually, when you said, "/etc/dhcp(d?).conf is empty except for the # comments at the beginning.", doesn't it explain why the error message come up? You must define something such that dhcpd knows about the range of IPs that it has to distribute to.
/Quote---

the (d?) reference was due to the fact that i was not sure if it was dhcp.conf OR dhcpd.conf.from my falable memory.

If I knew the answer, I would not post here.

Does that make it clearer ahwkong?

-----------

Thanks DavidPhillips for your input so far.

Output of ifconfig is

----------------
[root@brellium dhcp]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:6E:2B:C9:07
inet addr:10.1.1.101 Bcast:10.255.255.255 Mask:255.0.0.0
inet6 addr: fe80::20c:6eff:fe2b:c907/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:54 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:7182 (7.0 Kb)
Interrupt:10 Base address:0x9800

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:2186 errors:0 dropped:0 overruns:0 frame:0
TX packets:2186 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2046040 (1.9 Mb) TX bytes:2046040 (1.9 Mb)

[root@brellium dhcp]#


----------------

Contents of dhcpd.conf is

----------------

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

subnet 239.252.197.0 netmask 255.255.255.0 {
range 239.252.197.10 239.252.197.250;
default-lease-time 600;

}


------------------

This was just the minimum that the man dhcpd.conf said may work.
I dont know where the 1st two lines came from, i didnt try to comment those out, now that i think about it..

I have read the section on dhcpd.leases and it said this

--------------------

When dhcpd is first installed, there is no lease database. However,
dhcpd requires that a lease database be present before it will start.
To make the initial lease database, just create an empty file called
/var/lib/dhcp/dhcpd.leases. You can do this with:

touch /var/lib/dhcp/dhcpd.leases

-------------------

I then did that. Contents of dhcpd.leases is

-------------------

# All times in this file are in UTC (GMT), not your local timezone. This is
# not a bug, so please don't ask about it. There is no portable way to
# store leases in the local timezone, so please don't request this as a
# feature. If this is inconvenient or confusing to you, we sincerely
# apologize. Seriously, though - don't ask.
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-V3.0.1rc12

all comments, no meat at all.

---------------------

Error message when I try to start dhcp with services control tool at this point is now.

---------------------------

For more info, please visit http://www.isc.org/products/DHCP
Wrote 0 leases to leases file.


No subnet declaration for eth0 (10.1.1.101).
** Ignoring requests on eth0. If this is not what
you want, please write a subnet declaration
in your dhcpd.conf file for the network segment
to which interface eth0 is attached. **


Not configured to listen on any interfaces!

-----------------------------

Now I am aware that the problem is at least partly here, my eth0 card has address of 10.1.1.101
and I have the default numbers
range 239.252.197.10 239.252.197.250;
I did try to change the range to 10.1.1.0 10.1.1.200
and matched the netmask to the output from ifconfig for that device. ie.255.0.0.0

Other various errors occured then, so I put it back to default settings suggested in man dhcp
and since I seem not to be able to grasp the concepts needed, and after some time spent I offer it up for your further suggestions.

Kindest regards

Allan

ahwkong 04-04-2005 11:40 PM

I am not challenging the file name per se. And I just wonder, if your description says it is an empty dhcpd.conf, then of course it must give rise to a problem. You need to define something in the dhcpd.conf. If it is the case, shouldn't you put back the content.

That's why I said you made a very confused post in the first place.

Please show a little bit of respect, young man. People are just volunteers here.

So long.

oberon-ken-obi 04-04-2005 11:53 PM

ahwkong

I have nothing but respect for the people who post on these boards, you seem to have taken what I said in the wrong context. I was merely trying to clarify what I said as sometimes I am a bit unclear about things, and I just wanted to make sure I got the file names correct so there would be no confusion. Ack seems the harder I try sometimes, it becomes as clear as mud.

As I have stated I didnt remove anything manually from the dhcpd.conf file so i cannot put it back. I realise that something needs to be in the file, but what that is, is the whole crux of the post.
What seems obvious to you, is not to me.

I did try to resolve it myself but not having an understanding of the dhcp protocol (even after reading man pages) I was unsuccessful at resolving it.

And thanks for the young man reference, 39 years young. I like the sound of that :+)

Regards

Allan

DavidPhillips 04-07-2005 07:16 AM

that's at least part of the problem

ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:6E:2B:C9:07
inet addr:10.1.1.101 Bcast:10.255.255.255 Mask:255.0.0.0


the ip and subnet mask define the network as 10.0.0.0

This network must have a subnet declaration in your dhcpd.conf file.



something like this would be needed..

subnet 10.0.0.0 netmask 255.0.0.0 {
range 10.1.1.102 10.1.1.200;
default-lease-time 600;

}


The range of IP's shown is an example, use what you want to have excluding any used ip's on the network in this range.


You may want to also add dns servers and default gateway (router) to the dhcpd.conf



Post some of the other errors.

more options

max-lease-time 3600;
option routers 10.1.1.101;
option broadcast-address 10.255.255.255;
option domain-name "something.com";
# something valid here
option domain-name-servers 68.63.0.5, 68.63.0.6;





oberon-ken-obi 04-12-2005 07:50 PM

Hi DavidPhillips

Been doing other stuff so didnt try you idea till now. Your help is most certainly appreciated, I did as suggested regarding

DavidPhilips said...
something like this would be needed..

Code:

subnet 10.0.0.0 netmask 255.0.0.0 {
range 10.1.1.102 10.1.1.200;
default-lease-time 600;

}

Still nothing, so doing what all good newbies do was to start again with a clean slate.

Install went without a hitch, basically a default FC2 Desktop install to keep it simple and to have a working box with which to post.
Given the option at install to use DHCP or static I chose the former enabled firewall, allowed www through it.
Probed for modem, found it. Setup FInish.
Kernel was oldish (2.6.5-1.358) so I ran

Code:

# rpm -Uhv kernel 2.6.9-1_FC2.i686.rpm from the directory in which i had it stored.

This appeared to work fine.
However it broke DHCP (or something did), good grief i dont know what I do wrong sometimes. I did no other updates changed nothing else. So I re-did all the above steps/suggestions but still to no avail.

Still nothing, so doing what all good newbies do was to start again with a clean slate. At least I have documented it well this time.

Now I am posting from the FC2 box NOTHING updated at all, and thinking a great idea would be to make a copy of /etc/dhcpd.conf and any other dhcp* files that were auto generated, I did

Code:

# find / -name dhcp -mount
No dhcp.conf, no dhcpd.leases only have /var/lib/dhcp which is an empty directory.

ifconfig yields the following...

Code:

[root@localhost dhcp]# ifconfig
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:7264 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7264 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:15250005 (14.5 Mb)  TX bytes:15250005 (14.5 Mb)
 
ppp0      Link encap:Point-to-Point Protocol
          inet addr:203.xxx.xxx.xxx  P-t-P:203.xxx.xxx.xxx  Mask:255.255.255.255      # masked as I have seen others do the same when posting
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:7056 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7596 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:6782034 (6.4 Mb)  TX bytes:632484 (617.6 Kb)
 
[root@localhost dhcp]#

I am totally bewildered now, service-configuration tool does'nt even have DHCP listed (let alone running).
Still using dial-up, called my ISP and they say they have not changed anything pertaining to this, IE i still need DHCP enabled to connect.
Dont get the DHCP error at boot.

I am going to remove my tag until I can actually practice what I preach....

Yours,
now totally bewildered

Allan

DavidPhillips 04-14-2005 01:44 PM

You do not need a dhcp server to connect to your isp. Maybe that's the problem. If however you do ned a dhcp server then you must create the required files and install and run dhcpd.


What are we trying to do again?


All times are GMT -5. The time now is 12:16 PM.