Simple 802.1x test server, just like Masarykova univerzita
Built by Flask
use mscharpv2 for radius challenge
other protocol -- TODO
You need Python 2.7
Clone & Prepare
git clone https://github.com/shanghai-edu/radius-1xtest.git
cd radius-1xtest
Install dependency
yum install python-pip
yum install -y python-devel gcc
yum install libjpeg libjpeg-devel zlib zlib-devel
pip install virtualenv
virtualenv ./env
source env/bin/activate
pip install -r requirement.txt
cat config.py
# BASIC APP CONFIG
BIND_ADDRESS = '0.0.0.0'
PORT = 81
SECRET_KEY = "session_secret_key"
# SSID CONFIG
SSID_CONFIG = {
"test1x":
{"RADIUS_HOST":"192.168.0.210","RADIUS_SECRET":"802.1x","RADIUS_PORT":1812,"NAS_IP":"192.168.80.5"},
"eduroam":
{"RADIUS_HOST":"192.168.0.220","RADIUS_SECRET":"eduroam","RADIUS_PORT":1812,"NAS_IP":"192.168.80.5"},
}
# API_KEY
API_KEY = "0c8d964e8fbd4cfcd040b5691d119968"
chmod +x control
./control start
./control stop
./env/bin/python run.py
use nginx proxy to provide https
open http://127.0.0.1:81/test/<ssid>
in your browser.
such as http://127.0.0.1:81/test/eduroam
use API_KEY in config.py for the "X-API-KEY" in http header
#curl -H "Content-Type: application/json" -H "X-API-KEY: 0c8d964e8fbd4cfcd040b5691d119968" -d '{"username":"test01@test.edu.cn","password":"test123"}' "https://test.edu.cn/api/v1/eduroam"
{
"result": {
"method": "mscharpv2",
"success": true,
"time": 0.36426687240600586,
"username": "test01@test.edu.cn"
}
}