使用故障轉移 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)。

來源: www.habr.com

添加評論