Hands-On Lab: Configuring MAC Authentication Bypass (MAB)

This hands-on lab configures MAC Authentication Bypass as a fallback authentication method on an 802.1X-enabled port, allowing a device incapable of 802.1X (such as a printer) to still gain network access based on its MAC address after the 802.1X exchange times out.

MAB Configuration802.1X Fallback MethodNon-Supplicant Device Access

~3 دقیقه مطالعه · آخرین به‌روزرسانی ۴ مهر ۱۴۰۵

Lab Objective

Configure MAB as a fallback authentication method on a port already requiring 802.1X, pre-authorize a specific device's MAC address on the RADIUS server, and verify that device gains network access via MAB after 802.1X times out, while a genuinely unknown device remains blocked.

Lab Purpose

802.1X, configured in the previous lab, requires supplicant software the connecting device must actually run — many devices like printers, IP cameras, and older equipment have no 802.1X capability at all. MAB provides a fallback specifically for these devices, using the device's MAC address as a (much weaker) form of identity when no 802.1X supplicant responds.

Lab Topology

Switch1 ---- Gi1/0/9 ---- Printer1 (no 802.1X
                          capability, MAC:
                          00aa.bb00.7777)

RADIUS server: 192.168.250.100, with
00aa.bb00.7777 pre-authorized as a known
device for MAB

Task 1: Configure the Port for 802.1X with MAB as Fallback

Configure Gi1/0/9 with 802.1X authentication and enable MAB as the fallback method.

Task 2: Connect Printer1 and Observe the 802.1X Timeout

Connect the printer and observe that no EAPOL response occurs, since it has no 802.1X supplicant.

Task 3: Verify MAB Takes Over After the Timeout

Confirm the switch falls back to MAB, sending the printer's MAC address to RADIUS for authentication.

Task 4: Verify Printer1 Gains Access

Confirm the port authorizes and the printer can communicate on the network.

Task 5: Verify an Unrecognized Device Is Still Blocked

Connect a different device with an unregistered MAC address and confirm MAB also fails to authorize it.

Solution and Verification

Switch1(config)# interface gigabitethernet1/0/9
Switch1(config-if)# switchport mode access
Switch1(config-if)# authentication port-control auto
Switch1(config-if)# dot1x pae authenticator
Switch1(config-if)# mab

-- "mab" adds MAC Authentication Bypass as
-- a fallback -- 802.1X is still attempted
-- first, with MAB only engaging after it
-- times out

-- Printer1 connected, no EAPOL response
-- sent since it has no 802.1X supplicant

Switch1# show authentication sessions interface gigabitethernet1/0/9

Interface  MAC Address       Method  Status
Gi1/0/9    00aa.bb00.7777    N/A     Running
-- Initially "Running" while 802.1X is
-- still being attempted

-- After the dot1x timeout period elapses:

Switch1# show authentication sessions interface gigabitethernet1/0/9

Interface  MAC Address       Method  Status
Gi1/0/9    00aa.bb00.7777    mab     Authz Success
-- The switch fell back to MAB, sending
-- 00aa.bb00.7777 to RADIUS as the
-- "username" for authentication -- since
-- this MAC was pre-authorized, RADIUS
-- returned Access-Accept

Printer1> [prints a test page over the network]
-- Confirmed working, print job completed
-- successfully

-- Unregistered device connected to a
-- similarly configured port:

Switch1# show authentication sessions interface gigabitethernet1/0/10

Interface  MAC Address       Method  Status
Gi1/0/10   00aa.bb00.8888    mab     Authz Failed
-- RADIUS returned Access-Reject for this
-- unregistered MAC -- MAB fails just as
-- 802.1X would for invalid credentials

Key Takeaway

MAB is deliberately a fallback, never a primary method, on a port configured with both: 802.1X is always attempted first, and MAB only engages after the 802.1X exchange genuinely times out with no supplicant response — this ordering ensures a device actually capable of proper 802.1X authentication always uses the stronger method, while MAB's inherently weaker MAC-based verification is reserved specifically for devices with no other option.

نوشته و پژوهش‌شده توسط دکتر شاهین صیامی

مقالات مرتبط

Hands-On Lab: Final Comprehensive CCNP Troubleshooting Challenge (BGP, DMVPN, and QoS Integration)

This hands-on lab presents a complex multi-layer failure across an integrated BGP-over-DMVPN topology combined with QoS marking, requiring systematic diagnosis of a route reflector misconfiguration, an NHRP registration failure, and an incorrectly applied QoS policy simultaneously affecting the same network.

ادامه

Hands-On Lab: Configuring BGP over DMVPN

This hands-on lab runs iBGP as the routing protocol across the same DMVPN hub-and-spoke topology used in the two previous labs, configuring the hub as a route reflector so spokes learn each other's routes without a full iBGP mesh, combining two previously separate concepts into one integrated design.

ادامه

Hands-On Lab: Configuring OSPF over DMVPN

This hands-on lab runs OSPF as the dynamic routing protocol across the same DMVPN hub-and-spoke topology, configuring the tunnel interface as an OSPF point-to-multipoint network type to correctly handle the hub-and-spoke adjacency pattern without requiring the broadcast network type's DR/BDR election.

ادامه

Hands-On Lab: Configuring EIGRP over DMVPN

This hands-on lab runs EIGRP as the dynamic routing protocol across the DMVPN hub-and-spoke topology built in earlier labs, verifying neighbor relationships form correctly across the multipoint tunnel and routes propagate without requiring per-spoke static configuration on the hub.

ادامه

Hands-On Lab: Configuring HSRP MD5 Authentication

This hands-on lab configures MD5 authentication on an HSRP group, verifying two routers with matching authentication strings form a normal active/standby relationship while a router with a mismatched string is excluded from the group entirely.

ادامه

Hands-On Lab: Configuring Cisco Umbrella-Style DNS Security via DNS Forwarding Redirection

This hands-on lab configures a router to redirect all client DNS queries toward a security-focused DNS resolver using DNS forwarding interception, approximating cloud-delivered DNS security enforcement without requiring per-client configuration changes.

ادامه