LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-27-2007, 10:17 PM   #1
GregLee
Member
 
Registered: Feb 2004
Location: Waimanalo, HI
Distribution: Slackware 10, Fedora 6
Posts: 308

Rep: Reputation: 30
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.
 
Old 05-28-2007, 03:51 AM   #2
perry
Member
 
Registered: Sep 2003
Location: USA & Canada
Distribution: Slackware 12.0
Posts: 978

Rep: Reputation: 30
Wink 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
 
Old 05-28-2007, 03:54 AM   #3
perry
Member
 
Registered: Sep 2003
Location: USA & Canada
Distribution: Slackware 12.0
Posts: 978

Rep: Reputation: 30
wow, you posted that just today...

thanks again

- perry
 
Old 05-28-2007, 12:39 PM   #4
perry
Member
 
Registered: Sep 2003
Location: USA & Canada
Distribution: Slackware 12.0
Posts: 978

Rep: Reputation: 30
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

Last edited by perry; 05-28-2007 at 12:42 PM.
 
Old 05-29-2007, 01:36 PM   #5
perry
Member
 
Registered: Sep 2003
Location: USA & Canada
Distribution: Slackware 12.0
Posts: 978

Rep: Reputation: 30
Thumbs up 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!!!!!

Last edited by perry; 05-29-2007 at 01:41 PM.
 
Old 09-28-2011, 03:00 AM   #6
ragavendrapec
LQ Newbie
 
Registered: Aug 2011
Posts: 3

Rep: Reputation: Disabled
@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.
}
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem using dhcpcd or dhclient smooss Slackware 15 02-26-2007 05:16 AM
which is better? dhclient dhcpcd or pump? aus9 Linux - Networking 6 06-22-2006 09:14 AM
dhcpcd instead of dhclient in Mepis 3.4.3 radub MEPIS 0 04-26-2006 11:37 AM
dhclient v. dhcpcd biojayc Linux - Wireless Networking 5 04-29-2005 07:34 PM
dhcpcd / dhclient problems tomap Linux - Wireless Networking 1 11-01-2004 03:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration