Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XP Home DHCP service stuck on starting

Status
Not open for further replies.

clytwyn

IS-IT--Management
Jun 4, 2002
30
CA
Have a XP home version computer using Shaw cable internet. Since the computer was bought 4 times the dhcp service has been stuck on starting. This has me stumped, I've tried stopping the service and restarting it won't let me. disabled all running software, no firewall, av software. The only thing that seems to fix it is a restore of the machine. However anywhere from 2-4 months after it happens again. No additional software has been loaded it just happens out of the blue. Anyone experience this and have any suggestions. Thanks in advance.
 
All I get from Shaw is:
The Shaw DHCP servers are RFC2131 compliant. `Shaw Wave' currently uses dynamic leased-IP addresses but plans are underway to make all of Shaw's cable-modem offerings consistent with the `Shaw@Home' service, allowing static IP addresses and client machine IDs. Users of `Shaw Wave' who would like to know where their machine is when they aren't in the immediate vicinity are advised to use the `-c' option in dhcpcd along with a script which can post or e-mail the machine's current IP address to some "static IP" machine.
After original config,if it doesn't say MULTICAST you should reconfigure your kernel and add multicast support. On most systems you will not need to do this.

Next step is to add route for 255.255.255.255. Quoted from DHCPd README:

"In order for dhcpd to work correctly with picky DHCP clients, it must be able to send packets with an IP destination address of 255.255.255.255. Unfortunately, Linux insists on changing 255.255.255.255 into the local subnet broadcast address (here, that's 192.5.5.223). This results in a DHCP protocol violation, and while many DHCP clients don't notice the problem, some (e.g., all Microsoft DHCP clients) do. Clients that have this problem will appear not to see DHCPOFFER messages from the server."

Type: route add -host 255.255.255.255 dev eth0

If you get a message "255.255.255.255: Unknown host", you should try adding the following entry to your /etc/hosts file:
255.255.255.255 all-ones
Then, try:
route add -host all-ones dev eth0
or
route add 255.255.255.0 dev eth0
eth0 is of course the name of the network device you are using. If it differs change appropriately.

Now you need to configure DHCPd. In order to do this you will have to create or edit /etc/dhcpd.conf. There is a graphical interface for dhcpd configuration under KDE ( ) called kcmdhcpd that is very similar to the DHCP configurator on Windows NT. When KDE 2.0 comes out it should come with kcmdhcpd or you could get it directly from:

ftp://ftp.us.kde.org/pub/kde/unstable/apps/network/

If you want to configure it by hand follow instructions below.
Most commonly what you want to do is assign IP addresses randomly. This can be done with settings as follows:

# Sample /etc/dhcpd.conf
# (add your comments here)
default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.254;
option domain-name-servers 192.168.1.1, 192.168.1.2;
option domain-name "mydomain.org";

subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.100;
range 192.168.1.150 192.168.1.200;
}

This will result in DHCP server giving a client an IP address from the range 192.168.1.10-192.168.1.100 or 192.168.1.150-192.168.1.200. It will lease an IP address for 600 seconds if the client doesn't ask for specific time frame. Otherwise the maximum (allowed) lease will be 7200 seconds. The server will also "advise" the client that it should use 255.255.255.0 as its subnet mask, 192.168.1.255 as its broadcast address, 192.168.1.254 as the router/gateway and 192.168.1.1 and 192.168.1.2 as its DNS servers.

If you need to specify a WINS server for your Windows clients you will need to include the netbios-name-servers option e.g.
option netbios-name-servers 192.168.1.1;
You can also assign specific IP addresses based on clients ethernet address e.g.

host haagen {
hardware ethernet 08:00:2b:4c:59:23;
fixed-address 192.168.1.222;
}

This will assign IP address 192.168.1.222 to a client with ethernet address 08:00:2b:4c:59:23.
You can also mix and match e.g. you can have certain clients getting "static" IP addresses (e.g. servers) and others being alloted dynamic IPs (e.g. mobile users with laptops). There are a number of other options e.g. nis server addresses, time server addresses etc., if you need any of those options please read the dhcpd.conf man page.

There is only one thing to do before starting the server. In most cases DHCP installation doesn't create a dhcpd.leases files. This file is used by DHCPd to store information about current leases. It is in the plain text form so you can view it during the operation of DHCPd. To create dhcpd.leases type: touch /var/state/dhcp/dhcpd.leases

This will create an empty file (file size = 0). Some of the older version of dhcpd 2.0 placed the file in /etc/dhcpd.leases. You do not need to make any changes to the leases file it will be manipulated by the dhcpd. If you get a message saying that file exists simply ignore it and go to the next step.

You can now invoke the DHCP server. Simply type (or include in the bootup scripts)

/usr/sbin/dhcpd

This will invoke dhcpd on eth0 device. If you want to invoke it on another device simply supply it on the command line e.g.

/usr/sbin/dhcpd eth1

To verify that everything is working fine you should first turn on the debugging mode and put the server in foreground. You can do this by typing

/usr/sbin/dhcpd -d -f

Then boot up one of your clients and check out the console of your server. You will see a number of debugging messages come up. If everything works out fine you are done :). Quit dhcpd and start it without the -d -f and arguments. If you want dhcpd to start at boot-up include dhcpd in e.g.

/etc/rc.d/rc.local

---------------------
This is all Shaw would send me.
 
Have you been able to check the event logs? If there are any pertinent errors, please post them. It can help greatly in troubleshooting...

Thanks,

Matt Wray
MCSE, MCSA, MCP, CCNA

 
mattwray,
Slap my hand!!! (or get me new glasses...) You are absolutely correct! How'd I go right over that....?

And yes, Event Logs would be very beneficial...
 
You may want to upgrade to Xp pro. The home edition doesn't like networking. It's known for problems. (W2K would be even better. MS has gone again and taken a step back, like they did when they released ME to replace 98SE. Just my opinion.)

Glen A. Johnson
"To fear the worst oft cures the worse."
William Shakespeare (1564-1616); English dramatist, poet.

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Whoa...wait a minute, if you are using a 'cable-modem' it attaches to your computer through an Ethernet Network Interface Card ('NIC'), right? And what has that got to do if its XP Home or Pro? I'm stumped...
 
OK
When you run the DHCP sample program from /Samples/tcpip do you get an error?
Have you tried another DHCP/BOOTP Server?
--------------------------------------------
Does this sound familiar?!

When using the DHCP library the R2200 gets an IP address lease for 6 hours. After 3 hours it performs another DHCPREQUEST so as to maintain its IP address.

However, from then on every time tcp_tick() is called, another DHCPREQUEST is sent to the DHCP server. This continues for 3 hours resulting in excessive network traffic.

This cycle continues every 6 hours. I am using Dynamic C 7.21TSE on a Rabbit 2200 module.
------------------------------------------
I have the same problem with DC 7.21 with DHCP continuously retrying.

Also, stepping through the code, as soon as DHCP fires up, all other network processing seems to stop. Thus if it runs out of buffers, the other sockets never get a chance to free theirs. Since I have UDP packets coming in, they will fill incoming buffers. If DHCP stops the processing of these, then buffers fill up and DHCP dies.
-------------------------------------------
The problem is entirely in BOOTP.lib

What happens is DHCP address expires (or half-life expires.) DHCP then tries to aquire a new IP. However the timeout values are not calculated correctly. I found several instances of wrong timeouts. The DHCP code continuously times out and retransmits the request but NEVER checks the UDP receive buffer for data.

Line 1388:
starttime =SEC_TIMER;
sendtimeout = _dhcpt2 - starttime >> 1; // Wait up to half remaining time to T2.
if (sendtimeout < DHCP_MINRETRY) sendtimeout = DHCP_MINRETRY;
sendtimeout += starttime;

Well, sendtimeout is in MILLISECONDS and it calculates SECONDS.

This bug is repeated about line 1432.

Line 1405:
type = dhcp_send_rcv(&sendbootp, &_bootp, &retry, true, &parms, _dhcpstate == DHCP_ST_RENEW ? &_dhcpt2 : &_dhcplife,
&sendtimeout, &magictimeout, &starttime, rand);

Again _dhcpt2 and _dhcplife are in seconds, but the dhcp_send_rcv() uses milliseconds.
---------------------------------------------------
Line 1388 fixed version:
starttime =SEC_TIMER;
sendtimeout = _dhcpt2 - starttime >> 1; // Wait up to half remaining time to T2.
if (sendtimeout < DHCP_MINRETRY) sendtimeout = DHCP_MINRETRY;
sendtimeout*=1000l; // secs->milliseconds
sendtimeout += MS_TIMER; // add current time

At Line 1432 I made a similar change.

Line 1405 fix:
type = dhcp_send_rcv(&sendbootp, &_bootp, &retry, true, &parms,
(_dhcpstate == DHCP_ST_RENEW ? &_dhcpt2 : &_dhcplife)*1000l,
&sendtimeout, &magictimeout, &starttime, rand);

I have the DHCP server giving a 2 minute lease. Now works again.

I should not have had to debug this!!......
--------------------------------------------------------------------------------
This specific problem has apparently been fixed in 7.25. 7.21 DHCP was broken in its calculation of timeout values.
 
Never mind, NOW it just kills network!!

Has anyone solved the problem of DHCP without the need of calling to DHCP_acquire(), time to time from main loop?
 
uh, i hate to say this... but have you ever thought of a virus? i have had the same behavior.....just did a restore 2 days ago. just prior to that i noticed excessive traffic on my network.....i believe that you guys are way beyond what is causing this guys problem and are flooding him with info that doesn't pertain to the prob....


to clytwyn.... your prob is not that common of a prob but i ahve had some experience with it....do you have .net installed as well?
 
compgirlfhredi I haven't run the DHCP sample program from /Samples/tcpipwhat, but I will also you just put a big description of some editing in a file is that something I should check into?

Cadaveca, Computer has been checked with 3 virus scanners. And as of today this has happened 4 times each time it happens I restore the computer and it works for awhile. No new software was loaded nothing was changed in the days prior to it crapping out on me. And I don't have any .net software installed.

I've had 2 other buddies that work on the field try and fix as well with no luck.

P.S Thank you to everyone who keeps suggesting fixes. Much appreciated.

Cheers.
 
mattwray nothing unusual in the event viewer.
 
One other thing I did try to use the utility winsockfix.exe, with no luck. I'd used the utility before to get me out of binds with protocol issues. Very handy.
 
the one thing i need to make real clear.. just because your antivirus says no virus you cannot rely on that...antivirus can only identify viruses it knows...which when you say you do a restore it works....going to webpages with activeX can sometimes corrupt your tcp/ip stack...try from the command line :netsh int ip reset resetlog.txt...this will reset tcp/ip which you cannot do in xp....it really sounds like your stack or winsock(more likely) has become corrupted...alternately...go to the basics...unplug your modem and power down your box(router too if you have it)...power up modem wait for normal lites(refered to as &quot;block sync&quot;) power up router..wait for lites.. power up pc...when it comes up check your ip using ipconfig and post here if you get 169...then i can help ya further
 
Still waiting on
1)Matts request for event logs.
2)My request for how long this has been going on.

Details help us help you. Thanks and good luck.

Glen A. Johnson
&quot;To fear the worst oft cures the worse.&quot;
William Shakespeare (1564-1616); English dramatist, poet.

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top