Dynamic ARP Inspection

An ARP reply is a claim that an IP address belongs to a MAC address, and nothing in it proves the sender owns the address. Dynamic ARP Inspection checks each claim against the DHCP snooping binding table and drops ARP that does not match. Trusted ports bypass inspection. A server with a typed-in address has no binding, so it needs an ARP access list, which is consulted first.

In Daveth Pro (Network)5 min video · lab: Security

By , founder of Daveth · Updated

Opening frame of the video walkthrough of Dynamic ARP Inspection

Watch this lesson

5 min · Video walkthrough

In Daveth Pro (Network)

The full 5 min walkthrough is in Daveth Pro (Network). See what the plan opens

Upcoming practical lab

Lab C13: Security

What the lab covers

What this page answers

How does Dynamic ARP Inspection work?

It checks the IP-to-MAC pairing in each ARP packet on untrusted ports against the DHCP snooping binding table and drops packets whose pairing does not match. Read it in “What Dynamic ARP Inspection checks”

Why does DAI block a server with a static IP address?

The server never used DHCP, so DHCP snooping has no binding for it and DAI has no evidence its ARP is legitimate. An ARP access list that permits its IP and MAC pairing fixes it. Read it in “A server with a typed-in address”

What does ip arp inspection trust do?

It makes ARP arriving on that interface bypass inspection. Trusted does not mean more secure; every interface starts untrusted, where ARP is checked. Read it in “Turning it on, and what trusted means”

What ARP is asking

A workstation, A, wants to send traffic to 10.20.30.3. It knows the IP address. But on the local Ethernet network a frame also needs a destination MAC address, and A doesn't have one for 10.20.30.3.

So A broadcasts a question to everyone on the VLAN:

Who has 10.20.30.3?  Tell 10.20.30.2.

The owner, B, replies:

10.20.30.3 is at aabb.cc00.0b03.

WHAT ARP ASKS A asks who owns the IP. B answers with its MAC. A remembers the answer.

Network drawing: CAT9300, HOST-A, HOST-B, asks: WHO HAS 10.20.30.3?, cache: 10.20.30.3 → aabb.cc00.0b03, answers: 10.20.30.3 IS AT aabb.cc00.0b03
host    IP              MAC it will use
A       10.20.30.3      aabb.cc00.0b03

That remembered pairing is an ARP cache entry. A uses it to put aabb.cc00.0b03 in the destination field of every frame it sends to 10.20.30.3, for a while.

Before B answered, A's cache had no entry for 10.20.30.3. ARP turns an IP address you know into a MAC address you can send to. So far nothing is wrong.

And notice what A did with the answer, because the whole of this lesson follows from it. Somebody it had never spoken to said that address is mine, and A wrote it down. No proof was asked for and none was offered, because the protocol has no way of asking. Everything DAI does is the question ARP never had.

A reply to a question nobody asked

Look at what B's reply really is: a claim. This IP address belongs to this MAC address.

Another machine can send the same kind of message with a different MAC. C can send A this, even though A never asked C anything:

10.20.30.3 is at aabb.cc00.00c6.

That MAC is C's. Nothing in the ARP message proves the sender really owns 10.20.30.3. A host can send an ARP reply when nobody asked the matching question, and systems can update their ARP information from it. That's the opening an attacker uses.

1 · HONEST Each host resolved the other honestly. A's frames to B go straight to B. C isn't on the path.

Network drawing: CAT9300, HOST-A, HOST-B, HOST-C, cache: 10.20.30.3 → aabb.cc00.0b03

Now C sends two replies: one telling A that 10.20.30.3 is at C's MAC, and one telling B that 10.20.30.2 is at C's MAC.

2 · C LIES In this scenario both hosts update their caches from C's replies.

Network drawing: CAT9300, HOST-A, HOST-B, HOST-C, cache: 10.20.30.3 → aabb.cc00.00c6, cache: 10.20.30.2 → aabb.cc00.00c6, claims 10.20.30.2 and 10.20.30.3 are at aabb.cc00.00c6
host    IP              MAC it will use
A       10.20.30.3      aabb.cc00.00c6   <- not the owner's MAC
B       10.20.30.2      aabb.cc00.00c6   <- not the owner's MAC

3 · THE DETOUR A's packet still says IP destination 10.20.30.3. Its Ethernet destination is now C's MAC.

Network drawing: CAT9300, HOST-A, HOST-B, HOST-C, IP dst 10.20.30.3 · Ethernet dst aabb.cc00.00c6

The path from A to B is now A → switch → C → switch → B. If C passes the traffic on to B, both ends still work and nobody notices.

That is ARP spoofing, also called ARP cache poisoning, and C is now a man in the middle.

The IP destination can stay correct while the Ethernet destination is poisoned. Nothing about the IP packet changed. The ARP mapping did.

What Dynamic ARP Inspection checks

C's forged packet contains a claim: 10.20.30.3 → aabb.cc00.00c6. The switch needs a trusted answer to one question: is that IP-to-MAC pairing legitimate?

For DHCP clients, that answer normally comes from the DHCP snooping binding database. DHCP snooping watched each client receive its address, and from that exchange the switch recorded which IP went to which MAC, on which port and VLAN.

So when C claims 10.20.30.3 → aabb.cc00.00c6, the switch looks up 10.20.30.3 and finds it recorded at aabb.cc00.0b03. They don't match, and DAI drops the ARP packet.

claim (IP -> MAC)                 binding for that IP               result
10.20.30.3 -> aabb.cc00.0b03      10.20.30.3 -> aabb.cc00.0b03      match, allow
10.20.30.3 -> aabb.cc00.00c6      10.20.30.3 -> aabb.cc00.0b03      no match, drop

DAI isn't asking whether a packet looks suspicious. It's asking whether the sender's claim agrees with information the switch trusts.

And DAI didn't learn those pairings from ARP: that would defeat the point. DAI checks ARP against a table it didn't build.

For a host that never used DHCP there is no binding, so you give DAI the trusted pairing yourself, in an ARP ACL. More on that below.

Before you turn it on, look at the bindings

Does the table DAI will trust actually contain your DHCP clients? Check before you depend on it:

This course's output: computed from this scenario, laid out like the troubleshooting document's sample of show ip dhcp snooping binding.

CAT9300# show ip dhcp snooping binding
MacAddress         IpAddress       Lease(sec) Type          VLAN Interface
------------------ --------------- ---------- ------------- ---- --------------------
AA:BB:CC:00:0A:02  10.20.30.2      82000      dhcp-snooping 10   GigabitEthernet1/0/1
AA:BB:CC:00:0B:03  10.20.30.3      81920      dhcp-snooping 10   GigabitEthernet1/0/2
AA:BB:CC:00:00:C6  10.20.30.66     81810      dhcp-snooping 10   GigabitEthernet1/0/3
Total number of bindings: 3
! Three clients. The statically addressed server is not here, and that will matter.

Proves: the switch has DHCP snooping bindings for these clients: IP, MAC, VLAN and port.
Does not prove: that DAI is enabled, what trust state any port has, or that any ARP packet will be forwarded.

If a DHCP client is missing, fix DHCP snooping first. Enabling DAI on top of a missing binding drops that client's ARP. If they're all there, go on.

Turning it on, and what trusted means

Intent: protect VLAN 10, leave the host-facing ports untrusted, and trust only the uplink to controlled infrastructure.

CAT9300# configure terminal
CAT9300(config)# ip arp inspection vlan 10
CAT9300(config)# interface Te1/0/48
CAT9300(config-if)# ip arp inspection trust
CAT9300(config-if)# end

The first command says: inspect ARP arriving in VLAN 10. The second says: ARP arriving on Te1/0/48 doesn't go through DAI's checks on this switch.

Trusted doesn't mean "more secure." It means bypass inspection. Every interface starts untrusted; untrusted means arriving ARP is checked.

WHERE INSPECTION HAPPENS ARP from the host port is checked. ARP from the trusted uplink skips the check.

Network drawing: CAT9300, TO THE REST OF THE NETWORK, HOST-A, Gi1/0/1 UNTRUSTED · ARP IS CHECKED, TRUSTED · ARP BYPASSES DAI CHECKS

Host ports untrusted and switch-facing ports trusted is the typical layout, not a rule. Don't trust a switch-facing port just because there's a switch at the other end. If hosts behind it can send ARP that nobody validated, trusting that port gives their packets a way around DAI. Trusting an interface that should be untrusted is documented as a security hole.

Trust an infrastructure path only when you intend ARP entering from that direction to skip this switch's checks.

Now replay the attack. The caches start empty and the same four ARP packets are sent again:

packet      claims                            decided by             result
a-asks      10.20.30.2 is at aabb.cc00.0a02   the binding table      forwarded
b-answers   10.20.30.3 is at aabb.cc00.0b03   the binding table      forwarded
c-as-b      10.20.30.3 is at aabb.cc00.00c6   the binding table      dropped
c-as-a      10.20.30.2 is at aabb.cc00.00c6   the binding table      dropped

a-asks      the claim matches an IP-to-MAC binding in the DHCP snooping database
b-answers   the claim matches an IP-to-MAC binding in the DHCP snooping database
c-as-b      no binding in the database matches this claim, so the packet is not valid
c-as-a      no binding in the database matches this claim, so the packet is not valid

A's question and B's answer pass. Both of C's claims are dropped (2 of 2), so neither cache is poisoned this time.

A server with a typed-in address

A server on the same VLAN has a manually configured address: 10.20.30.10 at 0011.2233.4455, on Gi1/0/4. It never asked DHCP for that address, so DHCP snooping never recorded 10.20.30.10 → 0011.2233.4455.

packet      claims                            decided by             result
a-asks      10.20.30.2 is at aabb.cc00.0a02   the binding table      forwarded
b-answers   10.20.30.3 is at aabb.cc00.0b03   the binding table      forwarded
c-as-b      10.20.30.3 is at aabb.cc00.00c6   the binding table      dropped
c-as-a      10.20.30.2 is at aabb.cc00.00c6   the binding table      dropped
srv-asks    10.20.30.10 is at 0011.2233.4455  the binding table      dropped

a-asks      the claim matches an IP-to-MAC binding in the DHCP snooping database
b-answers   the claim matches an IP-to-MAC binding in the DHCP snooping database
c-as-b      no binding in the database matches this claim, so the packet is not valid
c-as-a      no binding in the database matches this claim, so the packet is not valid
srv-asks    no binding in the database matches this claim, so the packet is not valid

The server is telling the truth. The switch simply has no evidence that proves it.

Being a real device and being in the table are two different things, and only the second one counts here. The switch is not judging whether the server is legitimate; it is checking whether anything it watched happen supports the claim. A host that never asked for a lease left nothing to watch.

Precisely: on an untrusted interface, in a VLAN where DAI is enabled, an ARP claim with no matching DHCP snooping binding and no permitting ARP ACL fails DAI validation. Whether it's true doesn't enter into it.

Meanwhile every DHCP client keeps working, so the ticket says the server is unreachable and nothing on the server changed.

So which packets did the switch drop, and who sent them? The log names the sender:

This course's output: computed from this scenario, each line in the format of the syslog message the troubleshooting document prints.

CAT9300# show logging | include SW_DAI
%SW_DAI-4-DHCP_SNOOPING_DENY: 1 Invalid ARPs (Res) on Gi1/0/3, vlan 10.
  ([aabb.cc00.00c6/10.20.30.3/0000.0000.0000/10.20.30.2])
%SW_DAI-4-DHCP_SNOOPING_DENY: 1 Invalid ARPs (Res) on Gi1/0/3, vlan 10.
  ([aabb.cc00.00c6/10.20.30.2/0000.0000.0000/10.20.30.3])
%SW_DAI-4-DHCP_SNOOPING_DENY: 1 Invalid ARPs (Req) on Gi1/0/4, vlan 10.
  ([0011.2233.4455/10.20.30.10/0000.0000.0000/10.20.30.2])
! The tuple carries sender MAC, sender IP, target MAC and target IP. When you are deciding whether a drop is an attack or your own misconfiguration, that sender pair is the evidence: check whether it appears in the binding table. If it does not, ask why not before assuming malice.

Giving DAI an answer for static hosts

Intent: tell DAI explicitly that this static pairing is legitimate.

CAT9300# configure terminal
CAT9300(config)# arp access-list SERVERS
CAT9300(config-arp-nacl)# permit ip host 10.20.30.10 mac host 0011.2233.4455
CAT9300(config-arp-nacl)# exit
CAT9300(config)# ip arp inspection filter SERVERS vlan 10
CAT9300(config)# end

This isn't an ordinary IP ACL. It says: for ARP validation, permit the claim 10.20.30.10 belongs to 0011.2233.4455.

packet      claims                            decided by             result
a-asks      10.20.30.2 is at aabb.cc00.0a02   the binding table      forwarded
b-answers   10.20.30.3 is at aabb.cc00.0b03   the binding table      forwarded
c-as-b      10.20.30.3 is at aabb.cc00.00c6   the binding table      dropped
c-as-a      10.20.30.2 is at aabb.cc00.00c6   the binding table      dropped
srv-asks    10.20.30.10 is at 0011.2233.4455  the ARP ACL            forwarded

a-asks      the claim matches an IP-to-MAC binding in the DHCP snooping database
b-answers   the claim matches an IP-to-MAC binding in the DHCP snooping database
c-as-b      no binding in the database matches this claim, so the packet is not valid
c-as-a      no binding in the database matches this claim, so the packet is not valid
srv-asks    a user-configured ARP ACL permits this claim, and the ACL is consulted first

The server passes. The DHCP clients don't match any clause, so they fall back to their bindings and pass too. C still doesn't.

When the ACL and the binding disagree

Suppose the ARP ACL gets a clause that denies 10.20.30.3 → aabb.cc00.0b03: B's real, correct pairing, which DHCP snooping also has.

packet      claims                            decided by             result
a-asks      10.20.30.2 is at aabb.cc00.0a02   the binding table      forwarded
b-answers   10.20.30.3 is at aabb.cc00.0b03   the ARP ACL            dropped
c-as-b      10.20.30.3 is at aabb.cc00.00c6   the binding table      dropped
c-as-a      10.20.30.2 is at aabb.cc00.00c6   the binding table      dropped
srv-asks    10.20.30.10 is at 0011.2233.4455  the ARP ACL            forwarded

a-asks      the claim matches an IP-to-MAC binding in the DHCP snooping database
b-answers   the ARP ACL denies it, and a denial there is final even when a valid binding exists
c-as-b      no binding in the database matches this claim, so the packet is not valid
c-as-a      no binding in the database matches this claim, so the packet is not valid
srv-asks    a user-configured ARP ACL permits this claim, and the ACL is consulted first

The switch asks the ARP ACL first. An explicit deny there is final. It doesn't go on to ask whether DHCP snooping would overrule the administrator.

Every ARP ACL also ends with an implicit deny. By default that implicit deny doesn't finish the decision: a packet that matches no clause falls back to the binding table. That's why A and C were still judged by their bindings above; only B matched a clause.

One keyword changes that:

CAT9300# configure terminal
CAT9300(config)# ip arp inspection filter SERVERS vlan 10 static
CAT9300(config)# end

Without static: if my ARP ACL has no answer, ask DHCP snooping. With static: the ARP ACL is the answer; don't ask DHCP snooping.

packet      claims                            decided by             result
a-asks      10.20.30.2 is at aabb.cc00.0a02   the ARP ACL (static)   dropped
b-answers   10.20.30.3 is at aabb.cc00.0b03   the ARP ACL (static)   dropped
c-as-b      10.20.30.3 is at aabb.cc00.00c6   the ARP ACL (static)   dropped
c-as-a      10.20.30.2 is at aabb.cc00.00c6   the ARP ACL (static)   dropped
srv-asks    10.20.30.10 is at 0011.2233.4455  the ARP ACL            forwarded

a-asks      static: no ACL match is a deny, and DHCP bindings are not used
b-answers   static: no ACL match is a deny, and DHCP bindings are not used
c-as-b      static: no ACL match is a deny, and DHCP bindings are not used
c-as-a      static: no ACL match is a deny, and DHCP bindings are not used
srv-asks    a user-configured ARP ACL permits this claim, and the ACL is consulted first

With static and an ACL that names only the server, A and B are dropped while telling the truth. On a VLAN that mixes DHCP clients and static servers, leave static off.