Subject: Re: DHCP Configuration Problems
To: Gene ENonymous <yancm@otaku.freeshell.org>
From: Robert Elz <kre@munnari.OZ.AU>
List: netbsd-help
Date: 03/27/2002 15:13:47
    Date:        Tue, 26 Mar 2002 17:34:20 GMT
    From:        Gene ENonymous <yancm@otaku.freeshell.org>
    Message-ID:  <200203261734.g2QHYKn00800@otaku.freeshell.org>

Manuel answered the important parts of this I think, but ...

  | 2) The main FAQ just says to turn on dhcpclient in the rc.conf.
  |    THis assumes that there is a dhclient.conf and a dhclient-script
  |    in your /etc directory. Mine did *not*

As Manuel said, the script moved (you wouldn't need a new one of those,
or the "script" line in your dhclient.conf).   At the most all you're
likely to need is an empty dhclient.conf (or one with just a few lines).
That file is absolutely system dependent, there's no point providing
a sample (the standard sample would be an empty file, that's what most
people need).

  | ## dhclient.conf #####################################################
  | Send host-name "bloober.insightbb.com";

That's OK, but probably unnecessary.   You probably want to omit the
domain part, and send just "bloober" though, if you send anything
(windows does, so to emulate it, leave this one in, without the domain).

  | send dhcp-client-identifier "bloober.insightbb.com";

That value you almost certainly don't want.   Most likely your cable provider
has configured their end to know what your system identifier is.   You
probably want to use 1:aa:bb:cc:dd:ee:ff (where the aa:bb:... part is
your sn0 cards MAC address, in hex) - if you need anything at all.   Trying
without this would be where I'd start, then add the client-id if you find
you need to duplicate windows behaviour more precisely.

  | # I also tried the sn0 ethernet address as the ident...no difference

without the leading "1" there wouldn't be a difference, it is just another
bogus value.

  | request subnet-mask, broadcast-address, routers,
  |     domain-name-servers;

That's OK, though that's also what you're likely to get if you don't
request anything.

  | timeout 30;
  | retry 60;
  | select-timeout 5;

You shouldn't need those, but they should be harmless.

  | script "/etc/dhclient-script";

You don't want that - use the standard NetBSD script in /sbin
(which dhclient knows how to find without being told).

  | lease {

And you certainly don't want this (none of it).   A lease in dhclient.conf
is only for when you're on a net where the dhcp server is frequently down
(frequently enough to be annoying), and you *know* what it would give you.
Yours is useless anyway, as there's no address in it...  For a cable provider,
if their dhcp server is down, you can expect much of the rest of their net is
as well, so forcing a lease isn't very likely to help.

  | The result is:
  | a bunch of DHCPDISCOVER messages,
  | a no DHCPOFFER received message

That probably means the dhcp server has no idea who you are (because of the
bad client identifier).   So it ignores you.

  | a no valid leases in the database message
  | and a sleep message
  | with the thing repeatin.

That's just the dhcp client not knowing why it is being ignored, so it
just keeps trying.

  | And I cannot see or
  | get to anything which is out on the net.

No, you won't, not till you get an address.   To verify that it
should work, boot windows, have it get an address, look in its
control panel to find out what it is (and the router & dns server
addresses).   Unplug the net interface cable, and then shut down windows
(to make sure it doesn't release the lease).   Then reboot NetBSD, and while
it is booting, plug in the cable again (have it configured with dhclient=NO
before you start this, so NetBSD doesn't attempt to run dhcp).
Manually configure the interface (sn0) to be the same as windows
	ifconfig sn0 inet 1.2.3.4 netmask 255.255.255.0
	route add default 1.2.3.99
	echo "nameserver 1.2.3.55" > /etc/resolv.conf
(using the numbers obtained from windows).   Then from NetBSD you should
be able to see the world.   If all that works, you know it is just a matter
of having dhclient duplicate the windows request, which might be able to be
done by sending no client identifier at all, or might need the mac address
preceded by "1" (so it is 7 octets long).

  | I also reset it and let it register before I start up
  | NetBSD.

Don't do that before you do the above test - you want the cable provider
to think it is still windows running using the same lease it issued just
a few minutes ago.

kre