LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Logging of dhcpcd messages (http://www.linuxquestions.org/questions/slackware-14/logging-of-dhcpcd-messages-452920/)

raypen 06-08-2006 02:27 PM

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?

Alien Bob 06-08-2006 03:02 PM

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

raypen 06-08-2006 04:48 PM

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.

Alien Bob 06-08-2006 05:10 PM

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

raypen 06-08-2006 05:55 PM

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?

evilDagmar 06-11-2006 12:28 AM

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.

raypen 06-11-2006 03:19 PM

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?


All times are GMT -5. The time now is 09:24 AM.