DHCP

DHCP

Post by Douglas Coo » Thu, 16 Dec 1999 04:00:00



How do I get DHCP installed?  I can run it manually, but I would like it to
run automatically on boot.  Where is the appropriate place to put the
command to run dhclient?  I can't find any switches to enable DHCP in
rc.conf, although there are parameters for options and the path.

Related question:  If I'm running DHCP, I still want to set my computer's
name, but the fully qualified domain name depends on what domain the
computer is attached to.  How do I just specify the computer's name, and let
the DHCP supply the rest of the FQDN?

Thanks!

--

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Douglas Cook - MCP, CS Student at BYU

Earth first!  We'll destroy the other planets later...

 
 
 

DHCP

Post by Paul Southwor » Fri, 17 Dec 1999 04:00:00



>How do I get DHCP installed?  I can run it manually, but I would like it to
>run automatically on boot.  Where is the appropriate place to put the
>command to run dhclient?  I can't find any switches to enable DHCP in
>rc.conf, although there are parameters for options and the path.

In /etc/rc.conf, let's say your interface is "xl0" - you would do:

ifconfig_xl0="DHCP"

You should be able to remove the defaultrouter="..." entry as well.

Quote:>Related question:  If I'm running DHCP, I still want to set my computer's
>name, but the fully qualified domain name depends on what domain the
>computer is attached to.  How do I just specify the computer's name, and let
>the DHCP supply the rest of the FQDN?

If your unqualified hostname is "foo", you can do (in /etc/rc.conf):

hostname="foo"

DHCP won't fully qualify it, but it should (depending on what info
the DHCP server offers) build an /etc/resolv.conf file which has
the qualifying domain in the 'search' path.  Generally that is
good enough.

--Paul

 
 
 

DHCP

Post by Nicolai van der Smag » Thu, 30 Dec 1999 04:00:00


Simply by adding "dhclient [your network interface device]" to rc.local, where
[] is ed0 or ep0 or whatever applies to your setup.

> How do I get DHCP installed?  I can run it manually, but I would like it to
> run automatically on boot.  Where is the appropriate place to put the
> command to run dhclient?  I can't find any switches to enable DHCP in
> rc.conf, although there are parameters for options and the path.

> Related question:  If I'm running DHCP, I still want to set my computer's
> name, but the fully qualified domain name depends on what domain the
> computer is attached to.  How do I just specify the computer's name, and let
> the DHCP supply the rest of the FQDN?

> Thanks!

> --

> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Douglas Cook - MCP, CS Student at BYU

> Earth first!  We'll destroy the other planets later...

 
 
 

DHCP

Post by Donn Mille » Thu, 30 Dec 1999 04:00:00



Quote:> Simply by adding "dhclient [your network interface device]" to rc.local, where
> [] is ed0 or ep0 or whatever applies to your setup.

Don't know if that's necessary - you can set this in /etc/rc.conf.  Here's
an example of my /etc/rc.conf:

network_interfaces="lo0 ed0"
ifconfig_ed0="dhcp"

Of course, check out /etc/defaults/rc.conf, and replace "ed0" with your
own interface (if it's different).

I've also created a shell script to set my hostname which was set by DHCP
on boot-up:

#!/bin/sh
# I put this in /usr/local/sbin/sethostname

IP=`ifconfig ed0 | awk '/inet/ {print $2}'`
HOST=`nslookup $IP| awk '/Name:/ {print $2}'`

hostname $HOST

You could reference this in /etc/rc.local:

$ cat /etc/rc.local

#!/bin/sh
if [ -f /usr/local/sbin/sethostname ] ; then
        /usr/local/sbin/sethostname
fi

- Donn

 
 
 

1. RH 5.1 flawless ftp-dhcp install; dhcp config retained; dhcp fails @ boot

DHCP fails to configure a network connection, even after it worked
wonderfully for an ftp install of RH 5.1 and I retained the network
configuration during the install process.  The relevant message on the
console during bootup is: DHCP ... failed.  The only message in
/var/log/messages that appears to be relevant is "no DHCPOFFER".
/sbin/ifconfig lists nothing for eth0.

A number of modules relevant to DHCP are loaded. I assume that all
necessary modules have been loaded.  The eithernet card also appears
to be correctly recognized.

I've read but not yet tried the Red Hat hacks listed in the DHCPcd
mini-HOWTO.  Has anyone successfully used these on RH 5.1?

Thanks,
Dick

--

Remove the underscore from my e-mail address to reply by mail.

2. Auto rebooting your machine?

3. DHCP Linux Client at NT-DHCP Server

4. Linux-PC as Profibus or MPI Slave?

5. Windows NT DHCP clients and SunOS 4.x BOOTPD+DHCP patches

6. openssh update

7. DHCP: How do I configure DHCP server dynamically?????

8. InfraRed Port on Laptop and GSM phone ...

9. Sunray as DHCP client to NT DHCP server

10. dhcp on RedHat 5.1 and dhcp relay agent on NT 4.0

11. 3com 905b gets Ip address by using DHCP from NT DHCP server

12. Modifying dhcp options using omshell (ISC DHCP Implementation)

13. Doesn't like using DHCP as an option if no DHCP is available