Cổng RADIUS chuẩn
- Authentication/Authorization: UDP 1812 (RADIUS) hoặc TCP 1812 (RadSec/TLS).
- Accounting: UDP 1813.
- RADIUS over TLS (RadSec): TCP 2083 (IANA assigned).
Tạo Inbound Security Rule qua Azure Portal
- Đăng nhập Azure Portal → Tìm Network security groups → Chọn NSG mục tiêu (hoặc Create mới).
- Menu bên trái: Settings → Inbound security rules → + Add.
- Điền thông tin:
| Trường | Giá trị khuyến nghị |
| Source | IP Addresses → Nhập CIDR của NPS/ISE/RADIUS server (ví dụ: 10.0.1.10/32) hoặc Service Tag: AzureActiveDirectory nếu dùng Azure MFA NPS Extension. |
| Source port ranges | * (hoặc 1024-65535) |
| Destination | Any (hoặc CIDR subnet chứa VM/VMSS cần bảo vệ) |
| Service | Custom |
| Destination port ranges | 1812,1813 (UDP) – Chọn Protocol: UDP. Nếu dùng RadSec: 2083 TCP. |
| Protocol | UDP (hoặc TCP cho RadSec) |
| Action | Allow |
| Priority | Số nhỏ ưu tiên cao (ví dụ 100, 200). Tránh trùng rule mặc định (65000+). |
| Name | Allow-RADIUS-Auth-Acct-Inbound |
| Description | Allow RADIUS UDP 1812/1813 from on-prem NPS/ISE to Azure VM subnet. |
- Nhấn Add → Rule hiệu lực ngay (không cần reboot VM).
Tạo qua Azure CLI (Automation/IaC)
az network nsg rule create \
--resource-group rg-network \
--nsg-name nsg-app-subnet \
--name Allow-RADIUS-Inbound \
--priority 100 \
--source-address-prefixes 10.0.1.10/32 \
--source-port-ranges '*' \
--destination-address-prefixes '*' \
--destination-port-ranges 1812 1813 \
--protocol Udp \
--access Allow \
--direction Inbound \
--description "Allow RADIUS auth/acct from on-prem NPS"
Tạo qua Terraform (Infrastructure as Code)
resource "azurerm_network_security_rule" "radius_inbound" {
name = "Allow-RADIUS-Inbound"
priority = 100
direction = "Inbound"
access = "Allow"
protocol = "Udp"
source_port_range = "*"
destination_port_range = "1812-1813"
source_address_prefix = "10.0.1.10/32"
destination_address_prefix = "*"
resource_group_name = azurerm_resource_group.rg.name
network_security_group_name = azurerm_network_security_group.nsg.name
description = "Allow RADIUS UDP 1812/1813 from on-prem NPS/ISE"
}
Best Practices
- Narrow Source: Chỉ cho phép IP RADIUS server cụ thể (NPS, ISE, FreeRADIUS, Aruba ClearPass) – không dùng
Any.
- Phân tách Auth & Acct: Tạo 2 rule riêng (1812, 1813) nếu cần log/control khác nhau.
- NSG Association: Gán NSG vào Subnet (khuyên dùng) hoặc NIC của VM chạy NPS/ISE hoặc VM workload cần auth.
- Logging: Bật NSG Flow Logs → Log Analytics Workspace → KQL query cho RADIUS traffic.
- Just-In-Time (JIT) VM Access: Nếu RADIUS server là VM Azure, bật JIT (Microsoft Defender for Cloud) để chỉ mở cổng khi admin request.
Kiểm tra kết nối
# Từ RADIUS server (on-prem) test tới Azure VM IP
radtest testuser testpass 0 testing123 # UDP 1812
radtest -x testuser testpass 0 testing123 # Accounting 1813
# Hoặc dùng Nmap
nmap -sU -p 1812,1813