Layer 2 (L2) security focuses on protecting the data link layer (Layer 2) of the OSI model, which is responsible for delivering frames across a local network. Without proper safeguards, L2 vulnerabilities can be exploited, leading to attacks like MAC spoofing, ARP poisoning, and VLAN hopping. Juniper SRX devices offer comprehensive L2 security features to mitigate these threats.
Enable transparent mode:
set security forwarding-options family ethernet-switching mode transparent
Assign interfaces to Ethernet switching:
set interfaces ge-0/0/1 unit 0 family ethernet-switching
Set a MAC address limit:
set ethernet-switching-options secure-access-port interface ge-0/0/1 mac-limit 5
Enable DAI:
set ethernet-switching-options secure-access-port interface ge-0/0/1 arp-inspection
Enable DHCP snooping:
set ethernet-switching-options dhcp-snooping vlan vlan-id
Enable MACsec:
set ethernet-switching-options secure-interface ge-0/0/1 macsec enable
Transparent mode makes the SRX device invisible to Layer 3 traffic while still enforcing security policies.
Steps:
Enable transparent mode:
set security forwarding-options family ethernet-switching mode transparent
Configure security policies for traffic:
set security policies from-zone trust to-zone untrust policy allow-http match application junos-http
set security policies from-zone trust to-zone untrust policy allow-http then permit
set ethernet-switching-options secure-access-port interface ge-0/0/1 mac-limit 5
set ethernet-switching-options secure-access-port interface ge-0/0/1 arp-inspection
set ethernet-switching-options secure-interface ge-0/0/1 macsec enable
If traffic isn’t flowing as expected, analyze packets on the interface:
monitor traffic interface ge-0/0/1
Look for dropped frames or incorrectly tagged VLAN traffic.
Check logs for MACsec or DAI-related events:
show log messages | match "security"
Validate the MAC addresses learned on the switch:
show ethernet-switching table
MACsec is a key feature for securing Ethernet links at Layer 2 by providing encryption and integrity checks. However, support is hardware-dependent.
Important Clarification:
Note: MACsec is supported only on select high-end SRX platforms (such as the SRX5000 series) and only on specific physical interfaces that support MACsec at the hardware level. It is not universally available across all interfaces or models.
Expect questions like:
“Which platforms support MACsec?”
“Can MACsec be enabled on all SRX interfaces?”
To avoid incorrect assumptions, memorize the hardware requirement constraint.
show security macsec statistics
Transparent mode allows the SRX to act as a Layer 2 bridge, but this comes with critical limitations on Layer 3 services.
Important Clarification:
In transparent mode, Layer 3 services such as NAT, dynamic routing protocols, and IP-based security policies are not supported.
Instead, traffic forwarding must be configured through bridge-domains, and security policies are applied based on interface zones and applications—not on IP subnets.
Questions may ask:
“Can SRX perform NAT in transparent mode?” → No
“Are routing instances supported?” → No
“Can security policies match source/destination IP?” → Not in the traditional sense; policy matches are zone-based.
set security forwarding-options family ethernet-switching mode transparent
DHCP Snooping is designed to block rogue DHCP servers on untrusted ports. By default, all interfaces are untrusted, and DHCP responses will be dropped unless a port is explicitly marked as trusted.
Trust Port Configuration Example:
set ethernet-switching-options dhcp-snooping trusted interface ge-0/0/0
DHCP offers/acks from untrusted ports are dropped.
Binding tables are created from DHCP discover/request messages seen on trusted ports.
DHCP snooping works in tandem with Dynamic ARP Inspection (DAI).
While Juniper SRX is not a full Layer 2 switch, when operating in Ethernet switching (bridge) mode, it supports selected L2 security features found in traditional switches.
Important Additions:
Additional L2 protections such as BPDU Guard and Root Guard may be supported when the SRX operates in switching mode. These features enhance security by preventing Layer 2 attacks such as STP manipulation or rogue switch introduction.
BPDU Guard: Blocks BPDUs on ports where they should not appear (e.g., access ports), protecting the STP topology.
Root Guard: Prevents a port from becoming root if a superior BPDU is received from an unauthorized source.
These may appear as multi-select options in security-related scenarios:
| Objective | Command | Purpose |
|---|---|---|
| View learned MAC addresses | show ethernet-switching table |
Displays MAC-to-port mappings (L2 forwarding table) |
| Check MAC limiting configuration | show configuration ethernet-switching-options secure-access-port |
Verifies per-interface MAC limit rules |
| Inspect DAI or DHCP Snooping bindings | show arp inspection or show dhcp snooping binding |
Shows dynamic bindings of IP/MAC for L2 inspection |
| View MACsec encryption statistics | show security macsec statistics |
Displays encryption/decryption and integrity status |
| Monitor live L2 traffic | monitor traffic interface <interface> |
Captures live packets for Layer 2 interfaces |
MACsec → High-end SRX only + hardware-required
Transparent mode → No NAT / No routing / Requires bridge-domain
DHCP snooping → Trust interfaces explicitly required
BPDU/Root Guard → Supported in switching mode only
Use secure-access-port config for MAC limiting, ARP inspection, DHCP filtering
What is the primary purpose of DHCP snooping on a Juniper device?
DHCP snooping prevents rogue DHCP servers from assigning unauthorized IP addresses.
DHCP snooping monitors DHCP traffic on Layer-2 networks and builds a binding table of valid IP-to-MAC assignments. Ports are designated as trusted or untrusted. DHCP server responses are only accepted from trusted ports, while responses from untrusted ports are dropped. This mechanism protects the network from malicious devices attempting to distribute incorrect gateway or DNS information to clients.
Demand Score: 85
Exam Relevance Score: 91
How does Dynamic ARP Inspection (DAI) help secure a Layer-2 network?
DAI prevents ARP spoofing by validating ARP packets against trusted IP-MAC bindings.
Dynamic ARP Inspection verifies ARP packets using the DHCP snooping binding table or other trusted sources. When a device sends an ARP response, the switch checks whether the MAC and IP address combination matches the known binding information. If the values do not match, the packet is dropped. This prevents attackers from redirecting traffic by impersonating other hosts on the network.
Demand Score: 82
Exam Relevance Score: 90
Why must uplink interfaces often be configured as trusted ports in DHCP snooping?
Trusted ports allow legitimate DHCP server responses to pass through the interface.
DHCP snooping blocks DHCP server messages received on untrusted ports. If an uplink interface connected to a legitimate DHCP server is not marked as trusted, the device will drop the server’s responses, preventing clients from obtaining addresses. Configuring the correct trust state ensures that only authorized DHCP servers are permitted while still protecting access ports.
Demand Score: 79
Exam Relevance Score: 88
What information is stored in the DHCP snooping binding table?
The table stores IP addresses, MAC addresses, VLAN IDs, and interface information.
The DHCP snooping binding table records the association between a client’s MAC address and the IP address assigned by the DHCP server. It also tracks the VLAN and interface through which the client connected. This information is used by other security mechanisms such as Dynamic ARP Inspection to validate network traffic.
Demand Score: 77
Exam Relevance Score: 87