วิธีใช้ NPS Server สำหรับ VPN บน Windows Server 2022 เพิ่มความปลอดภัยและควบคุมสิทธิ์ระดับองค์กร
เมื่อองค์กรมีผู้ใช้งาน VPN จำนวนมาก การกำหนดสิทธิ์แบบ Allow Access รายบุคคลบน Active Directory อาจไม่สะดวกและบริหารจัดการยาก นี่คือเหตุผลที่องค์กรส่วนใหญ่เลือกใช้ NPS Server (Network Policy Server) บน Windows Server 2022
NPS ทำหน้าที่เป็น RADIUS Server สำหรับตรวจสอบสิทธิ์ (Authentication) และกำหนดนโยบายการเข้าถึง (Authorization) ของผู้ใช้งาน VPN ทำให้สามารถควบคุมสิทธิ์ได้อย่างละเอียดและปลอดภัยมากขึ้น
บทความนี้จะอธิบายวิธีติดตั้งและใช้งาน NPS Server สำหรับ VPN บน Windows Server 2022 แบบครบทุกขั้นตอน
🔹 NPS Server คืออะไร
NPS ย่อมาจาก
Network Policy Server
เป็นบริการของ Microsoft ที่ทำหน้าที่
✅ Authentication
✅ Authorization
✅ Accounting
สำหรับผู้ใช้งาน VPN
Wi-Fi
802.1X
RADIUS
NPS เป็นส่วนหนึ่งของบทบาท
Network Policy and Access Services
บน Windows Server 2022
🔹 ประโยชน์ของ NPS
การใช้ NPS มีข้อดีหลายด้าน
✅ บริหารสิทธิ์จากส่วนกลาง
✅ ใช้ Security Group ได้
✅ เก็บ Log การใช้งาน
✅ รองรับ MFA
✅ รองรับ RADIUS
✅ เพิ่มความปลอดภัย
หลายองค์กรที่ทีมงาน comsiam ดูแลจะใช้งาน NPS ร่วมกับ RRAS เสมอ
🔹 สถาปัตยกรรมการทำงาน
กระบวนการทำงาน
1️⃣ VPN Client
2️⃣ RRAS Server
3️⃣ NPS Server
4️⃣ Active Directory
5️⃣ Authentication Success/Fail
เมื่อ User Login
RRAS จะส่งข้อมูลไปยัง NPS
NPS จะตรวจสอบกับ Active Directory
จากนั้นส่งผลลัพธ์กลับมา
🔹 ติดตั้ง NPS Server
เปิด
Server Manager
เลือก
Manage
Add Roles and Features
กด Next
เลือก
Role-based or feature-based installation
กด Next
🔹 เลือก Role
เลือก
Network Policy and Access Services
ภายในเลือก
Network Policy Server
กด Install
รอจนติดตั้งเสร็จ
🔹 Register NPS ใน Active Directory
หลังติดตั้งเสร็จ
เปิด
Network Policy Server
คลิกขวา
NPS (Local)
เลือก
Register Server in Active Directory
กด OK
ขั้นตอนนี้สำคัญมาก
หากไม่ Register
NPS จะตรวจสอบ User ใน Active Directory ไม่ได้
🔹 เพิ่ม RRAS เป็น RADIUS Client
เปิด
NPS Console
เลือก
RADIUS Clients and Servers
RADIUS Clients
คลิก
New
กำหนด
Friendly Name
RRAS-VPN
Address
192.168.1.10
Shared Secret
StrongSecret2022!
กด OK
🔹 ตั้งค่า RRAS ให้ใช้ NPS
เปิด
Routing and Remote Access
คลิกขวา Server
Properties
เลือก
Security
Authentication Provider
เลือก
RADIUS Authentication
กด Configure
เพิ่ม IP ของ NPS Server
ตัวอย่าง
192.168.1.20
ใส่ Shared Secret ให้ตรงกัน
กด OK
🔹 สร้าง Security Group สำหรับ VPN
เปิด
Active Directory Users and Computers
สร้าง Group
VPN Users
เพิ่ม User ที่ต้องการใช้งาน VPN
วิธีนี้ช่วยให้บริหารจัดการง่ายมาก
🔹 สร้าง Network Policy
เปิด
Network Policy Server
เลือก
Policies
Network Policies
คลิก
New
ชื่อ
VPN Access Policy
🔹 กำหนดเงื่อนไข
Add Condition
เลือก
Windows Groups
เพิ่ม
VPN Users
หมายความว่า
เฉพาะสมาชิกกลุ่มนี้เท่านั้นที่เชื่อมต่อ VPN ได้
🔹 กำหนด Permission
เลือก
Access Granted
อนุญาตการเชื่อมต่อ
🔹 กำหนด Authentication Method
แนะนำ
✅ MS-CHAP v2
✅ EAP
หลีกเลี่ยง
❌ PAP
❌ CHAP
เนื่องจากมีความปลอดภัยต่ำ
🔹 ทดสอบการเชื่อมต่อ
หลังตั้งค่าเสร็จ
ทดลอง Login VPN
ด้วย User ที่อยู่ใน
VPN Users
ควรเชื่อมต่อได้ทันที
🔹 ทดสอบ User ที่ไม่มีสิทธิ์
นำ User ออกจาก Group
แล้วทดลอง Login
NPS จะปฏิเสธการเชื่อมต่อ
ทันที
🔹 วิธีดู Log NPS
เปิด
Event Viewer
ไปที่
Custom Views
Server Roles
Network Policy and Access Services
จะพบ
✅ Login Success
✅ Login Failed
✅ Policy Match
✅ Access Denied
🔹 เปิด Log แบบ Text File
เปิด
Network Policy Server
Accounting
Configure Accounting
เลือก
Log File
ตำแหน่งเก็บ Log
C:\Windows\System32\LogFiles
ช่วยเก็บประวัติการใช้งานระยะยาว
🔹 Error ที่พบบ่อย
Error 812
ข้อความ
Connection prevented because of policy
สาเหตุ
User ไม่อยู่ใน Group
หรือ Policy ไม่ตรงเงื่อนไข
🔹 Error 691
สาเหตุ
Password ผิด
User Disabled
🔹 Error 809
สาเหตุ
Firewall
Port Forward
VPN Configuration
🔹 ใช้งานร่วมกับ MFA
NPS รองรับ
✅ Microsoft Entra MFA
✅ Azure MFA Extension
✅ Duo MFA
✅ RSA SecurID
ช่วยเพิ่มความปลอดภัยให้ VPN อย่างมาก
🔹 ข้อดีของ NPS เทียบกับ Allow Access
| คุณสมบัติ | Allow Access | NPS |
|---|---|---|
| บริหารผู้ใช้จำนวนมาก | ❌ | ✅ |
| Security Group | ❌ | ✅ |
| MFA | ❌ | ✅ |
| Accounting | ❌ | ✅ |
| Centralized Policy | ❌ | ✅ |
🔹 Best Practices
✅ ใช้ Security Group
✅ ใช้ NPS Policy
✅ เปิด Logging
✅ เปิด MFA
✅ ตรวจสอบ Event Log ทุกวัน
✅ เปลี่ยน Shared Secret เป็นระยะ
องค์กรระดับ Enterprise ส่วนใหญ่ใช้ NPS เป็นมาตรฐานสำหรับ VPN และ Remote Access ซึ่งเป็นแนวทางที่ทีมงาน comsiam แนะนำสำหรับ Windows Server 2022
🔹 สรุป
NPS Server เป็นองค์ประกอบสำคัญสำหรับระบบ VPN บน Windows Server 2022 เพราะช่วยให้สามารถควบคุมสิทธิ์ผู้ใช้งานผ่าน Security Group และ Network Policy ได้อย่างมีประสิทธิภาพ
เมื่อใช้งานร่วมกับ RRAS, Active Directory และ MFA จะช่วยเพิ่มความปลอดภัย ลดภาระการบริหารจัดการ และรองรับผู้ใช้งานจำนวนมากได้อย่างมืออาชีพ ซึ่งเป็นมาตรฐานที่องค์กรสมัยใหม่เลือกใช้บน Windows Server 2022 ในปัจจุบัน