LinuxQuestions.org
Help answer threads with 0 replies.
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 06-08-2006, 02:27 PM   #1
raypen
Member
 
Registered: Jun 2002
Location: Midwest
Distribution: Slackware
Posts: 365

Rep: Reputation: 30
Logging of dhcpcd messages


I am trying to diagnose a DHCP setup problem. I simply
need to log dhcpcd messages at a deeper log level than
debug. With my current syslog setup, certain dhcpcd
REQUEST and ACK messages appear in /var/log/debug;

*.=debug /var/log/debug

Other post on this subject indicate that to specifically
log dhcpcd messages, the following entry in syslog.conf
is needed:

local0.* /var/log/dhcpcd

I have tried this, but see no file in /var/log. I would
at least expect to see the same messages that appear in debug.

Am I setting this up correctly or am I missing something?
 
Old 06-08-2006, 03:02 PM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
I have this in my /etc/syslog.conf:
Code:
local3.debug                                            -/var/log/dhcpd.log
and this in /etc/dhcpd.conf (I am using the ISC dhcp server, not dnsmasq):
Code:
# Log to local3.debug so that we can redirect logging to a separate file.
log-facility local3;
This is the kind of stuff that gets logged then:
Code:
Jun  7 20:30:20 door dhcpd: DHCPREQUEST for 192.168.0.99 from 00:11:XX:XX:XX:XX (icculus-wireless) via eth0
Jun  7 20:30:20 door dhcpd: DHCPACK on 192.168.0.99 to 00:11:XX:XX:XX:XX (icculus-wireless) via eth0
Jun  8 04:51:50 door dhcpd: DHCPINFORM from 192.168.0.5 via eth0
Jun  8 04:51:50 door dhcpd: DHCPACK to 192.168.0.5
Jun  8 04:51:53 door dhcpd: DHCPINFORM from 192.168.0.5 via eth0
Jun  8 04:51:53 door dhcpd: DHCPACK to 192.168.0.5
Jun  8 10:10:40 door dhcpd: DHCPINFORM from 192.168.0.5 via eth0
Jun  8 10:10:40 door dhcpd: DHCPACK to 192.168.0.5
Jun  8 10:10:43 door dhcpd: DHCPINFORM from 192.168.0.5 via eth0
Jun  8 10:10:43 door dhcpd: DHCPACK to 192.168.0.5
Jun  8 14:16:18 door dhcpd: Added new forward map from room.dyn.my.lan to 192.168.0.5
Jun  8 14:16:18 door dhcpd: added reverse map from 5.0.168.192.in-addr.arpa. to room.dyn.my.lan
Jun  8 14:16:18 door dhcpd: DHCPREQUEST for 192.168.0.5 from 00:02:XX:XX:XX:XX via eth0
Jun  8 14:16:18 door dhcpd: DHCPACK on 192.168.0.5 to 00:02:XX:XX:XX:XX via eth0
Jun  8 14:17:20 door dhcpd: DHCPINFORM from 192.168.0.5 via eth0
Jun  8 14:17:20 door dhcpd: DHCPACK to 192.168.0.5
You won't get much more than that in a simple setup.

Eric
 
Old 06-08-2006, 04:48 PM   #3
raypen
Member
 
Registered: Jun 2002
Location: Midwest
Distribution: Slackware
Posts: 365

Original Poster
Rep: Reputation: 30
I suppose that's alright if you're running dhcpd (a server). However
I want to simply log the activity spawned by dhclient (dhcpcd). I
tried to place log-facility local3; in dhclient.conf (yes I changed
syslog.conf too), but this had no effect.

I must admit that I really don't understand logging very well and
I have no idea how to make this work.
 
Old 06-08-2006, 05:10 PM   #4
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Duh... I overlooked the 'c' in "dhcpcd"...

Code:
$ grep dhcpcd /var/log/debug
Jun  7 20:30:36 icculus dhcpcd[2358]: broadcasting DHCP_REQUEST for 192.168.0.8
Jun  7 20:30:36 icculus dhcpcd[2358]: dhcpIPaddrLeaseTime=1209600 in DHCP server response.
Jun  7 20:30:36 icculus dhcpcd[2358]: dhcpT1value is missing in DHCP server response. Assuming 604800 sec
Jun  7 20:30:36 icculus dhcpcd[2358]: dhcpT2value is missing in DHCP server response. Assuming 1058400 sec
Jun  7 20:30:36 icculus dhcpcd[2358]: DHCP_ACK received from  (192.168.0.11)
Jun  7 20:30:36 icculus dhcpcd[2406]: broadcasting DHCP_REQUEST for 192.168.0.99
Jun  7 20:30:40 icculus dhcpcd[2406]: dhcpIPaddrLeaseTime=1209600 in DHCP server response.
Jun  7 20:30:40 icculus dhcpcd[2406]: dhcpT1value is missing in DHCP server response. Assuming 604800 sec
Jun  7 20:30:40 icculus dhcpcd[2406]: dhcpT2value is missing in DHCP server response. Assuming 1058400 sec
Jun  7 20:30:40 icculus dhcpcd[2406]: DHCP_ACK received from  (192.168.0.11)
Jun  7 20:30:41 icculus dhcpcd[2614]: broadcasting DHCP_REQUEST for 192.168.0.8
Jun  7 20:31:11 icculus dhcpcd[2614]: timed out waiting for DHCP_ACK response
Jun  7 20:31:11 icculus dhcpcd[2614]: broadcasting DHCP_DISCOVER
To get this, you must run the dhcpcd with the "-d" flag. This is default in Slackware.

Eric
 
Old 06-08-2006, 05:55 PM   #5
raypen
Member
 
Registered: Jun 2002
Location: Midwest
Distribution: Slackware
Posts: 365

Original Poster
Rep: Reputation: 30
It is being run with the "-d" flag.

/sbin/dhcpcd -d -t 60 -h 192.168.0.1 eth0

Could it be that I should specify logging-facility or
something else on the command line?
 
Old 06-11-2006, 12:28 AM   #6
evilDagmar
Member
 
Registered: Mar 2005
Location: Right behind you.
Distribution: NBG, then randomed.
Posts: 480

Rep: Reputation: 31
Quote:
Originally Posted by raypen
I suppose that's alright if you're running dhcpd (a server). However
I want to simply log the activity spawned by dhclient (dhcpcd). I
tried to place log-facility local3; in dhclient.conf (yes I changed
syslog.conf too), but this had no effect.

I must admit that I really don't understand logging very well and
I have no idea how to make this work.
Euw. Please don't confuse dhcpcd with dhclient. Dhclient is a much more useful tool than that.
 
Old 06-11-2006, 03:19 PM   #7
raypen
Member
 
Registered: Jun 2002
Location: Midwest
Distribution: Slackware
Posts: 365

Original Poster
Rep: Reputation: 30
Pardon me. I was confused for awhile but eventually realized that
dhcpcd and dhclient are two different clients.

Oddly enough, all I had to do was change /var/log/dhcpcd to /var/log/dhcpcd.log
in syslog.conf to make logging work properly. That is after resetting local3.* to local0.*
in syslog. I think local3.* is for dhclient.

Speaking of dhclient, if you know how to make it work in Slack
I would very much like to know how. I've been testing it too and I can't
get any DHCP offers. I have used the standard setup (no dhclient.conf) and
can't get any response other than exiting when I run 'dhclient eth0'.

Oddly enough, I can set a fixed IP address on eth0 and actually get a response
however no DHCPOFFERS are received.

Listening on Socket/eth0
Sending on Socket/eth0
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4
Discarding packet with bogus hlen
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 5
Discarding packet with bogus hlen
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 14
Discarding packet with bogus hlen
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 21
Discarding packet with bogus hlen
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 12
Discarding packet with bogus hlen
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 5
Discarding packet with bogus hlen
No DHCPOFFERS received
No working leases in persistent database - sleeping.

dhcpcd doesn't require any current interface to send out its DHCPDISCOVER; what's
wrong with dhclient?

Is it possible that dhclient only works if the DHCP server is
an ISC dhcpd?

Last edited by raypen; 06-11-2006 at 03:22 PM.
 
Old 01-25-2015, 12:17 PM   #8
jostber
Member
 
Registered: Jul 2001
Location: Skien, Norway
Distribution: Slackware Current 64-bit
Posts: 543

Rep: Reputation: 178Reputation: 178
Delete post.

Last edited by jostber; 01-25-2015 at 12:18 PM.
 
  


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
Shorewall not logging messages xxx_anuj_xxx Linux - Security 11 01-12-2006 10:52 PM
Logging Console Boot Messages candyman123 Linux - General 5 06-19-2005 02:38 PM
logging bootup messages to textfile? cast55 Debian 2 02-19-2005 05:56 PM
console logging messages srns Red Hat 2 09-13-2004 04:18 PM
Logging kernel messages ugenn Linux - Software 8 01-04-2003 06:11 AM

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

All times are GMT -5. The time now is 05:06 AM.

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