
Accounting ARP packets works in a similar way. Note that you must create a MAC ACL, specify packet type 0806 for ARP, and match on the source and destination MAC addresses of the packet.
As shown in the figure above, Server 1 sends a broadcast ARP request to the gateway, and the gateway answers Server 1 with a unicast ARP reply.
To count the broadcast ARP requests on the intermediate switch SW1, create a MAC ACL that matches packets of type 0806 whose source MAC address is 0001-0001-0001.
Step 1: Define a MAC ACL that matches ARP traffic in one direction (an ARP Request packet in this example)
acl mac 4000
rule 0 permit type 0806 ffff source-mac 0001-0001-0001 ffff-ffff-ffff
Step 2: Define a class that matches the ACL, plus the accounting action
traffic classifier classifier_1
if-match acl 4000
traffic behavior behavior_1
accounting packet
Step 3: Define a QoS policy that associates the class and the action
qos policy policy_1
classifier classifier_1 behavior behavior_1
Step 4: Apply the QoS policy to the right interface and direction
interface GigabitEthernet 1/0/1
qos apply policy policy_1 inbound
interface GigabitEthernet 1/0/2
qos apply policy policy_1 outbound
Need to pay attention to where the traffic is going.