Network Access Protection – NAP VPN

– Ở bài lab Network Access Protection – NAP DHCP, chúng ta đã cấu hình NAP DHCP khi máy Client không bật chức năng Firewall hay anti-virus thìkhông được DHCP Server cung cấp Default Gateway.


– Ở bài này chúng ta Triển khai NAP để bảo mật cho hệ thống VPN, sau khi hoàn tất bài lab hệ thống VPN của bạn sẽ đáp ứng được các nhu cầu sau:
– Máy VPN Client nào không bật Windows Firewall, khi kết nối VPN thành công sẽ tự động bật Windows Firewall

– Máy VPN Client không có cài chương trình Anti-Virus, khi kết nối VPN thành công chỉ được phép liên lạc với 1 vài máy trong hệ thống nội bộ.

I. Mô hình.


II. Chuẩn bị

Bài lab bao gồm 3 máy:
– Máy server (BKNP-DC08-01): Windows Server 2008 đã nâng cấp Domain Controller
– Máy Server (BKNP-SRV08-01): Windows Server 2008 đã Join domain
– Máy VPN Client (BKNP-WIN7-01): Windows 7 (Không cần join domain)
– Trên máy server (BKNP-DC08-01) tạo user bknp password 123456a@, và cấp quyền
Remote Access Permission

III. Hướng dẫn chi tiết

Bài lab bao gồm các bước:

  1. Cài Enterprise root CA
  2. Xin Computer Certificate cho Server
  3. Cài đặt Network Policy and Access Service
  4. Cấu hình Network Policy Server (NPS)
  5. Cấu hình VPN
  6. Cấu hình Windows Firewall
  7. Cấu hình Trusted Root CA
  8. Cấu hình NAP Client
  9. Tạo VPN Connection
  10. Client kiểm tra kết nối VPN
  11. Cấu hình System Health Validators
  12. Client kiểm tra kết nối VPN


IV. Thực hiện

1. Cài Enterprise root CA trên máy DC
– Tại máy DC, log on BACHKHOA-NPOWER\Administrator password 123456a@ – Mở Server Manager từ Administrative Tools, chuột phải Roles chọn Add Role


Trong hộp thoại Before You Begin chọn Next
Hộp thoại Select Server Roles, đánh dấu chọn Active Directory Certificate Service, chọn Next


– Hộp thoại Introduction to Active Directory Certificate Services chọn Next


– Hộp thoại Seclect Role Services, đánh dấu chọn Certification Authority Web Enrollment


– Trong hộp thoại Add Roles Wizard, chọn Required Role Services


– Hộp thoại Seclect Role Services, đánh dấu chọn Online Responder, chọn Next


– Hộp thoại Specify Setup Type, chọn Enterprise, chọn Next


– Trong hộp thoại Specify CA Type, chọn Root CA, chọn Next


– Trong hộp thoại Set Up Private Key, chọn Create a new private key, chọn Next


– Trong hộp thoại Configure Cryptography for CA, giữ cấu hình mặc định, chọn Next


– Trong cửa sổ Configure CA Name, nhập BACHKHOA-NPOWER.VN vào ô Common name for this CA, chọn Next


– Trong hộp thoại Set Validity Period, giữ cấu hình mặc định, chọn Next


– Trong hộp thoại Configure Certificate Database, giữ cấu hình mặc định, chọn Next


– Trong hộp thoại Web Server (IIS), chọn Next


– Trong hộp thoại Select Role Services, giữ cấu hình mặc định, chọn Next


– Trong hộp thoại Confirm Installation Selections, chọn Install


– Quá trình cài đặt diễn ra


– Trong hộp thoại Installation Results, kiểm tra quá trình cài đặt thành công, chọn Close

– Mở Certification Authority từ Administrative Tools, bung BACHKHOA-NPOWER.VN, Chuột phải Certificate Templates chọn Manage


– Trong cửa sổ Certificate Templates Console, chuột phải certificate Computer chọn Properties


– Vào tab Security, cho group Authenticated Users quyền Enroll, chọn OK

2. Xin Computer Certificate cho Server
– Restart máy Server (Để máy Server tự động add Trusted Root CA) – Tại máy Server, logon MSOpenLab\Administrator
– Vào Start -> Run, gõ lệnh mmc, chọn OK
– Trong cửa sổ Console1, vào File, chọn Add/Remove Snap-in… Chọn Certificates, chọn Add


– Hộp thoại Certificates snap-in, chọn Computer Account, Next


– Hộp thoại Seclect Computer, chọn Local Computer, Finish


– Trong cửa sổ Console1, bung Certificates, chuột phải Personal chọn All Tasks, chọn Request New Certificate..


– Trong hộp thoại Before You Begin, chọn Next


– Trong hộp thoại Request Certificates, đánh dấu chọn Computer, chọn Enroll
– Hộp thoại Certificate Installation Results, chọn Finish


– Trong cửa sổ Console1, kiểm tra đã xin thành công certificate cho máy Server

3. Cài đặt Network Policy and Access Service.
– Tại máy Server, logon BACHKHOA-NPOWER\Administrator, password 123456a@ – Mở Server Manager từ Administrative Tools, chuột phải Roles chọn Add Roles


– Trong hộp thoại Before You Begin, chọn Next

– Trong hộp thoại Select Server Roles, đánh dấu chọn vào ô Network Policy and Access Services, chọn Next

– Trong hộp thoại Network Policy and Access Services, chọn Next

– Trong cửa sổ Select Role Services, đánh dấu chọn vào ô Network Policy Server và ô Routing and Remote Access Services , chọn Next

– Trong cửa sổ Confirm Installation Selections, chọn Install


– Quá trình cài đặt diễn ra


– Trong cửa sổ Installation Results, chọn Close

4. Cấu hình Network Policy Server (NPS)
– Trên máy Server (BKNP-SRV08-01), mở Network Policy Server từ Administrative Tools, bung Network Access Protection, chọn System Health Validators, right click Windows Security Health Validators chọn Properties.


– Trong hộp thoại Windows Security Health Validators Properties, chọn Configure…


– Trong hộp thoại Windows Security Health Validators, bỏ tất cả các ô chọn, trừ ô A firewall is enable for all network connections, chọn OK 2 lần


– Trong hộp thoại Network Policy Server, bung Policies, right click Health Policies chọn New


– Trong hộp thoại Create New Health Policy, nhập Compliant vào ô Policy name, trong ô Client SHV checks chọn Client passes all SHV checks, đánh dấu chọn ô Windows Security Health Validator, chọn OK


– Trong hộp thoại Network Policy Server, bung Policies, right click Health Policies chọn New


– Trong hộp thoại Create New Health Policy, nhập NonCompliant vào ô Policy name, trong ô Client SHV checks chọn Client fails one or more SHV checks, đánh dấu chọn ô Windows Security Health Validator, chọn OK


– Kiểm tra đã tạo thành công 2 Health Policies: CompliantNonCompliant


– Trong hộp thoại Network Policy Server, bung Policies, vào Network Policies, lần lượt disable 2 policy đang có


– Chuột phải Network Policies chọn New


– Trong hộp thoại Specify Network Policy Name and Connection Type, nhập Complian Full Access vào ô Policy name, chọn Next


– Hộp thoại Specify Conditions, chọn Add


– Trong hộp thoại Select condition, chọn mục Health Policies, chọn Add


– Hộp thoại Health Policies, bung Health policies chọn Compliant, chọn OK


– Hộp thoại Specify Conditions, chọn Next


– Trong hộp thoại Specify Access Permission, chọn Access granted, chọn Next



– Trong hộp thoại Configure Authentication Methods, giữ nguyên cấu hình mặc định, chọn Next


– Hộp thoại Configure Constraints, giữ cấu hình mặc định, chọn Next


– Hộp thoại Configure Settings, chọn mục NAP Enforcement, kiểm tra đảm bảo đang chọn Allow full network access, chọn Next


– Hộp thoại Completing New Network Policy, chọn Finish


– Chuột phải Network Policies chọn New


– Trong hộp thoại Specify Network Policy Name and Connection Type, nhập NonCompliant Restricted vào ô Policy name, chọn Next


– Trong hộp thoại Specify Conditions, chọn Add


– Hộp thoại Select condition, chọn mục Health Policies, chọn Add


– Hộp thoại Health Policies, bung Health policies chọn NonCompliant, chọn OK


– Trong cửa sổ Specify Conditions, chọn Next


– Trong cửa sổ Specify Access Permission, chọn Access granted, chọn Next


– Trong cửa sổ Configure Authentication Methods, giữ cấu hình mặc định, chọn Next


– Trong hộp thoại Configure Constraints, giữ cấu hình mặc định, chọn Next


– Trong hộp thoại Configure Settings, chọn mục NAP Enforcement, chọn Allow limited access, đánh dấu chọn ô Enable auto-remediation of client computers, chọn Next


– Trong cửa sổ Configure Settings, chọn mục IP Filters, trong phần IPv4 chọn Input Filters


– Hộp thoại Inbound Filter, chọn New

– Hộp thoại Add IP Filter, đánh dấu chọn Destination network – IP Address: 192.168.1.2 (địa chỉ của máy DC)

– Subnet mask: 255.255.255.255

– Protocol: Any

– Chọn OK


– Trong hộp thoại Inbound Filters, chọn Permit only the packetd listed below, chọn OK


– Trong cửa sổ Configure Settings, mục IP Filters, trong phần IPv4 chọn Outbound Filters…


– Trong hộp thoại Outbound Filters, chọn New
– Hộp thoại Add IP Filter, đánh dấu chọn Source network

– IP Address: 172.16.1.2 (địa chỉ của máy DC)

– Subnet mask: 255.255.255.255

– Protocol: Any

– Chọn OK


– Trong hộp thoại Outbound Filters, chọn Permit only the packetd listed below, chọn OK


– Hộp thoại Configure Settings, chọn Next


– Trong hộp thoại Completing New Network Policy, chọn Finish


– Kiểm tra đã tạo thành công 2 Network Policies


– Trong hộp thoại Network Policy Server, bung Policies, vào Connection Request Policies, Chuột phải Use Windows authentication for all users chọn Disable


– Trong hộp thoại Network Policy Server, vào Policies, chuột phải Connection Request Policies chọn New


– Trong hộp thoại Specify Connection Request Policy Name and Connection Type, nhập VPN Connection vào ô Policy name, trong mục Type of naetwork access server, chọn Remote Access Server (VPN-Dial up), chọn Next

– Hộp thoại Specify Conditions, chọn Add


– Trong hộp thoại Select conditions, chọn Tunnel Type, chọn Add


– Hộp thoại Tunnel Type, đánh dấu chọn vào 2 ô: Layer Two Tunneling Protocol (L2TP)Point-to-Point Tunneling Protocol (PPTP), chọn OK


– Trong hộp thoại Specify Conditions, chọn Next


– Hộp thoại Specify Connection Request Forwarding, giữ cấu hình mặc định, chọn Next


– Hộp thoại Specify Authentication Methods, chọn Add


– Hộp thoại Add EAP, chọn Microsoft: Protected EAP (PEAP), chọn OK


– Hộp thoại Specify Authentication Methods, chọn Add


– Hộp thoại Add EAP, chọn Microsoft: Secured password (EAP-MSCHAP v2), chọn OK


– Hộp thoại Specify Authentication Methods, chọn Microsoft: Protected EAP (PEAP), chọn Edit…

– Trong hộp thoại Configure Protected EAP Properties, đánh dấu chọn vào 2 ô: Enable Fast ReconnectEnable Quarantine checks, chọn OK


– Hộp thoại Specify Authentication Methods, chọn Next


– Hộp thoại Configure Settings, giữ cấu hình mặc định, chọn Next


– Trong hộp thoại Completing Connection Request Policy Wizard, chọn Finish


– Trong cửa sổ Network Policy Server, kiểm tra tạo thành công VPN Connections

5. Cấu hình VPN
– Tại máy Server (BKNP-SRV08-01), mở Routing and Remote Access Services từ Administrative Tools, chuột phải BKNP-SRV08-01, chọn Configure and Enable Routing and Remote Access


– Trong hộp thoại Welcome to Routing and Remote Access Server Setup Wizard, chọn Next


Hộp thoại Configuration, chọn Custom Configuration, chọn Next


– Hộp thoại Custom Configuration, đánh dấu chọn VPN accessLAN Routing, chọn Next


– Trong hộp thoại Completing the Routing ang Remote Access Server Setup Wizard chọn Finish


– Hộp thoại Routing and Remote Access, chọn OK, chọn Start service


– Trong cửa sổ Routing and Remote Access, chuột phải BKNP-SRV08-01, chọn Properties


– Trong hộp thoại BKNP-SRV08-01 Properties, vào tab IPv4, chọn Static address pool, chọn Add


– Hộp thoại New IPv4 Address Range nhập:

Start IP address: 192.168.1.10
End IP address: 192.168.1.254
Chọn OK 2 lần.


– Mở Network Policy Server từ Administrative Tools, bung Polices, vào Connection Request Policies, chuột phải Microsoft Routing ang Remote Access Service Policy, chọn Disable

 6. Cấu hình Windows Firewall (Cho phép được Ping máy Server)
– Tại máy Server (BKNP-SRV08-01), mở Windows Firewall with Advanced Security từ Administrative Tools, chuột phải Inbound Rules, chọn New Rule…


– Trong hộp thoại Rule Type, chọn Custom, chọn Next


– Hộp thoại Program, chọn All Programs, chọn Next


– Hộp thoại Protocol and Ports, bung mục Protocol type chọn ICMPv4, chọn Next


– Hộp thoại Scope, giữ cấu hình mặc định, chọn Next


– Hộp thoại Action, chọn Allow the connection, chọn Next


– Hộp thoại Profile, giữ cấu hình mặc định, chọn Next


– Hộp thoại Name, nhập tên ICMPv4 echo request vào ô Name, chọn Finish


– Tắt cửa sổ Windows Firewall with Advanced Security

7. Cấu hình Trusted Root CA
– Tại máy Server, mở Internet Explorer, truy cập vào địa chỉ http://172.16.1.2/certsrv (máy BKNP-DC08-01). Trong cửa sổ Welcome, chọn Download a CA certificate , certificate chain, or CRL


Trong cửa sổ Download a CA certificate , certificate chain, or CRL, chọn Download CA certificate


– Hộp thoại File Download, chọn Save, save file certnew.cer vào ổ đĩa C


– Copy file certnew.cer qua đĩa C: của máy VPN Client (Trong bài lab này sử dụng ổ cứng USB để copy file certnew.cer qua máy VPN Client)


– Tại máy VPN Client(BKNP-WIN7-01), vào Start\Run, gõ mmc, chọn OK

– Trong cửa sổ Console1, vào File chọn Add/Remove Snap-in…



– Hộp thoại Add/Remove Snap-in, chọn Certificate, chọn Add, OK


Hộp thoại Certificate snap-in, chọn Computer Account, chọn Next


– Hộp thoại Seclect Computer, chọn Local Computer, chọn Finish


– Hộp thoại Add/Remove Snap-in, chọn OK


– Trong cửa sổ Console1, bung Certificates, bung Trusted Root Certification Authorities, chuột phải Certificates, chọn All Task, chọn Import…


– Trong hộp thoại Welcome to the Certificate Import Wizard, chọn Next


– Hộp thoại File to Import, chọn Browse… trỏ đường dẫn đến C:\certnew.cer, chọn Next


– Hộp thoại Certificate Store, chọn Next, Finish


– Hộp thoại “Completing the Certificate Import Wizard” chọn Finish

– Trong cửa sổ Console1, kiểm tra có certificate BACHKHOA-NPOWER.VN trong Trusted Root Certification Authorities. Tắt cửa sổ Console1

8. Cấu hình NAP Client.

Tại máy VPN Client (BKNP-WIN7-01), vào Start\Run gpedit.msc, chọn OK
– Trong cửa sổ Group Policy Object Editor, vào đường dẫn Computer Configuration\Administrative Template\Windows Components\Security Center, right click Turn on Security Center (Domain PCs only), chọn Edit


– Trong hộp thoại Turn on Security Center (Domain PCs only) Properties, chọn Enable, chọn OK, tắt cửa sổ Group Policy Object Editor


– Mở Command line, gõ lệnh gpupdate /force

– Vào Start > Runmmc, chọn OK

– Trong cửa sổ Console1, vào File, chọn Add/Remove Snap-in…

– Trong hộp thoại Add or Remove Snap-ins, chọn NAP Client Configuration, chọn Add, chọn OK

– Hộp thoại NAP Client Configuration, chọn Local computer, chọn OK 2 lần

– Trong cửa sổ Console1, bung NAP Client Configuration, vào Enforcement Clients, chuột phải EAP Quarantine Enforcement Client chọn Enable. Tắt cửa sổ Console1.


– Vào Start\Run, gõ services.msc, chọn OK

– Trong cửa sổ Services, chuột phải Network Access Protection Agent, chọn Properties


– Trong hộp thoại Network Access Protection Agent Properties, bung ô Startup type chọn Automatic, chọn Start, chọn OK

9. Tạo VPN Connection.

– Tại máy VPN Client, mở Network and Sharing Center từ Control Panel


– Trong cửa sổ Network and Sharing Center, chọn Change adapter settings


– Trong hộp thoại Choose a connection option, chọn Connect to a workplace, chọn Next


– Hộp thoại How do you want to connect, chọn Use my Internet connection (VPN)


– Hộp thoại Do you want to set up an Internet connection before continuing, chọn I’ll set up Internet connection later


– Hộp thoại Type the Internet address to connect to, nhập địa chỉ mặt ngoài của máy Server (131.107.1.1) vào ô Internet address, chọn Next

– Hộp thoại Type your user name and password, nhập thông tin như trong hình, chọn Create


– Hộp thoại The connection is ready to use, chọn Close


– Trong cửa sổ Network ang Sharing Center, chọn Change adapter settings

– Chuột phải VPN Connection, chọn Properties


– Trong hộp thoại VPN Connection Properties, vào tab Security, chọn User Extensible Authentication Protocol (EAP), chọn Microsoft: Protected EAP (PEAP)(encryption enabled), và chọn Properties


– Hộp thoại Protected EAP Properties, bỏ dấu chọn Connect to these servers, bỏ dấu chọn Enable Fast Reconnect, đánh dấu chọn vào ô Enforce Network Access Protection, chọn OK 3 lần

10. Client kiểm tra kết nối VPN.

– Mở Windows Firewall từ Control Panel, chọn Turn Windows Firewall on or of


– Trong hộp thoại Customize settings for each type of network, chọn Turn off Windows Firewall , chọn OK

Lưu ý: Tắt Windows Firewall cùa máy VPN client để giả lập máy VPN Client không đủ điều kiện bảo mật

Mở Network and Sharing Center từ Control Panel, chọn Change adapter settings
– Chuột phải NAP VPN Connection chọn Connect

– Trong hộp thoại Connect VPN Connection, chọn Connect


– Trong hộp thoại Windows Security Alert, chọn Connect


– Quá trình kết nối diễn ra

– Quá trình kết nối thành công


– Sau khi kết nối thành công, mở Command Line, gõ lệnh ipconfig /all, kiểm tra VPN Client đã nhận được IP do VPN Server cung cấp, trong System Quarantine State báo Not Restricted

Ping máy tới máy BKNP-DC08-01 và máy BKNP-SRV08-01, kiểm tra ping được cả 2 máy.
– Mở Windows Firewall từ Control Panel, kiểm tra Windows Firewall đã tự động được Enable

Bình luận về bài viết này