Previous Contents Next

Debugging a Linux PPP Connection.

 

Turning on debugging won't fix any problems, but it may give you enough information to allow you to see what is going wrong. Using the -v option when invoking chat in peers/ozemail as shown on the Configuration Files page turns on verbose output for chat. The other thing you can do is turn on debugging output for pppd. Both chat and pppd log their messages using the syslog facility, so (in a standard configuration) these messages will be written to /var/log/messages.

Add a debug line to /etc/ppp/options.
The options file now looks like this:

lock
auth
debug

If messages doesn't contain debugging output from pppd after running it again, look at /etc/syslog.conf to see where the messages are going, and also read the section below. Be aware that many other messages get written to the messages log. You might prefer to separate the chat and ppp messages into their own file as described in the following section.

 

Writing pppd debugging messages to their own file.

It is possible to write the debugging messages into their own file by altering the syslog configuration. (Pppd will not have the file totally to itself - there might be a few lines from things like modprobe and init but it is still worth doing). The pppd manual page says that debug output from pppd is logged through syslog with facility daemon and level debug. Therefore to record this output in a different file you need to make the change shown below:

Append these lines to /etc/syslog.conf.

# The next line writes pppd messages to /var/log/ppplog
daemon.*                                                /var/log/ppplog
Create the log file...
touch /var/log/ppplog

For changes to syslog.conf to take effect you must restart the syslog daemon...
killall -HUP syslogd

Next time you run pppd you should see messages from pppd written to the ppplog file.

 

Writing chat's "verbose option" messages to the ppplog file.

If you are running chat with the -v option, it will also write debugging output, however this will still go to /var/log/messages. Chat logs its messages through syslog with facility local2. If you want the output from chat to go to the ppplog file, change the line added previously to read
# The next line writes both pppd and chat messages to /var/log/ppplog
daemon.*;local2.*                                       /var/log/ppplog

 

Tidying up /var/log/messages

The above modifications to syslog.conf cause messages to be written to ppplog in addition to /var/log/messages, not instead of. If you wish to stop pppd and chat messages being written to the messages file, add the following to the messages line:
daemon.none;local2.none

On my system, the messages line used to look like this:

*.info;mail.none;authpriv.none                              /var/log/messages
After the modification it looks like this:
*.info;mail.none;authpriv.none;daemon.none;local2.none       /var/log/messages
As mentioned before, for changes to syslog.conf to take effect you must restart the syslog daemon...
killall -HUP syslogd

 

kernel ppp driver debugging

It is also possible to log messages from the kernel ppp driver, however this generates a lot of data (I got 2.2 Mbytes in 30 minutes) and is not very informative.

Here is a brief sample of the output:

kernel: ppp_ioctl: set dbg flags to 1f0000
kernel: ppp_ioctl: set flags to 1f0000
kernel: ppp_tty_ioctl: set xasyncmap
kernel: ppp_tty_ioctl: set xmit asyncmap ffffffff
kernel: ppp_ioctl: set flags to 1f0000
kernel: ppp_ioctl: set mru to 5dc
kernel: ppp_tty_ioctl: set rcv asyncmap ffffffff
kernel: ppp_ioctl: set flags to 1f0000
kernel: ppp: write frame, count = 24
kernel: FF 03 C0 21 01 01 00 14 ...!....
kernel: 02 06 00 00 00 00 05 06 ........
kernel: 56 6F 2A 0D 07 02 08 02 Vo*.....
kernel: ppp: receive buffer, count = 1
kernel: 7E                      ~

kernel: ppp: write frame, count = 64
kernel: FF 03 00 21 45 00 00 3C ...!E..<
kernel: 0A 47 40 00 40 06 92 EF .G@.@...
kernel: CB 6C C0 49 96 CB 7B 04 .l.I..{.
kernel: 03 FF 00 16 62 5E 0D CF ....b^..
kernel: 00 00 00 00 A0 02 7D 78 ......}x
kernel: 1C 97 00 00 02 04 05 B4 ........
kernel: 04 02 08 0A 00 23 9C 0C .....#..
kernel: 00 00 00 00 01 03 03 00 ........
kernel: ppp: receive buffer, count = 5
kernel: 7E 21 45 00 00          ~!E..
kernel: ppp: receive buffer, count = 11
kernel: 2C 89 C5 40 00 F6 06 5D ,..@...]
kernel: 80 96 CB                ...

If that doesn't discourage you from proceeding, here is how to set it up. Add the line
kdebug 31
to /etc/ppp/options. The number sets the debugging level where 31 is the most verbose. This value is a bitmap. The options turned on by the bits are:
  0   -   no debugging
  1   -   debug messages
  2   -   log incoming packets
  4   -   log outgoing packets
  8   -   log tty output buffers
  16   -   log tty input buffers

Next add the following line to /etc/syslog.conf

kern.*                                                 /var/log/kernlog
Then create the debug file
touch /var/log/kernlog

...and restart the syslog daemon
killall -HUP syslogd


Previous Contents Next