Jeremy’s IT Lab lecture video:
Day 51 - Dynamic ARP Inspection (DAI)
Commands
Commands List
ARP Inspection Show Commands
22. Dynamic ARP Inspection
Link to original
- show ip arp inspection
-->Shows a summary of the Dynamic ARP Inspection configuration as well as statistics- show ip arp inspection interfaces
-->Shows the status of Dynamic ARP Inspection on the switch’s interfacesARP Inspection Global Commands
ErrDisable (Port Security / DHCP Snooping / ARP Inspection)
Link to original
- errdisable recovery cause cause { psecure-violation | dhcp-rate-limit | arp-inspection }
-->Enables err-disable recovery for the specified cause- errdisable recovery interval seconds
-->Determines how long the switch should wait before enabling an err-disabled interface (if the err-disable recovery for that cause is enabled)Dynamic ARP Inspection Global
Link to original
- ip arp inspection vlan vlan-id
-->Enables Dynamic ARP Inspection on the specified VLAN- ip arp inspection validate validation-method(s) ( src-mac | dst-mac | ip )
-->Configures the current ARP Inspection validation method(s)
- (You can use multiple by specifying them in the same command)
- arp access-list arp-acl-id
-->Creates an ARP ACL and enters ARP ACL configuration mode
- In configuration mode:
- { permit | deny } ip host ip-address mac host mac-address
- ip arp inspection filter arp-acl-id vlan vlan-id
-->Applies an ARP ACL on the specified VLANARP Inspection Interface Commands
Dynamic ARP Inspection Interface
Link to original
- ip arp inspection trust
-->Configures the current interface as trusted for ARP inspections- ip arp inspection limit rate packets burst interval seconds
-->Limits how many ARP packets are allowed per burst interval (Burst interval default is 1)
DAI Info
ARP Review
ARP is a protocol that is used to learn the MAC address of another device with a known IP address.
- Typically, it is a two message exchange consisting of:
- ARP Request
- ARP Reply
- The ARP message itself is a Layer 2 message, but within the ARP header, it contains the sender MAC and IP, as well as the target MAC and IP.
Gratuitous ARP
A Gratuitous ARP message is an ARP Reply that is sent without receiving an ARP Request.
- It is sent to the broadcast MAC address.
- It allows other devices to learn the MAC address of the sending device without having to send ARP Requests.
- Some devices automatically send GARP messages when an interface is enabled, IP address is changed, MAC address is changed, and etc.
Dynamic ARP Inspection
Dynamic ARP Inspection (DAI) is a security feature of switches that is used to filter ARP messages received on untrusted ports.
- DAI only filters ARP messages. Non-ARP messages are not affected by it.
- By default, all ports are untrusted. There’s also a standard to follow while assigning trusted ports.
- Trusted ports should be all the ports connected to other network devices (switches, routers)
- Untrusted ports should be all ports connected to end hosts.
ARP Poisoning (man-in-the-middle attack)
ARP Poisoning is an attack that’s similar to the DHCP Poisoning attack. It involves an attacker manipulating targets’ ARP tables so traffic is sent to the attacker.
- In order for the attacker to accomplish this, the attacker can send GARP messages using another device’s IP address.
- Other devices in the network will receive the GARP and update their ARP tables, which will cause them to send traffic to the attacker instead of the legitimate destination.
![]() |
|---|
| ARP Poisoning Attack Demonstration |
DAI Operations
- When an ARP packet is received, DAI will do the following checks:
- If a message arrived on a trusted port:
- DAI does not inspect the messages and they are forwarded as normal.
- If a message arrived on an untrusted port, do the following:
- Examine the sender MAC and sender IP fields of ARP messages received on untrusted port, and checks that there is a matching entry in the DHCP snooping binding table.
- Match = Forward the ARP message
- No match = Discard the ARP message
- Examine the sender MAC and sender IP fields of ARP messages received on untrusted port, and checks that there is a matching entry in the DHCP snooping binding table.
- If a message arrived on a trusted port:
- ARP ACLs can be manually configured to map IP/MAC addresses for DAI to check.
- They are mainly used for hosts which do not utilize DHCP, therefore, they do not have an entry in the DHCP snooping binding table.
- DAI can also be configured to perform more optional in-depth checks.
- Like DHCP snooping, DAI also supports rate-limiting to prevent attackers from overwhelming the switch with ARP messages.
- The reason this exists is because features like DHCP snooping and DAI both require work from the switch’s CPU.
- Even if an attacker’s messages are blocked, they can overload the switch’s CPU with excessive ARP messages.
DAI Configurations
show ip arp inspection- Shows a summary of the Dynamic ARP Inspection configuration as well as statistics.
show ip arp inspection interfaces- Shows the status of Dynamic ARP Inspection on the switch’s interfaces.
ip arp inspection vlan VLAN-ID- Enables Dynamic ARP Inspection on the specified VLAN.
- (Unlike DHCP snooping, DAI doesn’t have to be enabled globally beforehand)
ip arp inspection validate VALIDATION-MODE ( SRC-MAC | DST-MAC | IP )^arp-inspection-validate-cmd- Configures the current ARP Inspection validation method(s).
- Supports 3 validation modes, being src-mac, dst-mac, ip.
- (You can use multiple by specifying them in the same command)
ip arp inspection trust- Configures the current interface as trusted for ARP inspections,
ip arp inspection limit rate PACKETS burst interval SECONDS- Limits how many ARP packets are allowed per burst interval
- (Default settings are: 15 packets per 1 burst interval, in other words, 15 packets per second)
arp access-list ARP-ACL-ID- Creates an ARP ACL and enters ARP ACL configuration mode.
- In configuration mode:
- { permit | deny } ip host ip-address mac host mac-address
- Creates an ARP ACL and enters ARP ACL configuration mode.
ip arp inspection filter ARP-ACL-ID vlan VLAN-ID- Applies an ARP ACL on the specified VLAN
DAI Rate-Limiting
DAI rate-limiting is enabled on untrusted ports by default with a rate of 15 packets per second.
- It is disabled on trusted ports by default.
- DAI also supports a burst interval, which means it can handle data that arrives in quick short bursts, and will not err-disable the interface (If the bursts don’t go over the configured limit set through
ip arp inspection limit rate PACKETS burst interval SECONDS). - Can be re-enabled with
shutdown⇒no shutdown, or through ErrDisable Recovery (errdisable recovery cause arp-inspection).
Difference between rate-limiting on DHCP snooping and DAI
- DHCP snooping
- Rate-limiting is disabled on all interfaces by default.
- Rate-limit format: ==X packets per second==.
- Default: 15 packets per second
- DAI
- Rate-limiting is enabled on untrusted ports and disabled on trusted ports by default.
- Rate-limit format: ==X packets per Y seconds==.
- Default: 15 packets per 1 second
DAI Optional Checks
There are optional DAI checks that you can enable (with ip arp inspection validate MODE) to further secure your network from attacks.
They include:
- src-mac
- Enables validation of the source MAC address in the Ethernet header against the sender MAC address in the ARP body for ARP Requests and ARP Responses.
- The devices classifies packets with different MAC addresses as invalid and drops them.
- dst-mac
- Enables validation of the destination MAC address in the Ethernet header against the target MAC address in the ARP body for ARP Responses.
- The device classifies packets with different MAC addresses as invalid and drops them.
- ip
- Enables validation of the ARP body for invalid and unexpected IP addresses. Addresses include (0.0.0.0, 255.255.255.255), and all IP multicast addresses.
- The device checks the sender IP addresses in all ARP Requests and ARP Responses and checks the target IP addresses only in ARP Responses.
Optional checks and DAI
- These checks are done in addition to the standard DAI check (sender MAC/IP).
- If optional checks are configured, an ARP message must pass all of the checks to be considered valid.
DAI ARP ACL
For hosts which do not use DHCP, you can create an ARP ACL that will permit ARP messages from said devices.
- You’ll need to create an ARP ACL with
arp access-list ARP-ACL-IDand set a rule to permit ARP traffic from that specific host. - Then you can apply it with DAI through the
ip arp inspection filter ARP-ACL-ID vlan VLAN-IDcommand
Jeremy’s IT Lab előadásvideó:
51. Nap - Dynamic ARP Inspection (DAI)
Parancsok
Parancslista
ARP Inspection Show Parancsok
22. Dynamic ARP Inspection
Eredeti hivatkozása
- show ip arp inspection
-->Megjeleníti a Dynamic ARP Inspection konfigurációs összefoglalóját és a statisztikákat- show ip arp inspection interfaces
-->Megjeleníti a Dynamic ARP Inspection állapotát és beállításait a switch interfészeinARP Inspection Globális Parancsok
ErrDisable (Port Security / DHCP Snooping / ARP Inspection)
Eredeti hivatkozása
- errdisable recovery cause cause { psecure-violation | dhcp-rate-limit | arp-inspection }
-->Engedélyezi az err-disable állapotból való automatikus helyreállítást a megadott okra- errdisable recovery interval seconds
-->Meghatározza, hány másodpercet várjon a switch, mielőtt újra engedélyezi az err-disabled interfésztDynamic ARP Inspection Global
Eredeti hivatkozása
- ip arp inspection vlan vlan-id
-->Engedélyezi a Dynamic ARP Inspection működését a megadott VLAN-on- ip arp inspection validate validation-method(s) ( src-mac | dst-mac | ip )
-->Beállítja a kiegészítő ARP ellenőrzési módszer(eke)t
- (Több módszer is megadható egyszerre ugyanabban a parancsban)
- arp access-list arp-acl-id
-->Létrehoz egy ARP ACL-t és belép az ARP ACL konfigurációs módba
- Konfigurációs módban:
- { permit | deny } ip host ip-address mac host mac-address
- ip arp inspection filter arp-acl-id vlan vlan-id
-->Alkalmazza a megadott ARP ACL-t a kijelölt VLAN-raARP Inspection Interfész Parancsok
Dynamic ARP Inspection Interface
Eredeti hivatkozása
- ip arp inspection trust
-->Megbízhatónak (trusted) jelöli ki az aktuális interfészt az ARP ellenőrzések szempontjából- ip arp inspection limit rate packets burst interval seconds
-->Korlátozza a megengedett ARP csomagok számát burst intervallumonként (alapértelmezett burst interval: 1 másodperc)
DAI Információk
ARP Áttekintés (ARP Review)
Az ARP (Address Resolution Protocol) olyan protokoll, amely egy ismert IP címhez tartozó MAC cím felderítésére szolgál a helyi hálózaton.
- Tipikusan egy kétüzenetes folyamat:
- ARP Request (Kérés - broadcast formájában küldve)
- ARP Reply (Válasz - unicast formájában visszaküldve)
- Maga az ARP üzenet egy Layer 2 keretbe van ágyazva, de az ARP fejléc tartalmazza a küldő (sender) MAC és IP címét, valamint a célpont (target) MAC és IP címét is.
Gratuitous ARP (GARP)
A Gratuitous ARP (GARP) egy olyan ARP Reply üzenet, amelyet egy eszköz anélkül küld el, hogy előzetesen ARP Request kérést kapott volna.
- A broadcast MAC címre küldik ki.
- Lehetővé teszi, hogy a hálózat többi eszköze megtanulja vagy frissítse a küldő eszköz MAC címét anélkül, hogy külön ARP Request kéréseket kellene küldeniük.
- Egyes eszközök automatikusan küldenek GARP üzenetet, amikor egy interfész feláll, megváltozik az IP cím, MAC cím stb.
Dynamic ARP Inspection (DAI)
A Dynamic ARP Inspection (DAI) a switchek olyan biztonsági funkciója, amely a nem megbízható (untrusted) portokon érkező ARP üzenetek szűrésére és érvényességének ellenőrzésére szolgál.
- A DAI kizárólag az ARP üzeneteket szűri. A nem-ARP forgalmat nem érinti.
- Alapértelmezés szerint minden port untrusted (nem megbízható). A megbízható (trusted) portok kijelölésének szabványa:
- Trusted (megbízható) portoknak kell lenniük mindazon portoknak, amelyek más legitim hálózati eszközökhöz (switchekhez, routerekhez) csatlakoznak.
- Untrusted (nem megbízható) portként kell kezelni az összes olyan portot, amely végfelhasználói gépekhez (end hosts) csatlakozik.
ARP Poisoning (Man-in-the-middle támadás)
Az ARP Poisoning (vagy ARP Spoofing) a DHCP Poisoning-hoz hasonló támadási forma. Lényege, hogy a támadó manipulálja a célpontok ARP tábláját, hogy a forgalom a támadó gépén haladjon keresztül.
- Ennek megvalósításához a támadó hamisított GARP vagy ARP Reply üzeneteket küld szét, amelyekben egy másik eszköz (pl. a default gateway) IP címét a saját MAC címéhez köti.
- A hálózat többi eszköze fogadja a hamis GARP-ot és frissíti a helyi ARP tábláját, ami miatt a legitim célpont helyett a támadónak küldik az adataikat.
![]() |
|---|
| ARP Poisoning támadás szemléltetése |
DAI Működési Mechanizmusa
- Egy ARP csomag beérkezésekor a DAI az alábbi ellenőrzéseket hajtja végre:
- Ha az üzenet egy trusted (megbízható) portra érkezett:
- A DAI nem vizsgálja meg az üzenetet, és a switch normálisan továbbítja azt.
- Ha az üzenet egy untrusted (nem megbízható) portra érkezett:
- Megvizsgálja az ARP üzenetben található küldő (sender) MAC és küldő (sender) IP mezőket, és összeveti azokat a DHCP snooping binding table bejegyzéseivel.
- Egyezés van = Továbbítja (Forward) az ARP üzenetet.
- Nincs egyezés = Eldobja (Discard) az ARP üzenetet.
- Megvizsgálja az ARP üzenetben található küldő (sender) MAC és küldő (sender) IP mezőket, és összeveti azokat a DHCP snooping binding table bejegyzéseivel.
- Ha az üzenet egy trusted (megbízható) portra érkezett:
- Manuálisan ARP ACL-ek is konfigurálhatók az IP/MAC összerendelések rögzítésére a DAI számára.
- Ezeket elsősorban olyan hostoknál használjuk, amelyek statikus IP címet használnak (nem vesznek igénybe DHCP-t), így nem szerepelnek a DHCP snooping binding table-ben.
- A DAI beállítható további opcionális mélyreható ellenőrzések végrehajtására is.
- A DHCP snooping-hoz hasonlóan a DAI is támogatja a rate-limiting (forgalomkorlátozás) funkciót, hogy megakadályozza, hogy a támadók túlterheljék a switchet ARP üzenetek áradatával.
- Erre azért van szükség, mert a DHCP snooping és a DAI vizsgálatai is a switch központi processzorát (CPU) terhelik.
- Még ha a támadó illegális üzeneteit a switch el is dobja, a túlzott mennyiségű ARP csomag feldolgozása túlterhelheti a processzort (DoS a switch ellen).
DAI Konfigurációk
show ip arp inspection- Összefoglalót jelenít meg a Dynamic ARP Inspection konfigurációjáról és statisztikáiról (engedélyezett VLAN-ok, továbbított és eldobott csomagok száma).
show ip arp inspection interfaces- Megjeleníti a Dynamic ARP Inspection állapotát és a portonkénti forgalomkorlátokat a switch interfészein.
ip arp inspection vlan VLAN-ID- Engedélyezi a Dynamic ARP Inspection-t a megadott VLAN-on.
- (A DHCP snooping-gal ellentétben a DAI-t nem szükséges előzetesen globálisan bekapcsolni, közvetlenül a VLAN-hoz rendeljük).
ip arp inspection validate VALIDATION-MODE ( SRC-MAC | DST-MAC | IP )^arp-inspection-validate-cmd- Beállítja az opcionális ARP Inspection validációs metódus(oka)t.
- 3 validációs módot támogat: src-mac, dst-mac, ip.
- (Több mód is megadható egyszerre ugyanabban a parancsban).
ip arp inspection trust- Megbízhatónak (trusted) jelöli ki az aktuális interfészt az ARP ellenőrzések szempontjából.
ip arp inspection limit rate PACKETS burst interval SECONDS- Korlátozza az engedélyezett ARP csomagok számát a megadott burst intervallumon belül.
- (Alapértelmezett beállítás: 15 csomag 1 másodperces burst intervallumban, azaz 15 csomag/másodperc).
arp access-list ARP-ACL-ID- Létrehoz egy ARP ACL-t és belép az ARP ACL konfigurációs módba:
- Konfigurációs módban:
- { permit | deny } ip host ip-address mac host mac-address
- Létrehoz egy ARP ACL-t és belép az ARP ACL konfigurációs módba:
ip arp inspection filter ARP-ACL-ID vlan VLAN-ID- Alkalmazza a megadott ARP ACL szűrőt a kiválasztott VLAN-ra.
DAI Forgalomkorlátozás (Rate-Limiting)
A DAI rate-limiting funkciója a nem megbízható (untrusted) portokon alapértelmezés szerint engedélyezve van 15 csomag/másodperc értékkel.
- A megbízható (trusted) portokon alapértelmezés szerint ki van kapcsolva.
- A DAI támogatja a burst intervallumot is, ami azt jelenti, hogy képes kezelni a hirtelen, rövid csomagkitöréseket anélkül, hogy hibásan letiltaná a portot (feltéve, hogy a csomagok száma nem haladja meg az
ip arp inspection limit rate PACKETS burst interval SECONDSparanccsal megadott értéket). - A leállított interfész manuálisan a
shutdown⇒no shutdownszekvenciával, vagy automatikusan az ErrDisable Recovery (errdisable recovery cause arp-inspection) paranccsal kapcsolható vissza.
Különbségek a DHCP snooping és a DAI forgalomkorlátozása (rate-limiting) között
- DHCP snooping
- A Rate-limiting alapértelmezés szerint minden interfészen ki van kapcsolva.
- A korlát formátuma: ==X csomag másodpercenként==.
- Alapértelmezett (ha bekapcsolják): 15 csomag másodpercenként.
- DAI
- A Rate-limiting alapértelmezés szerint be van kapcsolva az untrusted portokon, és ki van kapcsolva a trusted portokon.
- A korlát formátuma: ==X csomag Y másodpercenként== (burst interval).
- Alapértelmezett: 15 csomag 1 másodpercre.
DAI Opcionális Ellenőrzések (Optional Checks)
Léteznek opcionális DAI ellenőrzések, amelyeket bekapcsolhatsz (az ip arp inspection validate MODE paranccsal) a hálózat további védelme érdekében:
- src-mac
- Ellenőrzi, hogy az Ethernet fejlécben lévő forrás (source) MAC cím megegyezik-e az ARP törzsben szereplő küldő (sender) MAC címmel mind az ARP Request, mind az ARP Response csomagoknál.
- Ha a MAC címek eltérnek, a switch érvénytelennek minősíti és azonnal eldobja a csomagot.
- dst-mac
- Ellenőrzi, hogy az Ethernet fejlécben lévő cél (destination) MAC cím megegyezik-e az ARP törzsben szereplő célpont (target) MAC címmel az ARP Response csomagoknál.
- Ha eltérés van, a switch érvénytelennek minősíti és eldobja a csomagot.
- ip
- Érvénytelen és váratlan IP címeket szűr ki az ARP törzsből (pl. 0.0.0.0, 255.255.255.255, valamint az összes IP multicast címet).
- A switch ellenőrzi a küldő (sender) IP címeket minden ARP Request és ARP Response csomagban, a cél (target) IP címeket pedig az ARP Response csomagokban.
Opcionális ellenőrzések és a DAI
- Ezeket az ellenőrzéseket a switch a standard DAI ellenőrzésen (sender MAC/IP a binding table-ben) felül hajtja végre.
- Ha opcionális ellenőrzések vannak beállítva, az ARP üzenetnek minden bekapcsolt vizsgálaton sikeresen át kell mennie ahhoz, hogy a switch érvényesnek tekintse és továbbítsa.
DAI ARP ACL
Olyan hosztok számára, amelyek nem használnak DHCP-t (statikus IP-címük van), létrehozhatsz egy ARP ACL-t, amely kifejezetten engedélyezi az adott eszközöktől érkező ARP üzeneteket.
- Létre kell hozni az ARP ACL-t az
arp access-list ARP-ACL-IDparanccsal, és megadni egy szabályt, amely engedélyezi (permit) az adott host IP/MAC párját. - Ezután hozzá kell rendelni a DAI-hoz az
ip arp inspection filter ARP-ACL-ID vlan VLAN-IDparanccsal.
/ATCH-Day-51---Dynamic-ARP-Inspection-(DAI)-20240417161937.webp)