
让我们在实践中检查Windows Active Directory + NPS(2个用于容错的服务器)+ 802.1x标准对用户(域计算机)和设备的访问控制和身份验证的使用。 您可以通过以下链接来了解Wikipedia中的标准理论:
由于我的“实验室”资源有限,因此NPS和域控制器的角色是兼容的,但是我建议您共享此类关键服务。
我不知道同步Windows NPS配置(策略)的标准方法,因此我们将使用任务计划程序(作者是我的前同事)启动的PowerShell脚本。 要对域计算机和不知道如何使用
802.1x的设备 (电话,打印机等)进行身份验证,将配置组策略并创建安全组。
在本文的结尾,我将讨论使用802.1x的一些复杂问题-如何使用非托管交换机,动态ACL等。我将分享有关捕获到的“故障”的信息...
让我们首先在Windows Server 2012R2上安装和配置故障转移NPS(2016年的一切都相同):通过服务器管理器->添加角色和功能向导,仅选择网络策略服务器。

或使用PowerShell:
Install-WindowsFeature NPAS -IncludeManagementTools
简要说明一下-由于对于受保护EAP(PEAP),您肯定需要确认服务器真实性的证书(具有适当的使用权),该证书将在客户端计算机上被信任,因此您很可能需要安装证书颁发机构角色。 但是,假设您已经安装了CA ...
我们将在第二台服务器上执行相同的操作。 在两个服务器上为C:\ Scripts脚本创建一个文件夹,在第二个服务器上创建一个网络文件夹
\\ SRV2 \ NPS-config $在第一台服务器上,创建具有以下内容的PowerShell脚本
C:\ Scripts \ Export-NPS-config.ps1 :
Export-NpsConfiguration -Path "\\SRV2\NPS-config$\NPS.xml"
之后,在Task Sheduler中配置任务:“
Export-NpsConfiguration ”
powershell -executionpolicy unrestricted -f "C:\Scripts\Export-NPS-config.ps1"
为所有用户执行-以最高权限运行
每天-每10分钟重复一次任务。 8小时内在备用NPS上,配置导入(策略):
创建一个PowerShell脚本:
echo Import-NpsConfiguration -Path "c:\NPS-config\NPS.xml" >> C:\Scripts\Import-NPS-config.ps1
以及每10分钟执行一次的任务:
powershell -executionpolicy unrestricted -f "C:\Scripts\Import-NPS-config.ps1"
为所有用户执行-以最高权限运行
每天-每10分钟重复一次任务。 8小时内现在,为进行验证,在其中一台服务器(!)上的NPS中将几个交换机添加到RADIUS客户端(IP和共享密钥),两个连接请求策略:
WIRED-Connect (条件:“ NAS端口类型-以太网”)和
WiFi -Enterprise (条件:“ NAS端口类型为IEEE 802.11”)以及
访问网络网络设备 (网络管理员)网络策略:
: Windows - domain\sg-network-admins : - (PAP, SPAP) : RADIUS: - Service-Type - Login - Cisco-AV-Pair - Cisco - shell:priv-lvl=15
从开关的侧面进行以下设置: aaa new-model aaa local authentication attempts max-fail 5 ! ! aaa group server radius NPS server-private 192.168.38.151 auth-port 1812 acct-port 1813 key %shared_secret% server-private 192.168.10.151 auth-port 1812 acct-port 1813 key %shared_secret% ! aaa authentication login default group NPS local aaa authentication dot1x default group NPS aaa authorization console aaa authorization exec default group NPS local if-authenticated aaa authorization network default group NPS ! aaa session-id common ! identity profile default ! dot1x system-auth-control ! ! line vty 0 4 exec-timeout 5 0 transport input ssh escape-character 99 line vty 5 15 exec-timeout 5 0 logging synchronous transport input ssh escape-character 99
配置完成后,在10分钟后,所有客户端\策略\设置都应出现在备份NPS上,我们将能够使用ActiveDirectory帐户登录到交换机,该帐户是domain \ sg-network-admins组(我们预先创建)的成员。
让我们继续设置Active Directory-创建一个组和密码策略,创建必要的组。
组策略
计算机-8021x设置 :
Computer Configuration (Enabled) Policies Windows Settings Security Settings System Services Wired AutoConfig (Startup Mode: Automatic) Wired Network (802.3) Policies
NPS-802-1x Name NPS-802-1x Description 802.1x Global Settings SETTING VALUE Use Windows wired LAN network services for clients Enabled Shared user credentials for network authentication Enabled Network Profile Security Settings Enable use of IEEE 802.1X authentication for network access Enabled Enforce use of IEEE 802.1X authentication for network access Disabled IEEE 802.1X Settings Computer Authentication Computer only Maximum Authentication Failures 10 Maximum EAPOL-Start Messages Sent Held Period (seconds) Start Period (seconds) Authentication Period (seconds) Network Authentication Method Properties Authentication method Protected EAP (PEAP) Validate server certificate Enabled Connect to these servers Do not prompt user to authorize new servers or trusted certification authorities Disabled Enable fast reconnect Enabled Disconnect if server does not present cryptobinding TLV Disabled Enforce network access protection Disabled Authentication Method Configuration Authentication method Secured password (EAP-MSCHAP v2) Automatically use my Windows logon name and password(and domain if any) Enabled

创建一个安全组
sg-computers-8021x-vl100 ,在其中将要分发的计算机添加到vlan 100并为该组先前创建的组策略配置过滤:

您可以通过打开“网络和共享中心(网络和Internet设置)-更改适配器设置(配置适配器设置)-适配器属性”来验证该策略是否已成功实施,在此处可以看到“身份验证”标签:

当您确信该策略已成功应用后,可以继续在NPS上配置网络策略并访问交换机端口。
创建网络策略
neag-computers-8021x-vl100 :
Conditions: Windows Groups - sg-computers-8021x-vl100 NAS Port Type - Ethernet Constraints: Authentication Methods - Microsoft: Protected EAP (PEAP) - Unencrypted authentication (PAP, SPAP) NAS Port Type - Ethernet Settings: Standard: Framed-MTU 1344 TunnelMediumType 802 (includes all 802 media plus Ethernet canonical format) TunnelPrivateGroupId 100 TunnelType Virtual LANs (VLAN)

交换机端口的典型设置(我注意到身份验证类型为“多域”-数据和语音,并且还可以通过mac地址进行身份验证。对于“过渡时间”,使用以下参数是有意义的:
authentication event fail action authorize vlan 100 authentication event no-response action authorize vlan 100
输入的ID不是“隔离区”,而是用户计算机在成功登录后应该获得的ID,直到我们确保一切正常为止。 可以在其他情况下使用相同的参数,例如,当非管理型交换机插入该端口并且您希望所有连接到该端口且未经身份验证的设备都落入某个VLAN(“隔离区”)时,可以使用相同的参数。
802.1x主机模式多域中的交换机端口设置 default int range Gi1/0/39-41 int range Gi1/0/39-41 shu des PC-IPhone_802.1x switchport mode access switchport nonegotiate switchport voice vlan 55 switchport port-security maximum 2 authentication event fail action authorize vlan 100 authentication event no-response action authorize vlan 100 authentication host-mode multi-domain authentication port-control auto authentication violation restrict mab dot1x pae authenticator dot1x timeout quiet-period 15 dot1x timeout tx-period 3 storm-control broadcast level pps 100 storm-control multicast level pps 110 no vtp lldp receive lldp transmit spanning-tree portfast no shu exit
您可以使用以下命令验证计算机/电话是否已成功验证:
sh authentication sessions int Gi1/0/39 det
现在,在Active Directory中为电话创建一个组(例如
sg-fgpp-mab ),然后向其中添加一个测试设备(在我的情况下,这是
Grandstream GXP2160 ,其质量地址为
000b.82ba.a7b1 ,并且对应的帐户
域\ 000b82baa7b1 ) 。
对于创建的组,我们将使用以下“
Password-Settings-for-MAB”参数降低密码策略要求(通过Active Directory管理中心->域->系统->密码设置容器使用
细粒度密码策略 ):

从而允许我们使用设备的地址作为密码。 之后,我们可以为802.1x方法mab身份验证创建网络策略,我们将其称为neag-devices-8021x-voice。 参数如下:
- NAS端口类型-以太网
- Windows组-sg-fgpp-mab
- EAP类型:未加密身份验证(PAP,SPAP)
- RADIUS属性-供应商特定:Cisco-Cisco-AV-Pair-属性值:device-traffic-class = voice
成功认证后(不要忘记配置交换机端口),请参阅以下端口信息:
sh身份验证se int Gi1 / 0/34 ---------------------------------------- Interface: GigabitEthernet1/0/34 MAC Address: 000b.82ba.a7b1 IP Address: 172.29.31.89 User-Name: 000b82baa7b1 Status: Authz Success Domain: VOICE Oper host mode: multi-domain Oper control dir: both Authorized By: Authentication Server Session timeout: N/A Idle timeout: N/A Common Session ID: 0000000000000EB2000B8C5E Acct Session ID: 0x00000134 Handle: 0xCE000EB3 Runnable methods list: Method State dot1x Failed over mab Authc Success
现在,按照承诺,考虑几个不太明显的情况。 例如,我们需要通过非托管交换机(交换机)连接用户的计算机\设备。 在这种情况下,其端口设置将如下所示:
802.1x主机模式多认证模式下的交换机端口设置 interface GigabitEthernet1/0/1 description *SW – 802.1x – 8 mac* shu switchport mode access switchport nonegotiate switchport voice vlan 55 switchport port-security maximum 8 ! - - authentication event fail action authorize vlan 100 authentication event no-response action authorize vlan 100 authentication host-mode multi-auth ! – authentication port-control auto authentication violation restrict mab dot1x pae authenticator dot1x timeout quiet-period 15 dot1x timeout tx-period 3 storm-control broadcast level pps 100 storm-control multicast level pps 110 no vtp spanning-tree portfast no shu
PS注意到一个非常奇怪的故障-如果设备是通过这样的开关连接的,然后被卡在受管理的开关中,则直到我们重新启动(!)开关后,它才起作用,直到我找到解决该问题的其他方法为止。
与DHCP有关的另一点(如果使用ip dhcp snooping)-没有此类选项:
ip dhcp snooping vlan 1-100 no ip dhcp snooping information option
由于某些原因,无法正确接收IP地址...尽管这可能是我们DHCP服务器的功能
而且,即使配置了按批量地址进行身份验证,Mac OS和Linux(本地支持802.1x)也尝试与用户进行身份验证。
在本文的下一部分中,我们将考虑对无线使用802.1x(取决于用户帐户所在的组,尽管它们将连接到相同的SSID,但我们会将其“拖放”到相应的网络(vlan)中)。