Configuration Guide Vol. 2


12.1.2 Monitoring DHCP Packets

<Structure of this section>

(1) Port type

DHCP snooping categorizes ports as follows when it monitors DHCP packets:

The following figure shows the two port categories used when dynamic ARP inspection is enabled and an example of devices connected to such ports.

Figure 12-2: Port types

[Figure Data]

When you use the ip dhcp snooping configuration command to enable DHCP snooping, all the ports become untrusted by default. Set the port to which a DHCP server is connected as a trusted port. To do so, use the ip dhcp snooping trust configuration command.

Note that DHCP snooping monitors the VLANs that have been set by using the ip dhcp snooping vlan configuration command.

(2) Learning terminal information

The following figure provides an overview of how the Switch learns terminal information.

Figure 12-3: Overview of terminal information learning operations

[Figure Data]

The switch monitors the packets received on the trusted port from the DHCP server. When the DHCP server distributes an IP address, the switch registers the terminal information in the binding database. The target of registration in the binding database is the terminal data of the terminal connected to untrust.

The switch also monitors the request for release of packets received on the untrusted port from the DHCP client. When the DHCP client issues an IP address, the switch deletes the terminal information from the binding database.

Two methods are available for registering information in a binding database:

The following table describes the types of terminal information that are registered in a binding database.

Table 12-2: Terminal information to be registered in the binding database

Item

Dynamic registration

Static registration

Terminal MAC address.

MAC address of a DHCP client

MAC address of a terminal with a fixed IP address

Terminal IP address

IP address distributed by the DHCP server

IP address of a terminal with a fixed IP address

The addresses in the following ranges are available:

  • 1.0.0.0 ~ 126.255.255.255

  • 128.0.0.0 ~ 223.255.255.255

VLAN containing the terminal

ID of the VLAN containing the port or channel group to which the terminal is connected

Number of the port to which the terminal is connected

Number of the port or channel group to which the terminal is connected

Aging time

Length of time until an entry is deleted due to aging.

The lease time of the IP address distributed by the DHCP server is used for this item.

Aging is not applicable.

(3) Saving the binding database

Use configuration commands to save a binding database and to restore it when the Switch is restarted.

(a) Conditions for Saving Binding Databases

To save a binding database, use the ip dhcp snooping database url configuration command.

The saving of the binding database starts when the save delay time in the configuration information expires.

(b) Save when write wait time expires

The save delay time refers to the period of time between the point at which saving of the binding database is specified (called a save event) and the point at which saving of the binding database actually starts at the save location. The save delay timer starts when one of the following save events occurs and the saving of the binding database to the specified save location starts when the timer expires:

  • When terminal information is dynamically registered, updated, or deleted in a binding database

  • When the ip dhcp snooping database url configuration command is specified (includes a change of save location)

  • When the clear ip dhcp snooping binding operation command is executed

To set the save delay time, use the ip dhcp snooping database write-delay configuration command.

When the save delay timer starts due to a save event, the timer does not stop until it expires. Even if terminal information is registered, updated, or deleted in the binding database before the timer expires, the timer will not be restarted.

The following figure shows the relationship between save events and the save delay time. In this figure, the save event is the registration of terminal information in the binding database.

Figure 12-4: Relationship between save timing and write wait time

[Figure Data]

(c) Binding Database Destination

As the save location for the binding database, you can select either internal flash memory or an external memory card. To set the save location, use the ip dhcp snooping database url configuration command.

The items that are saved are all the entries in the binding database that exist at the time of the current write operation. The saved items will be overwritten by the next write operation.

(d) Restoring a Saved Binding Database

The saved binding database is restored when the Switch is started. The database will be restored only if both of the following conditions are met when the switch is started:

  • The save location has been set by using the ip dhcp snooping database url configuration command.

  • If the save location is an external memory card, the applicable card has been inserted.

(4) Inspecting DHCP Packets

The following figure provides an overview of DHCP packet inspection.

Figure 12-5: Outline of DHCP Packet-Inspection Operation

[Figure Data]

The switch monitors the DHCP packets from terminals that are connected to untrusted ports to prevent the following: