# How to choose which DHCP client to use? (SOLVED)

## Headrush

I was wondering how the /etc/init.d/net.ethX script determines which dhcp client to try to us.

Right now I am using dhcpcd, but would like to use dhcp. If I unmerge the first and then merge the second, while it pick it up automatically?Last edited by Headrush on Fri Mar 04, 2005 11:45 pm; edited 3 times in total

----------

## Sith_Happens

dhcp comes with it's own initscript you use in place of net.eth0.  Just remove net.eth0 from startup and add dhcp.  You can configure the dhcp initscript in /etc/conf.d/dhcp.

----------

## Headrush

 *Sith_Happens wrote:*   

> dhcp comes with it's own initscript you use in place of net.eth0.

 

There is no problem in getting dhcp to work.

I'm looking more for info into the gentoo framework. I have read that baselayout supports several methods (dhcp dhclient, pump, etc), but I don't see where to designate which one it uses.

----------

## Headrush

Looks like this is supported in baselayout 1.11+ only. 

So it looks like dhcpd is hardcoded in baselayout-1.9.4. (Please correct me if wrong)

----------

## UberLord

 *Sith_Happens wrote:*   

> dhcp comes with it's own initscript you use in place of net.eth0.  Just remove net.eth0 from startup and add dhcp.  You can configure the dhcp initscript in /etc/conf.d/dhcp.

 

Uh wrong  :Rolling Eyes: 

baselayout-1.11.9-r1 allows dhcpcd, udhcpc, pump and dhclient.

dhcpcd - the current gentoo default. Best all rounder

udhcpc - my personal choice as it's very light weight and the source is easy to read/patch/maintain. The choice for low memory environments - like embedded.

dhclient - the most powerful dhcp client, but also cumbersome (the source is not very well written imo)

pump - has problems with some ISPs and is not maintained by RedHat anymore. The worst - avoid imo

For dhclient and udhcpc you may need the below patch with baselayout-1.11.9-r1 depending on your network

https://bugs.gentoo.org/show_bug.cgi?id=81119

----------

## Sith_Happens

Nevermind

----------

## Headrush

I've installed the 1.11 patched base layout and because of the postup feature, I can use dhcpcd still  :Very Happy: 

I'm editing the /etc/dhcp/dhcpd.conf file. (dhcp server)

I'm looking to have a client obtain the same IP but still use dhcp.

I see this in the example conf

```
host fantasia {

  hardware ethernet 08:00:07:26:c0:a5;

  fixed-address fantasia.fugue.com;

}
```

I don't see where to set the IP to give the client.

And no I don't want to use a static IP. The router forwards to this machine when it is plugged into this subnet.

This machine is portable and when plugged into another network asks for a dynamic IP. So best to always have it using dhcp, but when plugged into this subnet the dhcp server should recognize it and give it a specific address. (No manual configuration)

Edit: Found it. fixed-address works with IPs too.

----------

## seppelrockt

I have the latest stable x86 baselayout but even if I use modules= ( "dhclient" ) in /etc/conf.d/net it uses dhcpcd - and yes dhcp is emerged (I can run it manually). What's wrong here? 

The new baselayout it indead wonderful with the new net and utf-8 features - great work!

----------

## UberLord

Does the file /sbin/dhclient exist?

----------

