31-2
Software Configuration Guide—Release 12.2(25)SG
OL-7659-03
Chapter31 Configuring DHCP Snooping and IP Source Guard
Overview of DHCP Snooping
Note In order to enable DHCP snooping on a VLAN, you must enable DHCP snooping on the switch.
You can configure DHCP snooping for switches and VLANs. When you enable DHCP snooping on a
switch, the interface acts as a Layer2 bridge, intercepting and safeguarding DHCP messages going to a
Layer 2 VLAN. When you enable DHCP snooping on a VLAN, the switch acts as a Layer 2 bridge
within a VLAN domain.
Overview of the DHCP Snooping Database Agent
To retain the bindings across switch reloads, you must use the DHCP snooping database agent. Without
this agent, the bindings established by DHCP snooping are lost upon switch reload. Connectivity is lost
as well.
The mechanism for the database agent stores the bindings in a file at a configured location. Upon reload,
the switch reads the file to build the database for the bindings. The switch keeps the file current by
writing to the file as the database changes.
The format of the file that contains the bindings is as follows:
<initial-checksum>
TYPE DHCP-SNOOPING
VERSION 1
BEGIN
<entry-1> <checksum-1>
<entry-2> <checksum-1-2>
...
...
<entry-n> <checksum-1-2-..-n>
END
Each entry in the file is tagged with a checksum that is used to validate the entries whenever the file is
read. The <initial-checksum> entry on the first line helps distinguish entries associated with the latest
write from entries that are associated with a previous write.
This is a sample bindings file:
3ebe1518
TYPE DHCP-SNOOPING
VERSION 1
BEGIN
1.1.1.1 512 0001.0001.0005 3EBE2881 Gi1/1 e5e1e733
1.1.1.1 512 0001.0001.0002 3EBE2881 Gi1/1 4b3486ec
1.1.1.1 1536 0001.0001.0004 3EBE2881 Gi1/1 f0e02872
1.1.1.1 1024 0001.0001.0003 3EBE2881 Gi1/1 ac41adf9
1.1.1.1 1 0001.0001.0001 3EBE2881 Gi1/1 34b3273e
END
Each entry holds an IP address, VLAN, MAC address, lease time (in hex), and the interface associated
with a binding. At the end of each entry is a checksum that accounts for all the bytes from the start of
the file through all the bytes associated with the entry. Each entry consists of 72 bytes of data, followed
by a space, followed by a checksum.
Upon bootup, when the calculated checksum equals the stored checksum, a switch reads entries fr om the
file and adds the bindings to the DHCP snooping database. When the calculated ch ecksum does not equal
the stored checksum, the entry read from the file is ignored and so are all the entries following the failed
entry. The switch also ignores all those entries from the file whose lease time has expired. (This situation