LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   dhclient vs. dhcpcd (https://www.linuxquestions.org/questions/slackware-14/dhclient-vs-dhcpcd-557111/)

GregLee 05-27-2007 10:17 PM

dhclient vs. dhcpcd
 
I was having some problems with dhcpcd, so I decided to try dhclient, which worked. A search of this forum shows mostly complaints and disrecommendations for dhclient, but I have a couple of suggestions about getting it to work:

(1) Don't trust the dhclient on your Slackware distribution. The installation on my Slackware 9 system is seriously screwed up. Get dhcp-3.0.5 from www.isc.org, and configure, make, make install.

(2) Don't trust dhclient to discover your network devices on its own. Maybe it will, but I have my doubts. Tell it what you have by editing /etc/dhclient.conf. Mine contains
Code:

interface "wlan0" {
        send host-name "hp.lee.net";
}

since I have just that one wireless interface and I want my modem/router to call my system "hp.lee.net". Then, with a proper dhclient.conf set up, issue the command "dhclient". (If you're already running dhcpcd, dhclient will complain, and you'll have to say "dhcpcd -k" to kill the dhcpcd.)

Now, here are the problems I was having with dhcpcd. Sometimes, under special conditions, dhcpcd could not get any response from the dhcp server in my modem/router (a Westell 327W). It happened once after I had made a mistake and locked up my Linux system so hard I had to cut the power. Ordinarily, though, dhdpcd worked for me.

The other problem was that I couldn't figure out a good way to associate the ip address I got via DHCP with the name I chose for my system, using dhcpcd.

dhclient seems to be well documented and has a rich set of options to deal with special circumstances. Also, I'm not sure dhcpcd is being maintained any more.

perry 05-28-2007 03:51 AM

Hey Thanks!
 
Quote:

Originally Posted by GregLee
I was having some problems with dhcpcd, so I decided to try dhclient, which worked. A search of this forum shows mostly complaints and disrecommendations for dhclient, but I have a couple of suggestions about getting it to work:

(1) Don't trust the dhclient on your Slackware distribution. The installation on my Slackware 9 system is seriously screwed up. Get dhcp-3.0.5 from www.isc.org, and configure, make, make install.

(2) Don't trust dhclient to discover your network devices on its own. Maybe it will, but I have my doubts. Tell it what you have by editing /etc/dhclient.conf. Mine contains
Code:

interface "wlan0" {
        send host-name "hp.lee.net";
}

since I have just that one wireless interface and I want my modem/router to call my system "hp.lee.net". Then, with a proper dhclient.conf set up, issue the command "dhclient". (If you're already running dhcpcd, dhclient will complain, and you'll have to say "dhcpcd -k" to kill the dhcpcd.)

Now, here are the problems I was having with dhcpcd. Sometimes, under special conditions, dhcpcd could not get any response from the dhcp server in my modem/router (a Westell 327W). It happened once after I had made a mistake and locked up my Linux system so hard I had to cut the power. Ordinarily, though, dhdpcd worked for me.

The other problem was that I couldn't figure out a good way to associate the ip address I got via DHCP with the name I chose for my system, using dhcpcd.

dhclient seems to be well documented and has a rich set of options to deal with special circumstances. Also, I'm not sure dhcpcd is being maintained any more.

i just spent the day getting my linksys wusb54g v4 working (which included a probable unrequired upgrade to 10.1, 11 kept giving me too much grief), only for dhcpcd to work for like 5 minutes... long enough for me to know it is possible for the ndiswrapper to work. the info on dhclient is greatly valued, i'll try that approach tomorrow.

thanks so much

- perry

perry 05-28-2007 03:54 AM

wow, you posted that just today...

thanks again

- perry

perry 05-28-2007 12:39 PM

Thank You - Thank You - Thank You!
 
greg,

i'm writing to you now from inside my slackware (that is, my new 10.1 install) thanks to your help:

Code:

root@slackware:/home/perry/ndis/dhcp-3.0.5# ndiswrapper -l
Installed drivers:
rt2500usb              driver installed, hardware present
root@slackware:/home/perry/ndis/dhcp-3.0.5# modprobe ndiswrapper
root@slackware:/home/perry/ndis/dhcp-3.0.5# dhclient
Internet Systems Consortium DHCP Client V3.0.5
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

Listening on LPF/wlan0/00:12:17:81:b2:64
Sending on  LPF/wlan0/00:12:17:81:b2:64
Sending on  Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 6
DHCPOFFER from 192.168.1.1
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPACK from 192.168.1.1
bound to 192.168.1.102 -- renewal in 41879 seconds.
root@slackware:/home/perry/ndis/dhcp-3.0.5#

Code:


# dhclient.conf
#
# Configuration file for ISC dhclient (see 'man dhclient.conf')
#
interface "wlan0" {
        send host-name "slackware101.com";
}

hopefully, if i can get 99% of the promised 41879 i'll be very happy!

thanks for your help again!

- perry

perry 05-29-2007 01:36 PM

dhclient problem #2 solved
 
according to what i read somewhere on this site yesterday, i would need to upgrade to 2.6.x kernel in order to get around a nasty problem when rebooting after running dhclient wlan0. the kernel would just crash (under 2.4.26) and a reboot caused major, unnecessary and nasty reiserfs problems.

so after much struggling to learn all about how to install a new kernel and then to get it working with ndiswrapper (1.45), i am now (to my "amazement") on the Internet writing to you to thank you all for your help.

some of the things i had to do:
  • download the latest kernel 2.6.21.3
  • figure out how to compile it
  • download ndiswrapper 1.45
  • install gcc 3.4.3
  • install the latest dhclient 3.0.5
  • setup lilo for testing new kernel
  • setup lilo for fallback kernel
  • ...and access this site a lot
  • till i got something working
now to get my sound working under 2.6.21.3 variant

thanks again everyone

- perry

ps.
i can't believe i am using my own compiled kernel!!!!!

ragavendrapec 09-28-2011 03:00 AM

@Greg and perry i know this is an old post. but it would be grateful if u could go through my problem and suggest some pointers.

Thanks a lot for posting this.i am using dhclient. however i don't know what im facing is a problem or if i need to set some other configuration parameter. I run dhcpd and dhclient in the same subnet and dhclient.conf is as below

interface "eth0"
{
request subnet-mask, broadcast-address, time-offset, routers, domain-name, domain-name-servers, host-name, netbios-name-servers, netbios-scope;
}

however i don't need so many details in the conf file but it was there by default and hence i left it as such. all i need is an ip-address for the ethernet port eth0.

the setup is also simple i have a dhcp server running in a linux 2.6.38.7machine connected to a switch and another machine which runs the dhclient with the same linux version. the version of dhcpd and dhclient are isc-dhclient-4.1.1-P1 and isc-dhcpd-4.1.1-P1. after i start the dhcpd server i run the dhclient. checking the logs on both the machines it says that the ip address has been assigned,it goes through all the steps of DHCPDISCOVER, DHCPOFFER, DHCPREQUEST, DHCPACK. also checking the lease file of both the client and server says that the client is bound a particular ip address.however ifconfig eth0 doesn't show up the ip address. why does this happen? do i need run some script to have it assigned automatically? plz help.
}


All times are GMT -5. The time now is 01:49 AM.