Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Monitoring the DHCP Server Configuration

This topic discusses about how to trace various DHCP operations in a DHCP server. You can use various trace options discussed in this topic to troubleshoot any issues that arise in the DHCP server. For more information, read this topic.

DHCP Processes Tracing Flags

Table 1 describes which operation or event is recorded by each DHCP tracing flag. By default, all flags are disabled.

Table 1: DHCP Processes Tracing Flags

Flag

Operation or Event

all

All operations.

binding

Binding operations.

config

Logins to the configuration database.

conflict

Client-detected conflicts for IP addresses.

event

Important events.

ifdb

Interface database operations.

io

I/O operations.

lease

Lease operations.

main

Main loop operations.

misc

Miscellaneous operations.

packet

DHCP packets.

options

DHCP options.

pool

Address pool operations.

protocol

Protocol operations.

rtsock

Routing socket operations.

scope

Scope operations.

signal

DHCP signal operations.

trace

Tracing operations.

ui

User interface operations.

Tracing Extended DHCP Local Server Operations

The extended DHCP tracing operations track the extended DHCP local server operations and record them in a log file. By default, no extended DHCP local server processes are traced. If you include the traceoptions statement at the [edit system processes dhcp-service] hierarchy level, the default tracing behavior is the following:

  • Important extended DHCP local server events are logged in a file called jdhcpd located in the /var/log directory.

  • When the file jdhcpd reaches 128 kilobytes (KB), it is renamed jdhcpd.0, then jdhcpd.1, and so on, until there are three trace files. Then the oldest trace file (jdhcpd.2) is overwritten. For more information about how log files are created, see the Junos System Log Messages Reference.

  • Log files can be accessed only by the user who configures the tracing operation.

Note:

In software releases earlier than Junos OS 11.4, you configured tracing statements at the [edit system services dhcp-local-server] and [edit forwarding-options dhcp-relay] hierarchy levels. Starting in Junos OS Release 11.4, these statements have been deprecated and hidden in favor of a new statement at the [edit system processes dhcp-service] hierarchy level. The deprecated statements may be removed from a future release; we recommend that you transition to the new statement.

To trace DHCP local server operations, include the traceoptions statement at the [edit system processes dhcp-service] hierarchy level:

The following topics describe the tracing operation configuration statements:

Configuring the Filename of the Extended DHCP Local Server Processes Log

By default, the name of the file that records trace output is jdhcpd. You can specify a different name by including the file statement at the [edit system processes dhcp-service traceoptions] hierarchy level:

Configuring the Number and Size of Extended DHCP Local Server Processes Log Files

By default, when the trace file reaches 128 kilobytes (KB) in size, it is renamed jdhcpd.0, then jdhcpd.1, and so on, until there are three trace files. Then the oldest trace file (jdhcpd.2) is overwritten.

You can configure the limits on the number and size of trace files by including the following statements at the [edit system processes dhcp-service traceoptions] hierarchy level:

For example, set the maximum file size to 2 MB, and the maximum number of files to 20. When the file that receives the output of the tracking operation (jdhcpd) reaches 2 MB, jdhcpd is renamed jdhcpd.0, and a new file called jdhcpd is created. When the new jdhcpd reaches 2 MB, jdhcpd.0 is renamed jdhcpd.1 and filename is renamed jdhcpd.0. This process repeats until there are 20 trace files. Then the oldest file (jdhcpd.19) is overwritten by the newest file (jdhcpd.0).

The number of files can be from 2 through 1000 files. The file size of each file can be from 10KB through 1 gigabyte (GB).

Configuring Access to the Log File

By default, log files can be accessed only by the user who configures the tracing operation.

To specify that any user can read all log files, include the file world-readable statement at the [edit system processes dhcp-service traceoptions] hierarchy level:

To set the default behavior explicitly, include the file no-world-readable statement at the [edit system processes dhcp-service traceoptions] hierarchy level:

Configuring a Regular Expression for Lines to Be Logged

By default, the trace operations output includes all lines relevant to the logged events.

You can refine the output by including the match statement at the [edit system processes dhcp-service traceoptions] hierarchy level and specifying a regular expression (regex) to be matched:

Configuring Trace Option Flags

By default, only important events are logged. You can configure the trace operations to be logged by including extended DHCP local server tracing flags at the [edit system processes dhcp-service traceoptions] hierarchy level:

You can configure the following tracing flags:

  • all—Trace all operations.

  • auth—Trace authentication operations.

  • database—Trace database events.

  • fwd—Trace firewall process events.

  • general—Trace miscellaneous events.

  • ha—Trace high availability-related events.

  • interface—Trace interface operations.

  • io—Trace I/O operations.

  • packet—Trace packet decoding operations.

  • performance—Trace performance measurement operations.

  • profile—Trace profile operations.

  • rpd—Trace routing protocol process events.

  • rtsock—Trace routing socket operations.

  • session-db—Trace session database operations.

  • state—Trace changes in state.

  • statistics—Trace baseline statistics.

  • ui—Trace user interface operations.

Configuring Tracing Operations for DHCP Processes

DHCP tracing operations track all DHCP operations and record them to a log file. By default, no DHCP processes are traced. If you include the traceoptions statement at the [edit system services dhcp] hierarchy level, the default tracing behavior is the following:

  • Important events are logged in a file called dhcpd located in the /var/log directory.

  • When the file dhcpd reaches 128 kilobytes (KB), it is renamed dhcpd.0, then dhcpd.1, and so on, until there are three trace files. Then the oldest trace file (dhcpd.2 is overwritten). For more information about how log files are created, see the System Log Explorer.

  • Log files can be accessed only by the user who configures the tracing operation.

You cannot change the directory in which trace files are located. However, you can customize the other trace file settings by including the following statements at the [edit system services dhcp traceoptions] hierarchy level:

Tasks for configuring DHCP tracing operations are:

Configuring the DHCP Processes Log Filename

By default, the name of the file that records trace output is dhcpd. You can specify a different name by including the file statement at the [edit system services dhcp traceoptions] hierarchy level:

Configuring the Number and Size of DHCP Processes Log Files

By default, when the trace file reaches 128 kilobytes (KB) in size, it is renamed filename.0, then filename.1, and so on, until there are three trace files. Then the oldest trace file (filename.2) is overwritten.

You can configure the limits on the number and size of trace files by including the following statements at the [edit system services dhcp traceoptions] hierarchy level:

For example, set the maximum file size to 2 MB, and the maximum number of files to 20. When the file that receives the output of the tracking operation (filename) reaches 2 MB, filename is renamed filename.0, and a new file called filename is created. When the new filename reaches 2 MB, filename.0 is renamed filename.1 and filename is renamed filename.0. This process repeats until there are 20 trace files. Then the oldest file (filename.19) is overwritten by the newest file (filename.0).

The number of files can be from 2 through 1000 files. The file size of each file can be from 10KB through 1 gigabyte (GB).

Configuring Access to the DHCP Log File

By default, log files can be accessed only by the user who configures the tracing operation.

To specify that any user can read all log files, include the file world-readable statement at the [edit system services dhcp traceoptions] hierarchy level:

To set the default behavior explicitly, include the file no-world-readable statement at the [edit system services dhcp traceoptions] hierarchy level:

Configuring a Regular Expression for Refining the Output of DHCP Logged Events

By default, the trace operations output includes all lines relevant to the logged events.

You can refine the output by including the match statement at the [edit system services dhcp traceoptions file filename] hierarchy level and specifying a regular expression (regex) to be matched:

Configuring DHCP Trace Operation Events

By default, only important events are logged. You can configure the trace operations to be logged by including the following options at the [edit system services dhcp traceoptions] hierarchy level: