使用终端的MAC地址进行基于端口的访问控制,可以根据连接到NAS设备的MAC地址进行动态的启用或者禁用MAB的端口。

MAB 特性

  1. 可见性
  2. 基于身份的服务
  3. 边缘访问控制
  4. 后背的身份验证,可以在不支持802.1X的设备中进行认证
  5. MAC数据库
  6. 延迟:当802.1X的回退机制时,可以使用MAB认证减少对用于体验产生负面影响
  7. 无用户身份验证
  8. 身份验证强度不够高,可以使用MAC地址欺骗来破坏MAB

MAB 认证前后对比

MAC 身份认证旁路 (MAB) - 图1

在MAB之前,端点的身份未知,所有流量都被阻止。交换机检查单个数据包以了解和验证源MAC地址。在MAB成功之后,端点的身份已知,并且允许来自该端点的所有流量。交换机执行源MAC地址过滤,以帮助确保仅允许经过MAB认证的端点发送流量。

High-Level MAB Sequence

MAC 身份认证旁路 (MAB) - 图2

  1. 从交换机的角度看,当交换机检测到端口上链路连接时,认证会话就开始了,交换机将通过向终端发送EAP请求标识来启动身份认证,如果交换机没有收到相应,则定时重发请求,在最大次数之后未收到相应则交换机采用MAB进行认证。
  2. 在MAC地址学习阶段,交换机通过打开端口接受单个数据包开始进行MAB认证,从中学习终端的MAC地址。在回退到MAB之前收到的终端发来的数据包全部丢弃,不用于学习MAC地址。
    1. 交换机可以用任何2、3层协议来学习MAC地址,CDP、LLDP、DTP等
    2. 交换机获得源MAC地址之后,丢弃该数据包,然后交换机创建Radius访问请求,发送到服务器上。

MAC 身份认证旁路 (MAB) - 图3

MAC Address Formats in RADIUS Attributes

RADIUS Attribute Format Example
1 (Username) 12 hexadecimal digits, all lowercase, and no punctuation 0018f809cfd7
2 (Password) Same as the username but encrypted \xf2\xb8\x9c\x9c\x13\xdd#,\xcaT\xa1\xcay=&\xee
31(Calling-Station-Id) 6 groups of 2 hexadecimal digits, all uppercase, and separated by hyphens 00-18-F8-09-CF-D7

Cisco 交换机通过将MAB访问请求消息中的属性6(服务类型)设置为10(Call-Check)来确保识别时MAB Access-Request 消息。

  • 如果MAC地址合法,Radius服务器将返回Radius Access-Accept消息。此消息将向交换机指示允许终端访问。也可以进行下发ACL。
  • 如果MAC地址无效,Radius服务器将返回 Radius Access-Reject message.
    • 如果交换机配置了其他的认证方式,交换机将可能尝试其他认证方式
    • 如果交换机没有其他认证方式,交换机将在一定时间内重启端口,重新认证。直至断开连接或者认证通过。

IEEE 802.1X 回退机制

MAC 身份认证旁路 (MAB) - 图4

Web 身份认证

MAC 身份认证旁路 (MAB) - 图5

访客VLAN

MAC 身份认证旁路 (MAB) - 图6

Single-Host Mode

In single-host mode, only a single MAC or IP address can be authenticated (by any method) on a port. If a different MAC address is detected on the port after a endpoint has authenticated with MAB, then a security violation will be triggered on the port. This is the default behavior.

Multidomain Authentication Host Mode

Multidomain authentication was specifically designed to address the requirements of IP telephony. When multidomain authentication is configured, two endpoints are allowed on the port: one in the voice VLAN and one in the data VLAN. Either, both, or none of the endpoints can be authenticated with MAB. Additional MAC addresses will trigger a security violation.

Multi-Authentication Host Mode

If the port is configured for multi-authentication (multi-auth) host mode, then multiple endpoints can be authenticated in the data VLAN. Each new MAC address that appears on the port will be separately authenticated. Any, all, or none of the endpoints can be authenticated with MAB. Multi-auth host mode can be used for bridged virtual environments or to support hubs.

Multihost Mode

Unlike multi-auth host mode, which authenticates every MAC address, multihost mode authenticates the first MAC address and then allows an unlimited number of other MAC addresses. Because of the security implications of multihost mode, multi-auth host mode typically is a better choice than multihost mode.

Example

  1. aaa new-model
  2. aaa authentication dot1x default group radius
  3. aaa authorization network default group radius
  4. aaa accounting dot1x default start-stop group radius
  5. # 即使只使用MAB认证,也需要配置dot1x相关内容
  6. !
  7. interface FastEthernet2/48
  8. switchport access vlan 40
  9. switchport mode access
  10. authentication port-control auto
  11. mab
  12. spanning-tree portfast
  13. spanning-tree bpduguard enable
  14. !
  15. radius-server host 10.200.1.52 key cisco123