Using external Mysql for Freeradius 2 with Pfsense
1. Install Mysql server
I use mysql from WAMP package. it has Apache, MySql and PHP already with MyPhpAdmin. Download WAMP here . Install and configure Wamp you mus disable IIS if installed
Install Freeradius 2 in Pfsense package.
Create Database.
Download basic freeradius 2.2 Mysql schema here. extract file. Open Wamp server and start mysql service. run all service if you gonna use MyPhpAdmin to import the sql else open mysql console.
1. Open MyPhpAdmin login and Create Database 'radius' or type the command below in mysql console:
CREATE DATABASE 'radius';
2. Add user 'radius' to Mysql. first edit file admin.sql change 'localdomain; with the ip where freeradius is installed or '%' to allow all. Change radpass for security and save. Copy and paste it to mysql console to start adding the user or click import in MyPhpAdmin and choose admin.sql file.
3. Lets import the database structure, schema.sql don't change anything.
4. Import cui.sql, ippool.sql, nas.sql and wimax.sql.
Configure Pfsense Freeradius
Open Pfsense GUI goto services=>Freeradius=>SQL. Check Enable SQL support. Enable SQL Authorization, SQL Accounting. SQL Session and SQL Post-Auth. Select Database type MySQL. Input IP address where you installed WAMP. Leave port balnk to use default port 3306 else input any if you change the port of MySQL. Not sure open C:\wamp\logs\mysql.log should appear at the button like "port: 3306 MySQL Community Server". Leave blank for Database Username and input the text you replace from radpass in admin.sql. Leave all the rest option to it;'s default and save.
Checking
Check if firewall is ON in our Mysql host, if on make sure you can connect to the mysql from outside. Lets test it using Pfsense Port Test at Diagnostic. Enter the ip of the host and 3306 then click test. if successful lets continue else recheck your firewall or antivirus setting.
Check if Freeradius is up and running in the services. If OK then try to login in your portal if you use freeradius in portal or squid/lusca if you use it there.
Congrats ! Freeradius is now using external SQL.
FIX PFsense freeradius sql acctsessiontime is wrong
You might try editing /usr/local/captiveportal/radius_accounting.inc and finding the "$session_time = $stop_time - $start_time;" line (~202 or so) and then adding this under it:
$session_time = $stop_time - $start_time;
+ $session_time = ($session_time >= 0) ? intval($session_time) : 0;
via astralsnotes.blogspot.com
1. Install Mysql server
I use mysql from WAMP package. it has Apache, MySql and PHP already with MyPhpAdmin. Download WAMP here . Install and configure Wamp you mus disable IIS if installed
Install Freeradius 2 in Pfsense package.
Create Database.
Download basic freeradius 2.2 Mysql schema here. extract file. Open Wamp server and start mysql service. run all service if you gonna use MyPhpAdmin to import the sql else open mysql console.
1. Open MyPhpAdmin login and Create Database 'radius' or type the command below in mysql console:
CREATE DATABASE 'radius';
2. Add user 'radius' to Mysql. first edit file admin.sql change 'localdomain; with the ip where freeradius is installed or '%' to allow all. Change radpass for security and save. Copy and paste it to mysql console to start adding the user or click import in MyPhpAdmin and choose admin.sql file.
3. Lets import the database structure, schema.sql don't change anything.
4. Import cui.sql, ippool.sql, nas.sql and wimax.sql.
Configure Pfsense Freeradius
Open Pfsense GUI goto services=>Freeradius=>SQL. Check Enable SQL support. Enable SQL Authorization, SQL Accounting. SQL Session and SQL Post-Auth. Select Database type MySQL. Input IP address where you installed WAMP. Leave port balnk to use default port 3306 else input any if you change the port of MySQL. Not sure open C:\wamp\logs\mysql.log should appear at the button like "port: 3306 MySQL Community Server". Leave blank for Database Username and input the text you replace from radpass in admin.sql. Leave all the rest option to it;'s default and save.
Checking
Check if firewall is ON in our Mysql host, if on make sure you can connect to the mysql from outside. Lets test it using Pfsense Port Test at Diagnostic. Enter the ip of the host and 3306 then click test. if successful lets continue else recheck your firewall or antivirus setting.
Check if Freeradius is up and running in the services. If OK then try to login in your portal if you use freeradius in portal or squid/lusca if you use it there.
Congrats ! Freeradius is now using external SQL.
FIX PFsense freeradius sql acctsessiontime is wrong
You might try editing /usr/local/captiveportal/radius_accounting.inc and finding the "$session_time = $stop_time - $start_time;" line (~202 or so) and then adding this under it:
$session_time = $stop_time - $start_time;
+ $session_time = ($session_time >= 0) ? intval($session_time) : 0;
via astralsnotes.blogspot.com
ไม่มีความคิดเห็น:
แสดงความคิดเห็น