使用故障转移 NPS 在 Cisco 交换机上配置 802.1X(带 AD 的 Windows RADIUS)

使用故障转移 NPS 在 Cisco 交换机上配置 802.1X(带 AD 的 Windows RADIUS)
让我们考虑在实践中使用 Windows Active Directory + NPS(2 个服务器以确保容错)+ 802.1x 标准进行用户 - 域计算机 - 设备的访问控制和身份验证。 您可以根据维基百科上的标准来熟悉该理论,链接为: IEEE 802.1X

由于我的“实验室”资源有限,NPS和域控制器的角色是兼容的,但我建议您还是将此类关键服务分开。

我不知道同步 Windows NPS 配置(策略)的标准方法,因此我们将使用任务计划程序启动的 PowerShell 脚本(作者是我以前的同事)。 用于域计算机的身份验证以及无法进行身份验证的设备 802.1x (电话、打印机等),将配置组策略并创建安全组。

在本文的最后,我将告诉您使用 802.1x 的一些复杂问题 - 如何使用非托管交换机、动态 ACL 等。我将分享有关发现的“故障”的信息。 。

让我们从在 Windows Server 2012R2 上安装和配置故障转移 NPS 开始(2016 年一切都一样):通过服务器管理器 -> 添加角色和功能向导,仅选择网络策略服务器。

使用故障转移 NPS 在 Cisco 交换机上配置 802.1X(带 AD 的 Windows RADIUS)

或使用 PowerShell:

Install-WindowsFeature NPAS -IncludeManagementTools

一个小小的澄清 - 因为 受保护的 EAP (PEAP) 您肯定需要一个证书来确认服务器的真实性(具有适当的使用权限),该证书将在客户端计算机上受到信任,那么您很可能需要安装该角色 认证机构。 但我们会假设 CA 你已经安装了...

让我们在第二台服务器上执行相同的操作。 让我们在两台服务器上为 C:Scripts 脚本创建一个文件夹,并在第二台服务器上创建一个网络文件夹 SRV2NPS-配置$

让我们在第一台服务器上创建一个 PowerShell 脚本 C:ScriptsExport-NPS-config.ps1 包含以下内容:

Export-NpsConfiguration -Path "SRV2NPS-config$NPS.xml"

之后,让我们在任务计划程序中配置任务:“导出-NpsConfiguration=

powershell -executionpolicy unrestricted -f "C:ScriptsExport-NPS-config.ps1"

为所有用户运行 - 以最高权限运行
每日 - 每 10 分钟重复一次任务。 8小时内

在备份 NPS 上,配置配置(策略)导入:
让我们创建一个 PowerShell 脚本:

echo Import-NpsConfiguration -Path "c:NPS-configNPS.xml" >> C:ScriptsImport-NPS-config.ps1

以及每 10 分钟执行一次的任务:

powershell -executionpolicy unrestricted -f "C:ScriptsImport-NPS-config.ps1"

为所有用户运行 - 以最高权限运行
每日 - 每 10 分钟重复一次任务。 8小时内

现在,为了进行检查,让我们向其中一台服务器上的 NPS 添加 RADIUS 客户端中的几个交换机(IP 和共享密钥)以及两个连接请求策略: 有线连接 (条件:“NAS 端口类型为以太网”)和 WiFi-企业版 (条件:“NAS 端口类型为 IEEE 802.11”)以及网络策略 访问思科网络设备 (网络管理员):

Условия:
Группы Windows - domainsg-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 帐户(domainsg-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

使用故障转移 NPS 在 Cisco 交换机上配置 802.1X(带 AD 的 Windows RADIUS)

我们来创建一个安全组 SG-计算机-8021x-vl100,我们将在其中添加要分配到 vlan 100 的计算机,并为之前为此组创建的组策略配置过滤:

使用故障转移 NPS 在 Cisco 交换机上配置 802.1X(带 AD 的 Windows RADIUS)

您可以通过打开“网络和共享中心(网络和Internet设置)-更改适配器设置(配置适配器设置)-适配器属性”来验证该策略是否成功运行,在这里我们可以看到“身份验证”选项卡:

使用故障转移 NPS 在 Cisco 交换机上配置 802.1X(带 AD 的 Windows RADIUS)

当您确信策略已成功应用时,您可以继续在 NPS 和访问级别交换机端口上设置网络策略。

让我们创建一个网络策略 neag-计算机-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)

使用故障转移 NPS 在 Cisco 交换机上配置 802.1X(带 AD 的 Windows RADIUS)

交换机端口的典型设置(请注意,使用“多域”身份验证类型 - 数据和语音,并且还可以通过 mac 地址进行身份验证。在“过渡期间”,在参数:


authentication event fail action authorize vlan 100
authentication event no-response action authorize vlan 100

vlan 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

现在让我们创建一个组(例如, sg-fgpp单克隆抗体 )在手机的 Active Directory 中,并向其中添加一台设备进行测试(在我的例子中是 潮流GXP2160 带有 mas 地址 000b.82ba.a7b1 和分别。 帐户 域名 00b82baa7b1).

对于创建的组,我们将降低密码策略要求(使用 细粒度的密码策略 通过 Active Directory 管理中心 -> 域 -> 系统 -> 密码设置容器)使用以下参数 MAB 的密码设置:

使用故障转移 NPS 在 Cisco 交换机上配置 802.1X(带 AD 的 Windows RADIUS)

因此,我们将允许使用设备地址作为密码。 之后,我们可以为 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 身份验证 set 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 支持)会尝试对用户进行身份验证,即使配置了通过 Mac 地址进行身份验证也是如此。

在本文的下一部分中,我们将了解 802.1x 在无线中的使用(根据用户帐户所属的组,我们将其“扔”到相应的网络(vlan)中,尽管它们将连接到相同的 SSID)。

来源: habr.com

添加评论