Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Solaris DHCP Client

39 views
Skip to first unread message

Philip Midcalf

unread,
Oct 16, 2001, 10:02:52 AM10/16/01
to
I have a problem configuring a Solaris 8 7/01 client to use DHCP.

The DHCP server is a Windows 2000 box.

When the Sun boots it gets its IP address from the W2K server but gives the
hostname as unkown.

I have added the line inet myhostname to the /etc/hostname.le0 file as said
in the man on dhcpagent and added the line REQUEST_HOSTNAME=yes to
/etc/default/dhcpagent file.

Anybody know why I do not get a hostname?


Sean Woodlock

unread,
Oct 16, 2001, 7:26:49 PM10/16/01
to
"Philip Midcalf" <phi...@midcalf.club24.co.uk> wrote in message news:<3bcc3e57$0$8512$ed9e...@reading.news.pipex.net>...


Try putting this is your etc/rc2.d folder in worked for me. Good luck


#!/sbin/sh
#*******************************************************************************
#
# Name: set_hostname
# SCCS Id: @(#)set_hostname 1.1
03/27/00
#
# Description: This file is a script for re-setting your
hostname to the
# right value if you use DHCP
(which has a habit of setting
# your hostname to "unknown" if
you use a cable modem).
#
#
# Copyright (C) 2000 by Richard Teer. All
rights reserved.
#
#*******************************************************************************


HOSTNAME=`cat /etc/nodename`

echo "Setting hostname to $HOSTNAME... \c"
uname -S $HOSTNAME
echo "Done."

Peter Huesser

unread,
Oct 17, 2001, 4:50:32 AM10/17/01
to
Philip Midcalf wrote:

No. I have the same problem. You can overcome the problem by setting the
hostname
manually in "/etc/init.d/network". I changed the following line in the end of
the file:

.
.
.
case "$_INIT_NET_STRATEGY" in
## I also have to change the entry in the /etc/hosts file
# "dhcp") hostname=`/sbin/dhcpinfo Hostname` ;;
"dhcp") hostname=`cut -f 2 -d " " /etc/hostname.$primary` ;;
"rarp") hostname=`/sbin/hostconfig -h -p bootparams`
trap 'intr=1' 2 3
while [ -z "$hostname" -a ! -f /etc/.UNCONFIGURED -a \
.
.
.

The entry in the /etc/hosts file also has to be changed with a script.

Greetings

Pedro

Peter Huesser

unread,
Oct 17, 2001, 4:52:06 AM10/17/01
to
cyp...@punk.net wrote:

> Philip Midcalf <phi...@midcalf.club24.co.uk> wrote:
> # I have a problem configuring a Solaris 8 7/01 client to use DHCP.
> #
> # The DHCP server is a Windows 2000 box.
> #
> # When the Sun boots it gets its IP address from the W2K server but gives the
> # hostname as unknown.
> #
> # I have added the line inet my hostname to the /etc/hostname.le0
> # file as said in the man on dhcpagent and added the line
> # REQUEST_HOSTNAME=yes to /etc/default/dhcpagent file.
> #
> # Anybody know why I do not get a hostname?
>
> Have you tried #12?

I did. But it did not work.

Pedro


Serena

unread,
Oct 17, 2001, 10:42:52 AM10/17/01
to
Peter Huesser <peter....@psi.ch> wrote in message news:<3BCD46B6...@psi.ch>...

I've been told the following works (but haven't tried it):

You need to tell the DHCP server the mac address and name of your
machine, then it returns the hostname correctly.

S

Philip

unread,
Oct 18, 2001, 1:48:06 PM10/18/01
to
I did put 12 in the dhcpagent file and it now takes the hostname from the
DHCP server.

However this is not what I want as I want to tell the DHCP server the name
of the machine not the other way round.

I thought that the line in /etc/hostname.le0 would give the DHCP server the
hostname.

Philip

"Serena" <s.m...@iop.kcl.ac.uk> wrote in message
news:2b9f024a.01101...@posting.google.com...

Peter Huesser

unread,
Oct 20, 2001, 4:47:09 AM10/20/01
to
Philip wrote:

> I did put 12 in the dhcpagent file and it now takes the hostname from the
> DHCP server.
>
> However this is not what I want as I want to tell the DHCP server the name
> of the machine not the other way round.

> I thought that the line in /etc/hostname.le0 would give the DHCP server the
> hostname.

It does. If you write in /etc/hostnem.le0 the following

inet my_hostname

it send the server to the dhcp server the hostname. Snoop the traffic and you
will see it.
We are using qip for dhcp and the problem there is that the dchp server
doesn't send back
the name. It makes the correct entry in his database (check it) but that's all
(at least at our
site).

Pedro


Philip

unread,
Oct 20, 2001, 6:27:46 AM10/20/01
to
Yes that is what I see it gives the name to the DHCP server but the suns
hostname is unkown even though the dhcp server knowns it.

If I add 12 to the dhcpagent and configure the DHCP server then it does that
the requested name but from a different place not from the /etc/hostname.le0
file

To get round the problem I have a script in rc2.d that renames the machine,
it work but is not ideal.

Philip

0 new messages