Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Sep 2002 00:18:42 -0400
From:      dfolkins <dfolkins@comcast.net>
To:        "Bert Hiddink [Bendoo]" <hiddink@bendoo.com>, freebsd-questions@freebsd.org
Subject:   Re: Resolving IP through DHCP on LAN
Message-ID:  <00c901c262b8$4d0939f0$0a00a8c0@groovy3xp>
References:  <3D8DB784.31453.9B0CEC@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help
----- Original Message -----
From: "Bert Hiddink [Bendoo]" <hiddink@bendoo.com>
To: <freebsd-questions@freebsd.org>
Sent: Sunday, September 22, 2002 6:28 AM
Subject: Resolving IP through DHCP on LAN


> Hello,
>
> I have a LAN which looks like this:
>
> Internet ---> Cablemodem---> Router with DHCP-service ---> 2 Winboxes, 1
Freebsd box
> I have 4.6.2. release installed on the FreeBSD box.
>
> The router has an DHCP service and IP's are dynamicly assigned to the 3
machines within my LAN.
> However, when I view the DHCP Active IP Table, I see the following:
>
>  Gateway IP Address: 192.168.1.1
>  DHCP Hostname IP Address MAC Address
>  tulin 192.168.1.101 00-80-AD-C9-25-DC
>  alfa  192.168.1.102 00-81-AC-C8-25-DA
>         192.168.1.104 00-C0-4F-AA-24-0C
>
> The machines called "tulin" and "alfa" are the Win98 boxes, the last line
corresponds to my FreeBSD
> box. It is called "delta". My question: why does the name of my FreeBSD
box not show up in the
> DHCP Active IP Table?
>
> If I use its IP address, I can access this box without no problem (FTP,
Samba, etc.) However, I
> would like to access it by using its name ("delta"). How to achieve this?
>
looks like your dhclient is not configured to send a hostname to the dhcp
server.

here is a relevant excerpt from "man dhclient.conf":

 send  {  [ option declaration ] [, ... option declaration
       ]}

and here is an excerpt from "man dhcp-options":

option host-name string;

          This option specifies the name of the client.  The name
          may or may not be qualified with the local domain  name
          (it  is  preferable  to  use  the domain-name option to
          specify the domain name).  See RFC 1035  for  character
          set  restrictions.   This  option  is  only  honored by
          dhclient-script(8)  if  the  hostname  for  the  client
          machine  is  not  set (i.e., set to the empty string in
          rc.conf(5) ).

so, as you can see, it appears that the hostname for the freebsd machine
("delta") is being set only _after_ your box acquires its dhcp lease, and
thereby does not send the hostname to the dhcp server.  if you put the above
"send" line into your /etc/dhclient.conf file, like this:

send host-name "delta";

your box will send the hostname to the dhcp server and all should work as
expected.  to be more correct, you may even put in something like this:

interface "if0" {
send host-name "delta";
}

where "if0" is the name of your dhcp-configured ethernet interface (e.g.
xl0, rl0, etc).

hope this helps,
--
dfolkins


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?00c901c262b8$4d0939f0$0a00a8c0>