DHCP snooping is a switch security feature that filters untrusted DHCP messages and records which IP address each client received on which port. You mark the ports that lead to your real DHCP server as trusted, and the switch treats everything arriving on other ports as untrusted.
The feature is vendor-neutral in idea, but the details below come from Cisco's documentation for Catalyst switches. Other vendors use similar concepts with different command names, so check your switch's manual before copying commands.
Why DHCP snooping exists
DHCP clients find a server by broadcasting, and they accept an answer from whoever replies. If you want the basics first, see what is DHCP. The protocol's own specification admits the weakness: a client has no built-in way to know whether the server answering it was put there by the network administrator. RFC 2131 states that "a host should not act as a DHCP server unless explicitly configured to do so by a system administrator", but nothing in the protocol enforces that.
That leaves two practical problems on a shared network:
- A rogue DHCP server. A spare home router plugged into an office wall socket, or a deliberate attacker's machine, can answer clients before the real server does. Clients then get a wrong gateway or DNS server, or addresses that collide with existing ones.
- Address spoofing. Once the network has no record of who was given which address, a device can claim an address that belongs to someone else.
DHCP snooping addresses both by making the switch, which sees every frame, the place where DHCP is policed.
How DHCP snooping works
Cisco describes DHCP snooping as "a DHCP security feature that provides security by filtering untrusted DHCP messages". Two ideas make that work: trust states and the binding table.
Trusted and untrusted ports
Every port is either trusted or untrusted. Cisco's guide says untrusted interfaces are those that receive messages from outside the network or firewall, while trusted interfaces receive messages only from within the network. Ports facing the DHCP server, or an uplink toward it, should be trusted. Ports facing ordinary clients should stay untrusted.
By default, every interface is untrusted once snooping is on. That default is the safe direction: if you forget to trust the server-facing port, DHCP stops working and you notice at once. The opposite mistake, trusting a client port, would quietly let a rogue server through.
The binding table
As clients receive leases, the switch records them in a DHCP snooping binding table. Per Cisco, an entry "contains the MAC address, IP address, lease time, binding type, VLAN number, and interface information". The table only covers untrusted ports: it does not contain information about hosts interconnected with a trusted interface.
The binding type is either dynamic (learned by snooping) or statically configured. The table matters beyond DHCP itself, because it gives other features a trustworthy answer to the question "which address belongs on this port?". Cisco's IP Source Guard, which is covered in the same guide, uses it to limit a host's ability to attack the network by claiming a neighbor's IP address. The IETF standardised a vendor-neutral version of the same idea in RFC 7513. Its abstract says the bindings created from DHCP "are used to filter packets with forged source IP addresses", and it ties each address to a binding anchor, an attribute that is "immutable or difficult to change", such as the MAC address on a switch port.
Rate limiting
You can also cap how many DHCP packets per second an untrusted port may receive. Cisco's guide accepts 1 to 2048 packets per second and says no rate limit is configured by default. A cap helps against a client flooding the switch with DHCP requests, which Cisco frames as protection against a denial-of-service attack.
Option 82
Cisco switches insert DHCP Option 82, the relay agent information option, by default once snooping is enabled. It identifies the port a request came from, so a server can tell apart hosts that sit behind different ports. The default remote ID is the switch's MAC address and the default circuit ID is the port in vlan-mod-port format. The switch removes the option from replies before forwarding them to the client port. Option 82 only works when snooping is enabled globally and on the VLAN in question.
How to configure DHCP snooping on a Cisco switch
These are the commands listed in Cisco's Catalyst 4500 IOS XE 3.10 guide. Syntax can differ slightly by platform and release, so confirm against the guide for your model. Example configuration, with VLAN 10 for clients and a server reachable through GigabitEthernet1/0/48:
Switch(config)# ip dhcp snooping
Switch(config)# ip dhcp snooping vlan 10
Switch(config)# interface GigabitEthernet1/0/48
Switch(config-if)# ip dhcp snooping trust
Switch(config-if)# exit
Switch(config)# interface range GigabitEthernet1/0/1 - 24
Switch(config-if-range)# ip dhcp snooping limit rate 15
In order, these lines enable snooping globally, enable it on VLAN 10, trust the server-facing port, and limit each client port to 15 DHCP packets per second. The value 15 is an arbitrary example inside the documented 1 to 2048 range, not a recommendation. Pick a number from what your clients really send.
To keep the binding table across reloads, add a database agent. Cisco lists the syntax as ip dhcp snooping database {url | write-delay seconds | timeout seconds}. Without it, the table lives only in memory.
How to check that it works
Show the table with:
show ip dhcp snooping binding
Example output shape (fields as Cisco documents them; the values here are made up):
MacAddress IpAddress Lease(sec) Type VLAN Interface
------------------ --------------- ---------- ------------- ---- --------------------
00:11:22:33:44:55 192.168.10.37 86123 dhcp-snooping 10 GigabitEthernet1/0/5
A client that holds a working lease on an untrusted port should appear here. If a client gets no address at all after you enable snooping, check these in order:
- The port toward the DHCP server (or its uplink) is marked
ip dhcp snooping trust. - Snooping is enabled on the client's VLAN, not just globally.
- Any switch between the client and the server also trusts the link that connects them.
- The rate limit is not set so low that normal client requests are being dropped.
On a client, ipconfig /all on Windows shows the DHCP server address it received, which tells you whether the answer came from the server you expected.
What DHCP snooping does not do
It protects the switch ports it runs on. A rogue server on a trusted port is not stopped, and traffic between devices that never pass through a snooping switch is not inspected. It also does not encrypt or authenticate DHCP: the protocol is unchanged, and the switch just decides which messages to let through. Cisco's guide describes its protections in general terms, and it does not promise to stop every attack, so treat it as one layer alongside port security and network access control.
Home routers and unmanaged switches do not offer it. It is a managed-switch feature, mostly found in office, campus and data-centre networks, where many untrusted clients share one broadcast domain. If you are still learning how those networks are divided, CIDR notation explained covers the subnets involved.
Frequently asked questions
- Is DHCP snooping enabled by default?
- No. On Cisco Catalyst switches, Cisco's configuration guide lists DHCP snooping as disabled by default. When you turn it on, every interface starts as untrusted, so you must mark the ports that face your DHCP server or uplink as trusted.
- Does DHCP snooping replace a DHCP server?
- No. The switch does not hand out addresses. It watches the DHCP messages passing through it, filters the ones arriving on untrusted ports, and records which address each client received. The real DHCP server still does the leasing.
- What happens to the binding table when the switch reboots?
- On Cisco switches the table is held in memory, so it is lost on reload unless you configure a database agent with ip dhcp snooping database, which stores the bindings at a URL or file you choose. Without it, clients that kept their lease must renew before their entries return.
- What is Option 82 in DHCP snooping?
- Option 82 is the relay agent information option. With snooping enabled, Cisco switches insert it by default so the DHCP server can tell which switch port a request came from. The switch strips it from replies before they reach the client.