OPNsenseI · Networking Foundations for Firewall AdministratorsLayer 2 and Layer 3 foundations
Ethernet, MAC and ARP — the Layer 2 the firewall operator must read
What you'll learn
- Describe an Ethernet frame and the role of MAC addresses
- Read an ARP table and explain why stale ARP entries matter
- Identify broadcast, multicast and unicast traffic on a segment
- Recognise the ARP failure modes that surface as firewall incidents
Prerequisites
None — start here.
Verified against OPNsense 25.x · FreeBSD 14.x · PF (FreeBSD packet filter) FreeBSD 14.x · Unbound 1.20+ · Kea DHCP OPNsense 25.x plugin · WireGuard in-kernel + OPNsense plugin · strongSwan (IPsec plugin) OPNsense 25.x plugin · OpenVPN 2.6.x · Suricata 7.x · 2026-08-14
Every firewall is, at the end of the day, a packet forwarder. The packet crosses a wire (or a fibre, or a virtual wire) as an Ethernet frame with a source MAC and a destination MAC. The firewall operator who can read that frame — or at least understand what is in it — diagnoses problems the operator who only knows the IP layer cannot.
This lesson covers what is on the wire, what MAC addresses are, how ARP maps an IP to a MAC, and why the ARP table on the firewall is sometimes the only place a Layer 2 incident is visible.
What is in an Ethernet frame?
An Ethernet frame carries a payload (almost always an IPv4 or IPv6 packet) between two MAC addresses on the same Layer 2 segment.
+----------+----------+----------+----------+----------+
| Preamble| Dest MAC | Src MAC | Ethertype| Payload | FCS
+----------+----------+----------+----------+----------+
| 8 bytes | 6 bytes | 6 bytes | 2 bytes | 46-1500 | 4
The ethertype tells the receiving host what is inside the frame.
0x0800 is IPv4, 0x86DD is IPv6, 0x0806 is ARP, 0x8100 is
802.1Q VLAN tagging.
The MAC address is 48 bits, usually written as six pairs of hex
digits separated by colons (aa:bb:cc:11:22:33). The first three
bytes identify the manufacturer (the OUI); the last three are the
device-unique portion. OPNsense’s interfaces each have a MAC,
assigned by the driver; the firewall also has MAC addresses for
its VLAN interfaces, CARP VIPs, and any bridges it owns.
Three kinds of Layer 2 traffic
| Traffic | MAC destination | IP destination (if any) | Reaches |
|---|---|---|---|
| Unicast | one specific MAC | one specific IP | one host on the segment |
| Broadcast | ff:ff:ff:ff:ff:ff | subnet broadcast (x.x.x.255 or 255.255.255.255) | every host on the segment |
| Multicast | 01:00:5e:… (IPv4) or 33:33:… (IPv6) | 224.0.0.0/4 (IPv4) or ff00::/8 (IPv6) | hosts that joined the group |
Most of what crosses a firewall segment is unicast. ARP requests are broadcast. CARP advertisements and OSPF hello packets are multicast. ND (Neighbor Discovery) and IPv6 router advertisements are multicast too — a fact that has HA consequences the HA part of the course covers.
How ARP maps IP to MAC
ARP turns “next-hop IP” into “next-hop MAC”. On a Linux/FreeBSD host:
192.0.2.50 → 192.0.2.1 (next hop) → aa:bb:cc:11:22:33 (real MAC)
If the host does not have an entry for 192.0.2.1 in its ARP table,
it broadcasts an ARP request:
"Who has 192.0.2.1? Tell 192.0.2.50."
The host that owns 192.0.2.1 replies:
"192.0.2.1 is at aa:bb:cc:11:22:33."
The requester stores the mapping in its ARP cache and uses it for
every subsequent frame sent to 192.0.2.1. Entries age out — on
FreeBSD the default is 20 minutes for a complete entry.
$ arp -an? (192.0.2.1) at aa:bb:cc:11:22:33 on igb0 expires in 1185 [ethernet]
? (192.0.2.50) at 66:77:88:99:aa:bb on igb0 expires in 1198 [ethernet]
? (192.0.2.255) at ff:ff:ff:ff:ff:ff on igb0 expires in 0 [ethernet]Illustrative output
Why the firewall cares about ARP
OPNsense itself maintains an ARP table for every directly-attached network. Three things break that table in production:
- An IP moves. A host’s IP is reassigned to a different host, or DHCP gives the same address to a different MAC, and the firewall continues to send frames to the old MAC until the entry ages out.
- ARP spoofing. A malicious host sends gratuitous ARP replies claiming to own someone else’s IP. Until the cache expires, the firewall will hand traffic to the attacker. (This is exactly what Dynamic ARP Inspection on a managed switch is designed to stop.)
- Asymmetric reachability. The firewall can ARP a host’s IP but cannot actually deliver frames to it because the host lives behind a different path than the firewall expects. The ARP entry will be present but packets to that host will silently fail.
In each case, the firewall’s PF state table will show traffic as “established” while the actual frame delivery fails. The firewall operator has to suspect the ARP table — not the firewall rule — to find the cause.
Reading a capture at Layer 2
A packet capture is the most direct way to see Layer 2.
$ tcpdump -nei igb0 arp12:34:56.789012 aa:bb:cc:11:22:33 > ff:ff:ff:ff:ff:ff, ARP, Request who-has 192.0.2.1 tell 192.0.2.50, length 28
12:34:56.789345 66:77:88:99:aa:bb > aa:bb:cc:11:22:33, ARP, Reply 192.0.2.1 is-at 66:77:88:99:aa:bb, length 28Illustrative output
The first frame is a broadcast ARP request; every host on the segment sees it. The second is the unicast reply. If the reply never arrives, the firewall cannot send frames to that IP — and that looks, from above, like the firewall is dropping traffic.
Summary
- Frames carry MAC addresses, not IPs. The firewall kernel does the Layer 2 work; PF sees the resulting IP packet.
- ARP maps IP to MAC and ages out. Stale ARP is one of the most common silent failure modes.
- Multicast matters for HA: CARP and OSPF need a Layer 2 segment that carries multicast between peers.
- The firewall operator reads
arp -anandtcpdump -neito see Layer 2 evidence.
Knowledge check · 3 questions
Q1. A host on the LAN reports it can ping its gateway IP but not reach the Internet. The OPNsense firewall's ARP table shows the host's MAC with a fresh timestamp. Where is the most likely fault?
Q2. PF can directly inspect the Ethernet frame header to decide whether a frame matches a state.
Q3. Which of the following are reasons an OPNsense firewall operator might need to inspect ARP? Select all that apply.
Passing score: 75%. Answers are checked in this browser.