Captive Portal Self Registration Using Free radius & Mysql Tested with 2.0.2-RELEASE (i386) built on Fri Dec 7 16:30:14 EST 2012 in vmware 8.
Caution : this procedure was perfect for me. Please use at your own risk & make backup.
You need few thing to do this
1. php-mysql support in pfsense. Default is disabled. follow this post to do ithttp://forum.pfsense.org/index.php/topic,47150.0.html
your command should be
pkg_info -r http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/i386/8.1-RELEASE/packages/All/php52-mysql-5.2.13_3.tbz
pkg_add -rfi http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/i386/8.1-RELEASE/packages/All/php52-mysql-5.2.13_3.tbztips:
according to his (sash99
) post some package dependencies should occur. But I did not found 1. what I did..
1. in command added package with
pkg_add -rfi http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/i386/8.1-RELEASE/packages/All/php52-mysql-5.2.13_3.tbz
2. in command
3. installed freeradius2 package from system/package
4. rebooted pfsense
5. in command
6. rebooted pfsense.
Config pfsense freeradius according to this dochttp://doc.pfsense.org/index.php/FreeRADIUS_2.x_package
and for sql supporthttp://forum.pfsense.org/index.php/topic,43675.msg235475.html#msg235475
add extra table using reg_users.sql.txt file sql command or u can rename this to reg_users.sql and import via phpmyadmin
I hav added database file also.
now rename every file & remove “.txt” from file name ie
captiveportal-cp_reg_suc.php.txt to captiveportal-cp_reg_suc.php
captiveportal-bootstrap.min.css.txt to captiveportal-bootstrap.min.css
and so …
captiveportal-cp_reg_suc.php in line 104 insert your sql server ipaddress & password.
Upload evry file in captive file manager except
in captive portal main page
enable captive portal in Lan
check Disable concurrent logins
in Authentication section
check RADIUS Authentication
in ipaddress box ------------- 127.0.0.1
port box ----------- 1812
sharedsecret box -----------your shared secret
in Accounting check send RADIUS accounting packets
in port ----------- 1813
Accounting updates ----- check strat stop
In RADIUS NAS IP attribute select your lan.
insert cp_portal.php in “Portal page contents”
cp_error.php in “Authentication error page contents”.
Save. And you are ready to go.Important
1. you should change php file content according to your need.
2. be aware about adding php-mysql package you may not be lucky as i was. if anything goes wrong follow "sash99" post carefully.
3. in my captive portal page i have some security like a client with a mac address can only register one account.
please let me know your experiences.