此為 FreeRADIUS 認證系統網頁管理平台,使用 Node.js 和 Vue 開發。該平台使用網頁管理 FreeRADIUS 授權,用於驗證連接至 Aruba Controller 的裝置 MAC 地址是否有效。
- HPE Aruba 7205 Controller v8.11.2.2 *2 HA
- HPE Aruba AP-515, AP-575, AP-615
- Ubuntu 22.04
- 10.6.18-MariaDB-0ubuntu0.22.04.1
- FreeRADIUS V3.0.26
- Node.js v20.16.0
Clone 此存儲庫
git clone https://github.com/hmes98318/tomradius.git
安裝 FreeRADIUS 以及 FreeRADIUS 的 MySQL 模組
apt update -y
apt install freeradius freeradius-mysql -y
啟用 FreeRADIUS 服務
systemctl enable freeradius.service
systemctl start freeradius.service
安裝 MariaDB,並參考 資料庫安裝文檔 進行初始化
apt install mariadb-server -y
啟用 MariaDB
systemctl enable mariadb.service
systemctl start mariadb.service
初始化配置資料庫
mariadb-secure-installation
開啟 FreeRADIUS 目錄 /etc/freeradius/3.0/
修改 mods-available/sql
,設置資料庫連線
sql {
dialect = "mysql"
driver = "rlm_sql_mysql"
server = "localhost"
port = 3306
login = "radius"
password = "your_passwprd"
radius_db = "radius_db"
# mysql tls 連接註解掉 (預設啟用 tls)
mysql {
# If any of the files below are set, TLS encryption is enabled
# tls {
# ca_file = "/etc/ssl/certs/my_ca.crt"
# ca_path = "/etc/ssl/certs/"
# certificate_file = "/etc/ssl/certs/private/client.crt"
# private_key_file = "/etc/ssl/certs/private/client.key"
# cipher = "DHE-RSA-AES256-SHA:AES128-SHA"
#
# tls_required = yes
# tls_check_cert = no
# tls_check_cert_cn = no
# }
warnings = auto
}
...
}
修改完成後啟用 MySQL 模組
ln -s /etc/freeradius/3.0/mods-available/sql /etc/freeradius/3.0/mods-enabled/
執行 ls -l mods-enabled/
查看模組是否已成功掛載
lrwxrwxrwx 1 freerad freerad 38 Sep 10 11:00 sql -> /etc/freeradius/3.0/mods-available/sql
重啟 FreeRADIUS 服務
systemctl restart freeradius.service
安裝 npm 模組
npm ci
參考 .env.example
修改 .env
配置
# Database
DB_HOST = "localhost"
DB_PORT = 3306
DB_DATABASE = "database_name"
DB_USER = "user"
DB_PASSWORD = "password"
啟動服務
npm run start