简介
本文档介绍如何为单主机和多域方案配置基于身份的网络服务2.0 (IBNS)。
先决条件
要求
Cisco 建议您了解以下主题:
- 局域网可扩展身份验证协议(EAPoL)
- Radius协议
- 思科身份服务引擎版本2.0
使用的组件
本文档中的信息基于以下软件和硬件版本:
- 思科身份服务引擎版本2.0补丁2
- 使用Windows 7操作系统的终端
- 思科交换机3750X,带Cisco IOS® 15.2(4)E1
- 思科交换机3850,带03.02.03.SE
- Cisco IP 电话 9971
本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您的网络处于活动状态,请确保您了解所有命令的潜在影响。
配置
配置理论
要启用IBNS 2.0,您需要在Cisco交换机的特权模式下执行命令:
#authentication display new-style
使用如下所示的命令配置IBNS 2.0的交换机端口:
access-session host-mode {single-host | multi-domain | multi-auth | multi-host}
access-session port-control auto
dot1x pae authenticator
{mab}
service-policy type control subscriber TEST
这些命令在接口上启用dot1x身份验证,或者启用MAC身份验证绕行(MAB)。使用新语法时,使用的命令以access-session开头。这些命令的用途与使用旧语法的命令(以authentication关键字开头)的用途相同。应用服务策略以指定可用于接口的策略映射。
所述的策略映射定义了身份验证期间交换机(身份验证器)的行为。例如,您可以指定身份验证失败时会发生的情况。对于每个事件,可以根据在其下配置的类映射中匹配的事件类型配置多个操作。例如,查看如下所示的列表(policy-map TEST4)。如果连接到应用此策略的接口的dot1x终端发生故障,则会执行DOT1X_FAILED中定义的操作。如果要为MAB_FAILED和DOT1X_FAILED等类指定相同的行为,则可以使用默认类- class-map always。
policy-map type control subscriber TEST4
(...)
event authentication-failure match-first
10 class DOT1X_FAILED do-until-failure
10 terminate dot1x
(...)
40 class always do-until-failure
10 terminate mab
20 terminate dot1x
30 authentication-restart 60
(...)
用于IBNS 2.0的策略映射必须始终具有类型控制用户。
您可以按以下方式查看可用事件的列表:
Switch(config-event-control-policymap)#event ?
aaa-available aaa-available event
absolute-timeout absolute timeout event
agent-found agent found event
authentication-failure authentication failure event
authentication-success authentication success event
authorization-failure authorization failure event
authorization-success authorization success event
identity-update identity update event
inactivity-timeout inactivity timeout event
remote-authentication-failure authentication failure event
remote-authentication-success authentication remote success event
remote-update update from remote device
session-disconnected session disconnected event
session-started session started event
tag-added tag to apply event
tag-removed tag to remove event
template-activated template activated event
template-activation-failed template activation failed event
template-deactivated template deactivated event
template-deactivation-failed template deactivation failed event
timer-expiry timer-expiry event
violation session violation event
在事件配置中,您可以定义如何评估类:
Switch(config-event-control-policymap)#event authentication-failure ?
match-all Evaluate all the classes
match-first Evaluate the first class
您可以为类映射定义类似的选项,但您可以在此处指定在类匹配的情况下如何执行操作:
Switch(config-class-control-policymap)#10 class always ?
do-all Execute all the actions
do-until-failure Execute actions until one of them fails
do-until-success Execute actions until one of them is successful
新式dot1x配置的最后一部分(可选)是class-map。 它还可以键入控制用户,用于匹配特定行为或流量。配置类映射条件评估的要求。您可以指定必须匹配所有条件,或者必须匹配任何条件,或者不匹配任何条件。
Switch(config)#class-map type control subscriber ?
match-all TRUE if everything matches in the class-map
match-any TRUE if anything matches in the class-map
match-none TRUE if nothing matches in the class-map
以下是用于匹配dot1x身份验证失败的类映射示例:
class-map type control subscriber match-all DOT1X_FAILED
match method dot1x
match result-type method dot1x authoritative
对于某些情况(主要是使用服务模板时),您需要添加授权更改(CoA)的配置:
aaa server radius dynamic-author
client 10.48.17.232 server-key cisco
单主机方案
网络图
配置
在带有Cisco IOS 15.2(4)E1的Catalyst 3750X上测试的单主机方案所需的基本802.1X配置。使用Windows本地请求方和Cisco AnyConnect测试的方案。
aaa new-model
!
aaa group server radius tests
server name RAD-1
!
aaa authentication dot1x default group tests
aaa authorization network default group tests
!
dot1x system-auth-control
!
policy-map type control subscriber TEST
event session-started match-all
10 class always do-until-failure
10 authenticate using dot1x priority 10
!
interface GigabitEthernet1/0/21
switchport access vlan 613
switchport mode access
access-session host-mode single-host
access-session port-control auto
dot1x pae authenticator
service-policy type control subscriber TEST
!
radius server RAD-1
address ipv4 10.48.17.232 auth-port 1812 acct-port 1813
key cisco
多域方案
网络图
配置
由于IP电话(思科IP电话9971)的PoE(以太网供电)要求,在采用Cisco IOS 03.02.03.SE的Catalyst 3850上测试了多域方案。
aaa new-model
!
aaa group server radius tests
server name RAD-1
!
aaa authentication dot1x default group tests
aaa authorization network default group tests
!
aaa server radius dynamic-author
client 10.48.17.232 server-key cisco
!
dot1x system-auth-control
!
class-map type control subscriber match-all DOT1X
match method dot1x
!
class-map type control subscriber match-all DOT1X_FAILED
match method dot1x
match result-type method dot1x authoritative
!
class-map type control subscriber match-all DOT1X_NO_RESP
match method dot1x
match result-type method dot1x agent-not-found
!
class-map type control subscriber match-all MAB
match method mab
!
class-map type control subscriber match-all MAB_FAILED
match method mab
match result-type method mab authoritative
!
policy-map type control subscriber TEST4
event session-started match-all
10 class always do-until-failure
10 authenticate using dot1x priority 10
20 authenticate using mab priority 20
event authentication-failure match-first
10 class DOT1X_FAILED do-until-failure
10 terminate dot1x
20 class MAB_FAILED do-until-failure
10 terminate mab
20 authenticate using dot1x priority 10
30 class DOT1X_NO_RESP do-until-failure
10 terminate dot1x
20 authentication-restart 60
40 class always do-until-failure
10 terminate mab
20 terminate dot1x
30 authentication-restart 60
event agent-found match-all
10 class always do-until-failure
10 terminate mab
20 authenticate using dot1x priority 10
event authentication-success match-all
10 class always do-until-failure
10 activate service-template DEFAULT_LINKSEC_POLICY_SHOULD_SECURE
!
interface GigabitEthernet1/0/1
switchport access vlan 613
switchport mode access
switchport voice vlan 612
access-session host-mode multi-domain
access-session port-control auto
mab
dot1x pae authenticator
spanning-tree portfast
service-policy type control subscriber TEST4
!
radius-server attribute 6 on-for-login-auth
radius-server attribute 8 include-in-access-req
radius-server attribute 25 access-request include
radius-server vsa send cisco-nas-port
!
radius server RAD-1
address ipv4 10.48.17.232 auth-port 1812 acct-port 1813
key cisco
验证
使用本部分可确认配置能否正常运行。
出于验证目的,使用此命令列出所有交换机端口的会话:
show access-session
您还可以从单个交换机端口查看有关会话的详细信息:
show access-session interface [Gi 1/0/1] {detail}
故障排除
本部分提供了可用于对配置进行故障排除的信息。
为了对802.1X相关问题进行故障排除,您可以启用调试(从Cisco IOS XE 16.3.2开始):
set platform software trace smd switch active R0 radius debug
set platform software trace smd switch active R0 dot1x-all debug
set platform software trace smd switch active R0 auth-mgr-all debug
set platform software trace smd switch active R0 epm-all debug
命令show platform software trace level smd switch active R0显示当前的活动调试。
要禁用调试,您可以使用undebug all或set platform software trace smd switch active R0 <sub-component> notice。
要显示生成的日志,可以使用命令:show platform software trace message smd switch active R0。
在旧版Cisco IOS中,您可以使用旧版命令启用调试:
debug mab all
debug dot1x all
debug pre all*
* 或者,对于debug pre,只能使用事件和/或规则将输出限制为IBNS 2.0相关信息。