DHCP Monitoring and Management
Requesting DHCP Local Server to Initiate Reconfiguration of Client Bindings
You can request that the DHCP local server initiate reconfiguration of all of clients or only specified clients.
To request reconfiguration of all clients:
Specify the
all
option.user@host> request dhcp server reconfigure all
You can use any of the following methods to request reconfiguration of specific clients:
Specify the IP address of the DHCPv4 client.
user@host> request dhcp server reconfigure 192.168.27.3
Specify the MAC address of a DHCPv4 client.
user@host> request dhcp server reconfigure 00:00:5E:00:53:67
Specify an interface; reconfiguration is attempted for all clients on this interface.
user@host> request dhcp server reconfigure interface fe-0/0/0.100
Specify a logical system; reconfiguration is attempted for all clients or the specified clients in this logical system.
user@host> request dhcp server reconfigure all logical-system ls-bldg5
Specify a routing instance; reconfiguration is attempted for all clients or the specified clients in this routing instance.
user@host> request dhcp server reconfigure all routing-instance ri-boston
Viewing and Clearing DHCP Bindings
This topic provides the procedure you use to display current DHCP bindings, clear selected bindings, and verify that the specified bindings are successfully cleared.
Subscriber management enables you to clear DHCP bindings at several different levels for DHCP local server and DHCP relay agent. For example, you can clear the DHCP bindings on all interfaces, a group of interfaces, or a specific interface. You can also clear DHCP bindings based on IP address, MAC address, session-ID, DHCPv6 prefix, DHCPv6 Client ID, FPC, PIC, port, VLAN, or stacked VLAN (S-VLAN).
This topic includes examples to show several variations of the clear DHCP binding feature. The examples use DHCP local server commands; however, the procedure and commands are similar for DHCP relay agent, DHCPv6 local server, and DHCPv6 relay agent.
To clear bindings and verify the results for a specific IP address:
The following examples show variations of the clear DHCP binding feature. The examples use the DHCP local server version of the commands.
IP demux interfaces are not supported by the show
and clear
DHCP bindings commands for DHCP local server
and DHCP relay agent.
To clear all bindings:
user@host> clear dhcp server binding all
To clear bindings on a specific interface:
user@host> clear dhcp server binding interface fe-0/0/2
To clear all bindings over an interface. This example uses the wildcard option.
user@host> clear dhcp server binding ge-1/0/0. *
To clear bindings on top of a specific VLAN. This example clears all bindings on top of VLAN 100.
user@host> clear dhcp server binding ge-1/0/0:100
To clear bindings for a specific S-VLAN. This example clears bindings on S-VLAN 100-200.
user@host> clear dhcp server binding ge-1/0/0:100-200
To clear all bindings on top of all demux VLANs:
user@host> clear dhcp server binding demux0
To clear all bindings on top of an underlying interface. This
example clears the bindings on all demux VLANS on top of interface ae0
:
user@host> clear dhcp server binding ae0
To clear PPP bindings. This example uses the wildcard feature
and clears the PPP bindings over interface pp0.100
and pp0.200
.
user@host> clear dhcp server binding pp0.*
To clear all bindings on an FPC. This example uses the wildcard feature and clears all DHCP bindings on FPC 1.
user@host> clear dhcp server binding ge-1/*
To clear all bindings on a PIC. This example uses the wildcard feature and clears all DHCP bindings on FPC 1, PIC 0.
user@host> clear dhcp server binding ge-1/0/*
To clear all bindings on a port. This example uses the wildcard feature and clears all DHCP bindings on FPC 1, PIC 0, port 0.
user@host> clear dhcp server binding ge-1/0/0.*
Monitoring DHCP Relay Server Responsiveness
You can configure DHCP relay agent and DHCPv6 relay agent to
enable the router to monitor DHCP server responsiveness. To monitor
DHCP server responsiveness, you specify the length of time during
which the router tracks how DHCP servers respond to relayed packets.
If a configured DHCP server within the routing instance fails to respond
to all relayed packets during the specified time period, the router
generates the DH_SVC_EXTERN_SERVER_STATE_CHG system log message. When
the DHCP server begins responding successfully, the router generates
the log message again to indicate that responsiveness is restored.
You can also use show dhcp relay statistics
and show
dhcpv6 relay statistics
commands to display DHCP server responsiveness
statistics.
The following procedure describes how to configure DHCP relay
agent to enable the router to monitor DHCP server responsiveness.
To configure DHCPv6 server responsiveness, include the server-response-time
statement at the [edit forwarding-options dhcp-relay]
hierarchy level.
To monitor DHCP server responsiveness:
Verifying DHCP Server Binding and Server Statistics
Purpose
View or clear information about client address bindings and statistics for the extended DHCP local server.
If you delete the DHCP server configuration, DHCP server
bindings might still remain. To ensure that DHCP bindings are removed,
issue the clear dhcp server binding
command before you
delete the DHCP server configuration.
Action
To display the address bindings in the client table on the extended DHCP local server:
user@host> show dhcp server binding
To display extended DHCP local server statistics:
user@host> show dhcp server statistics routing-instance customer routing instance
To display the address bindings in the client table on the extended DHCP local server at routing-instance level:
user@host> show dhcp server binding routing-instance customer routing instance
To display extended DHCP local server statistics at routing-instance level:
user@host> show dhcp server statistics routing-instance customer routing instance
To clear the binding state of a DHCP client from the client table on the extended DHCP local server at routing-instance level:
user@host> clear dhcp server binding routing-instance customer routing instance
To clear all extended DHCP local server statistics:
user@host> clear dhcp server statistics
To clear the binding state of a DHCP client from the client table on the extended DHCP local server:
user@host> clear dhcp server binding
To clear all extended DHCP local server statistics at routing-instance level:
user@host> clear dhcp server statistics routing-instance customer routing instance
Verifying and Managing DHCP Relay Configuration
Purpose
View or clear address bindings or statistics for extended DHCP relay agent clients:
Action
To display the address bindings for extended DHCP relay agent clients:
user@host> show dhcp relay binding routing-instance customer routing instance
To display extended DHCP relay agent statistics:
user@host> show dhcp relay statistics routing-instance customer routing instance
To clear the binding state of DHCP relay agent clients:
user@host> clear dhcp relay binding routing-instance customer routing instance
To clear all extended DHCP relay agent statistics:
user@host> clear dhcp relay statistics routing-instance customer routing instance
Tracing Extended DHCP Operations
Both the extended DHCP local server and the extended DHCP relay agent support tracing operations. DHCP tracing operations track extended DHCP operations and record them in a log file. The error descriptions captured in the log file provide detailed information to help you solve problems.
You can configure DHCP trace operations at the global level and at the interface level. Global DHCP tracing logs all DHCP-related events, whereas interface-level tracing logs only interface-specific DHCP events. If you configure interface-level trace operations, you can specify tracing for a range of interfaces or an individual interface. However, only a single interface-level log file is supported. That is, you cannot specify different interface-level log files for different interfaces or groups of interfaces.
By default, nothing is traced. When you enable the tracing operation, the default tracing behavior is as follows:
Important events for both global and per-interface tracing are logged in a file located in the
/var/log
directory. By default, the router uses the filename,jdhcpd
. You can specify a different filename, but you cannot change the directory in which trace files are located.When the trace log file
filename
reaches 128 kilobytes (KB), it is compressed and renamedfilename.0.gz
. Subsequent events are logged in a new file calledfilename
, until it reaches capacity again. At this point,filename.0.gz
is renamedfilename.1.gz
andfilename
is compressed and renamedfilename.0.gz
. This process repeats until the number of archived files reaches the maximum file number. Then the oldest trace file—the one with the highest number—is overwritten.You can optionally specify the number of trace files to be from 2 through 1000. You can also configure the maximum file size to be from 10 KB through 1 gigabyte (GB). (For more information about how log files are created, see the System Log Explorer.)
By default, only the user who configures the tracing operation can access log files. You can optionally configure read-only access for all users.
To configure global DHCP tracing operations.
Specify tracing operations for DHCP local server and DHCP relay:
[edit system processes dhcp-service] user@host# edit traceoptions
The tracing configuration is applied globally to all DHCP applications in every LS:RI. Configuration of event tracing on a per-LS:RI basis is not supported. DHCP tracing is configurable only in the default LS:RI. However, DHCP applications (local server or relay) do not have be configured in the default LS:RI.
We recommend that you use configure tracing statements
at the [edit system processes dhcp-service]
hierarchy level.
Because you can configure DHCP tracing at three different hierarchy levels (one new and recommended, two old and deprecated), the following rules apply to manage the interaction:
When you configure a filename or any other options for the trace log file, the configuration at the
[edit system processes dhcp-service]
hierarchy level has the highest precedence, followed by the configuration at the[edit system services dhcp-local-server]
hierarchy level, and finally with the lowest precedence, the configuration at the[edit forwarding-options dhcp-relay]
hierarchy level.The flag configurations for multiple hierarchy levels are merged and applied to all trace log events.
The deprecated statements do not support filtering the generation of DHCP trace log events by severity level. If you use these statements, trace logging operates with an implicit severity of
all
, regardless of the severity level configured at the[edit system processes dhcp-service]
hierarchy level.
For information about configuring per-interface tracing options, see Tracing Extended DHCP Operations for Specific Interfaces.
The extended DHCP traceoptions operations are described in the following sections:
- Configuring the Extended DHCP Log Filename
- Configuring the Number and Size of Extended DHCP Log Files
- Configuring Access to the Extended DHCP Log File
- Configuring a Regular Expression for Extended DHCP Messages to Be Logged
- Configuring the Extended DHCP Tracing Flags
- Configuring the Severity Level to Filter Which Extended DHCP Messages Are Logged
- Tracing Extended DHCP Operations for Specific Interfaces
Configuring the Extended DHCP Log Filename
By default, the name of the file that records trace output is jdhcpd
. You can specify a different name by including the file
option. DHCP local server and DHCP relay agent both support
the file
option for the traceoptions
statement
and the interface-traceoptions
statement.
To change the filename:
Specify a filename for global tracing operations.
[edit system processes dhcp-service traceoptions] user@host# set file filename
Specify a filename for per-interface tracing operations.
[edit system processes dhcp-service interface-traceoptions] user@host# set file filename
Configuring the Number and Size of Extended DHCP Log Files
You can optionally specify the number of compressed, archived trace log files to be from 2 through 1000. You can also configure the maximum file size to be from 10 KB through 1 gigabyte (GB); the default size is 128 kilobytes (KB).
The archived files are differentiated by a suffix in the format .number.gz
. The newest archived file is .0.gz
and the oldest archived file is .(maximum
number)-1.gz
. When the current trace log file reaches
the maximum size, it is compressed and renamed, and any existing archived
files are renamed. This process repeats until the maximum number of
archived files is reached, at which point the oldest file is overwritten.
For example, you can 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 tracing operation, filename
, reaches 2 MB, filename
is
compressed and renamed filename.0.gz
, and a new file called filename
is
created. When the new filename
reaches
2 MB, filename.0.gz
is renamed filename.1.gz
and filename
is compressed and renamed filename.0.gz
. This process repeats until there are 20 trace files.
Then the oldest file, filename.19.gz
, is simply overwritten when the next oldest file, filename.18.gz
is compressed and renamed to filename.19.gz
.
DHCP local server and DHCP relay agent both support the files
and size
options for the traceoptions
statement and the interface-traceoptions
statement. To
configure the number and size of trace files:
Specify the name, number, and size of the file used for the trace output for global tracing operations.
[edit system processes dhcp-service traceoptions] user@host# set file filename files number size maximum-file-size
Specify the name, number, and size of the file used for the trace output for per-interface tracing operations.
[edit system processes dhcp-service interface-traceoptions] user@host# set file filename files number size maximum-file-size
Configuring Access to the Extended DHCP Log File
By default, only the user who configures the tracing operation can access the log files. You can enable all users to read the log file and you can explicitly set the default behavior of the log file.
DHCP local server and DHCP relay agent both support the world-readable
option and the no-world-readable
option
for the traceoptions
statement and the interface-traceoptions
statement. To specify that all users can read the log file:
Configure the log file to be world-readable for global tracing operations.
[edit system processes dhcp-service traceoptions] user@host# set file filename world-readable
Configure the log file to be world-readable for per-interface tracing operations.
[edit system processes dhcp-service interface-traceoptions] user@host# set file filename world-readable
To explicitly set the default behavior, in which the log file can only be read by the user who configured tracing:
Configure the log file to be no-world-readable for global tracing operations.
[edit system processes dhcp-service traceoptions] user@host# set file filename no-world-readable
Configure the log file to be no-world-readable for per-interface tracing operations.
[edit system processes dhcp-service interface-traceoptions] user@host# set file filename no-world-readable
Configuring a Regular Expression for Extended DHCP Messages to Be Logged
By default, the trace operation output includes all messages relevant to the logged events. You can refine the output by including regular expressions to be matched.
DHCP local server and DHCP relay agent both support the match
option for the traceoptions
statement and
the interface-traceoptions
statement. To configure regular
expressions to be matched:
Specify the regular expression for global tracing operations.
[edit system processes dhcp-service traceoptions] user@host# set file filename match regular-expression
Specify the regular expression for per-interface tracing operations.
[edit system processes dhcp-service interface-traceoptions] user@host# set file filename match regular-expression
Configuring the Extended DHCP Tracing Flags
By default, only important events are logged. You can specify which events and operations are logged by specifying one or more tracing flags.
DHCP local server and DHCP relay agent both support the flag
option for the traceoptions
statement and the interface-traceoptions
statement. A smaller set of flags is
supported for interface-level tracing than for global tracing. To
configure the flags for the events to be logged:
Specify the flags for global tracing operations.
[edit system processes dhcp-service traceoptions] user@host# set flag flag
Specify the flags for per-interface tracing operations.
[edit system processes dhcp-service interface-traceoptions] user@host# set flag flag
Configuring the Severity Level to Filter Which Extended DHCP Messages Are Logged
The messages associated with a logged event are categorized according to severity level. You can use the severity level to determine which messages are logged for the event type. A low severity level is less restrictive—filters out fewer messages—than a higher level. When you configure a severity level, all messages at that level and all higher (more restrictive) levels are logged.
The following list presents severity levels in order
from lowest (least restrictive) to highest (most restrictive). This
order also represents the significance of the messages; for example, error
messages are of greater concern than info
messages.
verbose
info
notice
warning
error
The severity level that you configure depends on the issue that
you are trying to resolve. In some cases you might be interested in
seeing all messages relevant to the logged event, so you specify all
. You can also specify verbose
with the same
result, because verbose
is the lowest (least restrictive)
severity level; it has nothing to do with the terseness or verbosity
of the messages. Either choice generates a large amount of output.
You can specify a more restrictive severity level, such as notice
or info
to filter the messages. By default, the trace
operation output includes only messages with a severity level of error
.
DHCP local server and DHCP relay agent both support the level
option for the traceoptions
statement and
the interface-traceoptions
statement. To configure the
flags for the events to be logged:
Specify the severity level for global tracing operations.
[edit system processes dhcp-service traceoptions] user@host# set level severity
Specify the severity level for per-interface tracing operations.
[edit system processes dhcp-service interface-traceoptions] user@host# set level severity
Tracing Extended DHCP Operations for Specific Interfaces
In addition to the global DHCP tracing operations, subscriber management enables you to trace extended DHCP operations for a specific interface or for a range of interfaces.
Configuring per-interface tracing is a two-step procedure. In the first step, you specify the tracing options that you want to use, such as file information and flags. In the second step, you enable the tracing operation on the specific interfaces.
To configure per-interface tracing operations: