Networking Forums

Networking Forums > Computer Networking > Linux Networking > dhcp not starting since a couple of days

Reply
Thread Tools Display Modes

dhcp not starting since a couple of days

 
 
H. S.
Guest
Posts: n/a

 
      12-22-2004, 06:54 PM
Hi,

On my Debian Sarge machine, kernel 2.6.9, DHCP seems to be giving some
problems since a couple of days.

The problem started when I noticed that it wasn't starting on boot up
and I was getting this in my syslog file:
#--------------------------------------------
dhcpd: No subnet declaration for eth1 (192.168.1.1).
dhcpd: Please write a subnet declaration in your dhcpd.conf file for the
dhcpd: network segment to which interface eth1 is attached.
dhcpd: exiting.
#--------------------------------------------

I am using this machine of mine to connect to an ADSL modem through eth1
(IP 192.168.1.1) and to my LAN switch through eth0(IP 192.168.0.2). I
was not sure why this error starting coming up. I searched google and
newsgoups and figured I need to tell dhcp that my eth1 is not to be
entertained, only eth0. So I put these lines in /etc/dhcpd.conf (below
my earlier configuration lines):
#--------------------------------------------
subnet 192.168.1.0 netmask 255.255.255.0 {
not authoritative;
}
#--------------------------------------------

Then "/etc/init.d/dhcp start" gave no errors, dhcpd started, but my LAN
computer (running Sid) couldn't find any dhcp IP address.

Then I changed the above lines to :
#--------------------------------------------
subnet 192.168.1.0 netmask 255.255.255.0 { }
#--------------------------------------------

with the same results: dhcpd was working but the LAN computer couldn't
find any IP address.


Then I stopped the dhcpd and started it as root:
#--------------------------------------------
#> dhcpd
Internet Software Consortium DHCP Server 2.0pl5
Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.
All rights reserved.

Please contribute if you find this software useful.
For info, please visit http://www.isc.org/dhcp-contrib.html

Listening on LPF/eth1/00:04:75:8a:d6:df/192.168.1.0
Sending on LPF/eth1/00:04:75:8a:d6:df/192.168.1.0
Listening on LPF/eth0/00:50:ba:50:03:87/192.168.0.0
Sending on LPF/eth0/00:50:ba:50:03:87/192.168.0.0
Sending on Socket/fallback/fallback-net
#--------------------------------------------


and the LAN computer got the IP immediately.

So basically, if I start dhcp from it's /etc/init.d/dhcp script, it
doesn't work. But if I start dhcpd from command line, it does.

1) Why so? Is there a problem in /etc/init.d/dhcp that came up during a
recent upgrade?


2) From the above output, I know that dhcp shouldn't be listening on
eth1, so "dhcpd eth0" as root listens and sends only on eth0. I tried
this and it works too, but how to I tell dhcp to use eth0 only when it
starts at boot automatically?

Thanks,
->HS
 
Reply With Quote
 
 
 
 
Allen McIntosh
Guest
Posts: n/a

 
      12-23-2004, 02:39 AM

> dhcpd: No subnet declaration for eth1 (192.168.1.1).
> So I put these lines in /etc/dhcpd.conf
> #--------------------------------------------
> subnet 192.168.1.0 netmask 255.255.255.0 {
> not authoritative;
> }
> #--------------------------------------------

This was correct.
>
> Then "/etc/init.d/dhcp start" gave no errors, dhcpd started, but my LAN
> computer (running Sid) couldn't find any dhcp IP address.

It's more likely to have put any errors in a log file, but I assume you
have checked that already.

I don't run Debian, so I can't comment about any upgrades, but here are
some generic things you can do to track this down. Maybe you've done
some of them already, but it never hurts to check:

- check that dhcpd is running after you start it from the startup script.
- see how the startup script invokes dhcpd, and try invoking it that way
by hand. If the invocation expands any shell variables, work with a
modified copy of the script that prints out the whole invocation just
before it happens.
- run tcpdump (or your favorite packet sniffer) and see if dhcpd is
sending out replies - and if it is getting queries when you think it
should be.
 
Reply With Quote
 
H. S.
Guest
Posts: n/a

 
      12-23-2004, 04:01 AM
Apparently, _Allen McIntosh_, on 22/12/04 22:39,typed:
>
>> dhcpd: No subnet declaration for eth1 (192.168.1.1).
>> So I put these lines in /etc/dhcpd.conf
>> #--------------------------------------------
>> subnet 192.168.1.0 netmask 255.255.255.0 {
>> not authoritative;
>> }
>> #--------------------------------------------

>
> This was correct.
>
>>
>> Then "/etc/init.d/dhcp start" gave no errors, dhcpd started, but my
>> LAN computer (running Sid) couldn't find any dhcp IP address.

>
> It's more likely to have put any errors in a log file, but I assume you
> have checked that already.
>
> I don't run Debian, so I can't comment about any upgrades, but here are
> some generic things you can do to track this down. Maybe you've done
> some of them already, but it never hurts to check:
>
> - check that dhcpd is running after you start it from the startup script.
> - see how the startup script invokes dhcpd, and try invoking it that way
> by hand. If the invocation expands any shell variables, work with a
> modified copy of the script that prints out the whole invocation just
> before it happens.
> - run tcpdump (or your favorite packet sniffer) and see if dhcpd is
> sending out replies - and if it is getting queries when you think it
> should be.


Got the solution in debian mailing list:

The problem was that a recent update of 'discover' interchanged my NICs.
Eth1 became eth0 and vice versa. Though I made corresponding changes in
my iptabls script, I though I didn't need to change anything in
dhcpd.conf file. That was correct, but the "/etc/default/dhcp" file was
still having eth1 as the default interface. So when I started dhcp with
"/etc/init.d/dhcp start", that file got read and started using eth1
instead of eth0. And when I started dhcpd manually, that file was not
read and all was well. Solution was to replace eth1 with eth0 in
'/etc/default/dhcp'.

Thanks for you comments,
->HS
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DHCP Logs/# of days JMS Windows Networking 4 10-02-2005 12:45 AM
ppp: a couple of questions, if you please. dubal Linux Networking 3 08-13-2005 01:25 PM
cheapest Broadband for a couple of days per week.? Colin Broadband 22 06-24-2005 11:24 AM
couple things BRAD Broadband Hardware 0 02-22-2005 08:27 AM
98 to 98/ME w/o internet, a couple of miles apart Greg M Windows Networking 9 09-23-2004 12:20 PM



1 2 3 4 5 6 7 8 9 10 11