Overview
This document describes useful commands for verifying and troubleshooting DHCP.
Details
To display and clear DHCP leases:
>show dhcp server lease all ( or specify interface)
interface: ethernet1/4
ip mac state duration lease_time
interface: ethernet1/10
ip mac state duration lease_time
192.168.89.100 00:18:8b:b2:1b:b6 committed 0 Mon Dec 14 08:43:10 2009
192.168.89.146 00:14:22:d8:c0:c0 reserved
To clear all DHCP leases:
>clear dhcp lease all (or specify interface)
To view the log history:
>less mp-log pan_dhcpd.log
Feb 19 15:50:02 pan_sys_init(pan_sys.c:279): /usr/local/bin/dhcpd
Feb 19 15:50:02
*******************************************************************************
****************************** STARTING DHCPD******************************
*******************************************************************************
Feb 19 15:50:02 pan_dhcp_load_all_leases(pan_dhcp_db.c:223): load leases from ..
. /opt/pancfg/cache/pan/dhcp.db
Feb 19 15:50:03 pan_dhcp_load_leases_v1(pan_dhcp_db.c:200): read interface 25 ac
tion add 00:18:8b:b2:1b:b6 --> 192.168.89.100 lease 1260808990 duration 0
Feb 19 15:50:04 Error: pan_cfgagent_write_sysd_boolean_sync(pan_cfgagent.c:99):
sync modify <sw.mgmt.runtime.clients.dhcpd.register> failed: NO_MATCHES
Feb 19 15:50:04 Error: pan_cfgagent_enable(pan_cfgagent.c:734): failed to regist
er config agent with management server
Feb 19 15:50:04 Warning: pan_dhcpd_cfgagent_initial_config_callback(pan_dhcpd_cf
g.c:735): Unable to enable cfgagent, try again later
To view the real-time log:
>tail follow yes mp-log pan_dhcpd.log
Mar 02 22:49:11 pan_dhcpd_cfg_phase2_callback(pan_dhcpd_cfg.c:267): start phase2
Mar 02 22:49:11 pan_dhcpd_cfg_phase2_callback(pan_dhcpd_cfg.c:278): no cfg
Mar 03 01:52:21 pan_dhcpd_if_callback(pan_dhcpd.c:265): receive from 127.2.1.240
Mar 03 01:52:21 pan_dhcp_handle_packet(pan_dhcp.c:85): receive packet on interface 25 length 300
To create a packet-capture of dhcp packets:
> debug dhcpd pcap on
> debug dhcpd pcap show
feature dhcp, vr_id 0, output_file /opt/pan/.debug/pcap/dhcp-vr-0.pcap, max_size 1000000, cur_size 24 bytes, rollover 0 times
--- pcap file ---
-rw-rw-rw- 1 root root 24 May 22 10:18 dhcp-vr-0.pcap
> debug dhcp pcap off
> debug dhcp pcap view
To export a dhcp packet-capture (for example):
> scp export debug-pcap from dhcp-vr-0.pcap to user@scp-server:/path
To review DHCP lease logs and server messages:
> show log system subtype equal dhcp direction equal backward
owner: jjosephs