Dynamic ARP Inspection
Synchronized Transcript
137 cues indexed • Click dialogue or words to jumpWelcome to Jeremy’s IT Lab. This is a free, complete course for the CCNA. If you like these videos, please subscribe to follow along with the series.
Also, please like and leave a comment, and share the video to help spread this free series of videos. Thanks for your help. In this video we’ll cover Dynamic ARP Inspection.
Dynamic ARP Inspection, also called DAI, is covered in exam topic 5.7, which says you must be able to configure Layer 2 security features, including DHCP snooping, DAI, and port security.
We covered DHCP snooping and port security in the previous two videos, so this video will finish up topic 5.7. Dynamic ARP inspection is a security feature of switches which inspects ARP messages in a similar manner to how DHCP snooping inspects DHCP messages.
So, this video will follow a similar structure to the previous video. Here’s what we’ll cover in this video. First, what is dynamic ARP inspection?
I’ll give a brief overview, and then introduce how it works. I’ll show you what attacks it can be used to prevent, and then how to configure it as we look into more details of its operations.
Watch until the end of the video for a bonus practice question from Boson Software’s ExSim for CCNA, my recommended practice exams for the CCNA.
Before dynamic ARP inspection, let’s quickly review ARP itself. ARP is used to learn the MAC address of another device with a known IP address.
For example, a PC will use ARP to learn the MAC address of its default gateway to communicate with external networks. It will also use ARP to learn the MAC address of any other device on the local network.
Typically it’s a two message exchange, consisting of an ARP request and then a reply. Let’s look at an example. For example, PC1 wants to send a DNS query to the DNS server at 8.8.8.8.
It thinks, 8.8.8.8 is outside of my local network, so I should send the frame to my default gateway, 192.168.1.1. However, PC1 doesn’t know the MAC address of 192.168.1.1, which is R1.
So, it will broadcast this ARP request message, destined for R1’s IP address. Every device in the LAN will receive the message, because the destination MAC address is the broadcast MAC address of all Fs.
Let’s look at that ARP request in wireshark. The ARP message is encapsulated in an Ethernet frame of course, but there is no IP header.
So, in the previous slide when I wrote ‘source IP’ and ‘destination IP’ for the ARP message, I’m actually referring to these fields in the ARP message itself.
Specifically the sender IP address, which is the source IP address, and the target IP address, which is the destination IP address.
ARP messages are only broadcast within the local network, not sent by routers to external networks, so there’s no need to encapsulate the ARP message in an IP header.
Keep these fields in mind, sender MAC and IP address, as well as target MAC and IP address, they can play a role in the dynamic ARP inspection process.
Because its IP address was in the ARP message’s target IP address field, R1 will then send an ARP reply to PC1 so that PC1 can learn R1’s MAC address and add an entry for R1 in its ARP table.
Note that R1 also added an entry for PC1 in its own ARP table when it received the original ARP request from PC1, so R1 doesn’t need to send an ARP request if it wants to send a frame to PC1.
Here’s that ARP reply in Wireshark. The sender IP and MAC fields are R1’s addresses, and the destination IP and MAC fields are PC1’s addresses.
Pause the video if you want to check out the message. So, PC1 is now able to insert R1’s MAC address as the destination MAC of its DNS query, and then send the message to R1 which will forward it over the Internet.
So, that’s the basic ARP process. But there is also something called gratuitous ARP, which I introduced briefly in another video.
A gratuitous ARP message is an ARP reply that is sent without receiving an ARP request. It is sent to the broadcast MAC address, all Fs.
Note that standard ARP replies are not broadcast. They are unicast messages sent to the device that sent the ARP request.
Gratuitous ARP allows other devices on the local network to learn the MAC address of the device that sent the gratuitous ARP, and they don’t have to send ARP requests.
This depends on the device maker, but some devices automatically send gratuitous ARP messages when an interface is enabled, IP address is changed, MAC address is changed, etc.
So, for example if PC2’s network interface is enabled it might send this gratuitous ARP reply, and it is flooded in the local network.
Now the other devices will add an ARP entry for PC2 in their ARP tables, and the switches also add entries for PC2 in their MAC address tables. We’ll come back to the concept of gratuitous ARP when we cover an attack involving it, but now let’s move on.
Okay, let’s move on to Dynamic ARP Inspection. DAI is a feature of switches that is used to filter ARP messages received on untrusted ports.
It only filters ARP messages. All other messages will be unaffected. Just like DHCP snooping, all ports are untrusted by default.
Typically, all ports connected to other network devices, for example switches or routers, should be configured as trusted, while interfaces connected to end hosts should remain untrusted.
So, in this network that means we should configure these interfaces as trusted, but leave these interfaces as untrusted. Now, SW2’s interface connected to SW1 could also be left as untrusted because it is a downlink leading toward the end hosts.
Either design will work. In Cisco’s documentation they recommend that all interfaces connected to switches, routers, etc. are configured as trusted, so that’s why I made the interface trusted.
Here’s how DAI works, and you’ll see it’s basically the same as DHCP snooping. PC1 sends an ARP request. Because it arrives on an untrusted port, SW1 uses DAI to inspect it.
It determines the message is OK, so it forwards it to SW2. In this case SW2 doesn’t inspect it, because it receives the message on a trusted interface, so it forwards it to R1, which sends the reply.
This message isn’t inspected by SW2 or SW1, because they receive it on trusted interfaces. This time PC2 sends an ARP message, but SW1 inspects it and decides to discard the message because it violates the rules of DAI.
I’ll explain exactly how DAI determines if a message is okay or not later, but now let me show you an ARP-based attack. So, this is the ARP poisoning attack, which I briefly mentioned in a previous video.
Similar to DHCP poisoning, ARP poisoning involves an attacker manipulating targets’ ARP tables so traffic is sent to the attacker.
To do this, the attacker can send gratuitous ARP messages using another device’s IP address. Another option is to send replies to the targets’ legitimate ARP request messages, but I’ll use gratuitous ARP for this demonstration.
Other devices will receive the gratuitous ARP and update their ARP tables, causing them to send traffic to the attacker instead of the legitimate destination.
For example, the attacker PC2 sends a GARP message using the IP address of the default gateway, R1. It is flooded through the network, and all devices receive it.
So, they update their ARP tables to map PC2’s MAC address to the IP address 192.168.1.1. By the way, R1 doesn’t update its ARP table, because 192.168.1.1 is its own IP address.
Now, if PC1 wants to send this packet to an external network, it is sent to PC2 first. PC2 can save a copy of the message for future inspection and then forward it to the legitimate default gateway, R1.
It’s possible that PC2 could also manipulate the information in the packet. So, this is how ARP can be used to perform a man in the middle attack, similar to the DHCP poisoning attack shown in the previous video.
Now let’s see how DAI can protect against this kind of attack. First, here’s a summary of how DAI works. DAI inspects the sender MAC and sender IP fields of ARP messages received on untrusted ports and checks if there is a matching entry in the DHCP snooping
binding table. So, I showed you in the previous video that DHCP snooping creates a binding table, and as you can see the MAC addresses and IP addresses of DHCP clients are entered here.
So, DAI checks ARP messages and if there is a matching entry in the DHCP snooping table, the ARP message is forwarded normally.
DAI trusts the message. However, if there isn’t a matching entry in the DHCP snooping binding table the ARP message is discarded.
Note that this check only occurs on untrusted ports, DAI doesn’t inspect messages received on trusted ports. They are forwarded as normal.
However, just like in DHCP snooping all ports are untrusted by default, so you have to manually specify which ports are trusted. So, DAI operations are usually reliant on DHCP snooping, but actually there is another option.
ARP ACLs can be manually configured to map IP addresses and MAC addresses for DAI to check. This can be useful for hosts that don’t use DHCP.
If they don’t use DHCP, they won’t have an entry in the DHCP snooping table, so DAI will just drop all ARP messages they try to send.
You can configure ARP ACLs for these specific hosts. Or all hosts if you want, but that’s a lot of manual work. I’ll show you how to configure ARP ACLs later.
In addition to the sender MAC and sender IP fields, DAI can be configured to perform more in-depth checks, but these are optional. I’ll briefly introduce them later.
And like DHCP snooping, DAI also supports rate-limiting to prevent attackers from overwhelming the switch with ARP messages. I didn’t mention this in the last video, but DHCP snooping and DAI both require work from the switch’s CPU.
So, even if the attacker’s messages are blocked they can still overload the switch CPU by sending a ton of ARP messages. If the attacker tries to do that, rate limiting will just disable the interface, so it’s a useful mitigation technique.
Now let’s move on to DAI configuration. First up, the basic commands to enable it and configure trusted ports. First, use IP ARP INSPECTION VLAN, followed by the VLAN number, to enable DAI on a VLAN.
In this network I’m using VLAN 1 only. However, if there are multiple VLANs, you should enable DAI for each VLAN. If you don’t, only ARP messages in the specified VLAN, VLAN 1 in this case, will be inspected.
Then I configured SW2’s G0/0 and G0/1 interfaces as trusted ports with the command IP ARP INSPECTION TRUST. And that’s it, those are the basic commands to enable DAI and configure trusted ports.
Then I did the same configurations on SW1, but only made its G0/0 interface trusted. Now, you might have noticed a difference between DHCP snooping configuration and DAI configuration.
DHCP requires two commands to enable it, IP DHCP SNOOPING and IP DHCP SNOOPING VLAN. So, enable it globally and then enable it per VLAN.
DAI is different, you only have to enable it per VLAN with the command IP ARP INSPECTION VLAN. Honestly I’m not sure the reason for this difference, but that’s how it works.
Okay let’s check out one of the DAI show commands, SHOW IP ARP INSPECTION INTERFACES. First, you can see the trust state of each interface.
On SW1 only G0/0 is trusted, as I configured. This column shows us the DAI rate limiting settings. There are a few differences between DHCP snooping rate limiting and DAI rate limiting.
DAI rate limiting is enabled on untrusted ports by default with a rate of 15 packets per second, but it is disabled on trusted ports by default.
In the case of DHCP snooping, rate limiting is disabled on all interfaces, trusted and untrusted, by default. And this column shows us one more difference.
DHCP snooping rate limiting is configured like this. X packets per second. However DAI has a feature called the burst interval which allows you to configure rate limiting like X packets per Y seconds.
So, the interval being measured doesn’t have to be one second, which provides more flexibility with how you can control the rate of ARP messages on the interface. Okay, since I just brought up DAI rate limiting let’s see how to configure it.
Let’s configure DAI rate limiting on SW1. First, on G0/1 and 2 I used IP ARP INSPECTION LIMIT RATE 25, that means 25 packets, and then BURST INTERVAL 2, that means 2 seconds.
So, I changed the rate from 15 packets per second to 25 packets per 2 seconds. Note that the burst interval is optional.
If you don’t specify it, the default is 1 second. To demonstrate, on G0/3 I configured IP ARP INSPECTION LIMIT RATE 10, without specifying the burst interval.
And here you can see the results. For G0/1 and 2 it’s 25 packets per 2 seconds, and for G0/3 it’s 10 packets per second.
So, that’s how DAI rate limiting is configured. If ARP messages are received faster than the specified rate, the interface will be err-disabled.
Let me emphasize that, rate limiting limits the rate that ARP messages are received on an interface, not sent by an interface. Anyway, interfaces disabled by ARP inspection can be re-enabled manually with SHUTDOWN and NO SHUTDOWN on the interface, or with err-disable
recovery. The command is ERRDISABLE RECOVERY CAUSE ARP-INSPECTION. I configured err-disable recovery on SW1, and as you can see it is enabled when I check with SHOW ERRDISABLE RECOVERY.
Okay, that’s all for DAI rate limiting. Now let me introduce those additional checks I mentioned before. By default, DAI checks the sender MAC and IP addresses, to see if there is a matching entry in the DHCP snooping binding table or not.
However, additional checks can be performed by configuring the IP ARP INSPECTION VALIDATE command. The three options are destination MAC, IP, and source MAC.
How exactly do these work? I think Cisco’s explanations are quite straightforward and easy to understand, so I’ll just paste them here.
Destination MAC validates ARP responses by checking the destination MAC address in the Ethernet header against the target MAC address in the ARP message. If they are different, the frame is dropped.
IP validation looks for invalid or unexpected IP addresses which shouldn’t be found in ARP messages, such as 0.0.0.0, 255.255.255.255, and multicast IP addresses.
These IP addresses shouldn’t belong to a host, so they are considered invalid. The sender IP address is checked in both ARP request and reply messages, but the target IP address is checked only in ARP replies.
Finally, source MAC validation checks the source MAC of the Ethernet header and compares it to the sender MAC in the ARP message. If they don’t match, the message is considered invalid and is dropped.
To clarify those, here is that ARP reply message I showed earlier. These validation checks look at the source and destination MAC addresses in the Ethernet header, and also at these fields in the ARP message itself.
In this case, the source and destination in the Ethernet header match the sender and target MAC addresses in the ARP message, so the message is valid for the destination MAC and source MAC checks.
The sender and target IP addresses in the ARP message are also valid, so it passes that check too. Note that these checks are done in addition to the standard DAI check, which looks at the sender MAC and IP addresses and compares them to the DHCP snooping binding table.
So, if these checks are configured an ARP message must pass all of the checks to be considered valid. There’s an important point to mention about configuring those additional checks.
I configured, in order, IP ARP INSPECTION VALIDATE DST-MAC, then IP, then SRC-MAC, and checked with SHOW RUN | INCLUDE VALIDATE.
So, what do you think was displayed? Only VALIDATE SRC-MAC was displayed. First I configured VALIDATE DST-MAC, but when I configured VALIDATE IP, it overwrote the previous command.
Then when I configured VALIDATE SRC-MAC, it overwrote IP. So, if you want to enable all three checks, you should configure it like this.
IP ARP INSPECTION VALIDATE IP SRC-MAC DST-MAC. I checked again, and now you can see all three.
To summarize, you must enter all of the validation checks you want in a single command. You can specify one, two, or all three, and the order isn’t significant, it doesn’t matter.
Okay, those are the optional validation checks that can be configured. Now there is one more topic I want to cover, ARP ACLs. Now, I’m pretty sure the topic of ARP ACLs and their configuration is beyond the scope of the CCNA exam.
So, I will just give a quick example of how they work and then we’ll finish up the video. I won’t go into the details here. Here is SW2’s DHCP snooping binding table.
SRV1 has a static IP address, 192.168.1.100, so it doesn’t have an entry in SW2’s DHCP snooping binding table.
So, what will happen when SRV1 tries to send an ARP request? It will be dropped, with an error message like this.
It says 1 invalid ARP request on G0/2 in VLAN1. That’s because SRV1 doesn’t have an entry in SW2’s DHCP snooping binding table.
So, to fix this let’s configure an ARP ACL to permit SRV1. Here’s the configuration. ARP ACCESS-LIST, followed by a name, to create the ARP ACL.
Then I configured PERMIT IP HOST 192.168.1.100 MAC HOST, followed by SRV1’s MAC address.
But, creating the ARP ACL alone doesn’t help, we have to apply it for it to take effect. The command is IP ARP INSPECTION FILTER, the ACL name, VLAN, and the VLAN number.
Okay, we created the ARP ACL and then applied it. This time when SRV1 tries to send an ARP request, SW2 forwards it even though there is no entry in the DHCP snooping binding table.
That’s because of the ARP ACL we configured. Here’s one last show command before we finish, SHOW IP ARP INSPECTION.
It gives a summary of the DAI configuration as well as statistics about how many ARP messages have been forwarded and dropped. Let me just point out a few fields, you don’t have to know all of them.
First, notice that source MAC, destination MAC, and IP address validation are enabled. I enabled them on SW1 before, but I enabled them on SW2 also.
Here we can see that DAI is configured and operational in VLAN1, and the ACL ARP-ACL-1 is in effect. Now, this is a detail beyond the scope of the CCNA, but notice the static ACL field at the end.
If static ACL is set to yes, the implicit deny at the end of the ARP ACL will take effect. Like regular IP ACLs, ARP ACLs also have an implicit deny.
But if you don’t enable the static setting, the implicit deny will be ignored. I didn’t configure it as a static ACL, so in my example the implicit deny is ignored.
But what will happen if the implicit deny takes effect? It will cause all ARP messages not permitted by the ARP ACL to be denied. So, in effect this means that only the ARP ACL will be checked.
The DHCP snooping table will not be checked. Usually we leave this setting as No, and as I said it’s just an interesting detail that’s beyond the scope of the CCNA, so let’s keep going.
Here you can see some statistics about how many ARP messages have been forwarded and dropped. Notice 4 messages have been dropped, and all 4 are DHCP drops.
That means messages dropped because there wasn’t a matching entry in the DHCP snooping table. That’s because I tried to ping from SRV1 before configuring the ARP ACL.
However, here you can see 1 ACL permit. This is when SW2 permitted SRV1’s ARP message after I configured the ARP ACL.
SRV1’s ARP request message was permitted and counted here. Here is a summary of the new commands we looked at in this video.
As always, go back in the video to review if you don’t remember any of these commands. Also make sure to practice these commands in a lab, for example my packet tracer lab in the next video.
Hands-on practice is an essential part of studying for the CCNA. Before moving on to the quiz, here’s a quick review of what we covered.
I introduced what Dynamic ARP Inspection is. It’s a switch security feature similar to DHCP snooping that inspects ARP messages and then decides to forward or drop the message.
I introduced how it works and what attacks it prevents, primarily ARP poisoning which can be used to perform a man-in-the-middle attack.
I also showed you how to configure DAI, while covering various details about its operations. Honestly, in this video I probably gave you more information about DAI than you need to know for the CCNA, but I’d rather give you more information than not enough.
Make sure to watch until the end of the quiz for a bonus question from Boson Software’s ExSim for CCNA, my recommended practice exams for the CCNA. Okay, let’s go to quiz question 1.
You issue the IP ARP INSPECTION VLAN 1 command on SW1. Which of the following statements is true about SW1 after issuing the command?
Pause the video now to select the correct answer. The answer is A, all interfaces in VLAN 1 are untrusted.
Just like in DHCP snooping, when DAI is first enabled all interfaces will be in an untrusted state by default. So, to trust specific ports you’ll have to configure them manually.
Okay, let’s go to question 2. The following commands are configured on SW1. Which of the following statements is true after the commands have been issued?
Pause the video now to select the best answer. Okay, the answer is C, DAI validation is only enabled for destination MAC addresses.
When configuring these optional DAI validation checks, to configure multiple checks you should configure them all in a single command. Otherwise, only the last command entered will take effect.
Okay, let’s go to question 3. Which of the following are true about DAI rate limiting? (select two).
Okay, pause the video now to select the two correct answers. Okay, the answers are B, it is enabled on untrusted ports by default, and D, it is enabled at a rate of 15 packets per second by default.
Unlike DHCP snooping rate limiting, for DAI rate limiting is enabled at a rate of 15 packets per second on all untrusted ports by default.
Another difference between DHCP snooping and DAI is that DAI allows you to configure a burst interval, so the rate limit can be calculated like 50 packets over three seconds, for example.
DHCP snooping only allows you to configure the packet rate per 1 second. Okay, let’s go to question 4. DAI inspects the sender IP and MAC addresses to determine whether an ARP packet should be forwarded or dropped.
Which of the following does it check the sender IP and MAC against? (select two). Pause the video now to select the two correct answers.
Okay, the answers are B, DHCP snooping binding table, and D, ARP ACLs. When DHCP snooping is enabled, the DHCP snooping binding table is automatically built as hosts lease IP addresses from DHCP servers.
So, DAI uses that table to check ARP messages. However, for hosts that don’t use DHCP, ARP ACLs can be manually configured to permit their ARP messages.
Okay, let’s go to question 5. Which of the following commands limit ARP messages to a maximum average of 15 per second?
(select two). Pause the video now to select the correct answers. Okay, the answers are A, IP ARP INSPECTION LIMIT RATE 15 and C, IP ARP INSPECTION LIMIT RATE 45 BURST INTERVAL 3.
Both of them will limit ARP messages received on the interface to an average of 15 per second. However, 45 packets over three seconds allows for short bursts of a higher rate, for example 30 packets in 1 second, 10 packets the next second, and then 0 packets the second
after that. However the 15 packets over 1 second setting monitors each second and strictly makes sure the rate never goes over 15. Okay, that’s all for the quiz.
Now let’s take a look at a bonus question in Boson Software’s ExSim for CCNA.