"FREERADIUS3" Installation and expansion requirements

Source: Internet
Author: User
Tags freeradius

This is the main look at the installation of Freeradius, as well as the example of Python expansion, there are billing fields to expand according to manufacturers.

Installation of version 3.0

Reference articles

yum install libtalloc-devel-c ftp://ftp.freeradius.org/pub/freeradius/freeradius-server-3.0.11.tar.gztar zxvf freeradius-server-3.0.11.tar.gzcd freeradius-server-3.0.11./configuremakemake installldconfig如果需要用mysql 和 python拓展  yum 安装下 python-devel, mysql-devel默认的安装位置  /usr/local/etc/raddb/
Open Python expansion
    1. mods-available/pythonconnect the soft to the mods-enabled/python

    2. Edit the Mods-enabled/python file, this is where the Python modules are configured at different stages, and I just need to get rid #func_authorize = authorize of this line of comments

    3. Specify the path to Pythonexport PYTHONPATH=‘/usr/local/etc/raddb/mods-config/python‘

Document Address

Because only the authenticated part is enabled, the default configuration is the example.py file, so this is the part to experiment with.

Print some operation information
def authorize(p):  print"*** authorize ***"  print  ‘*** radlog call in authorize llllll***‘)  print  print p  print sys.path  print os.getcwd()  ‘*** python part end ***‘)  return radiusd.RLM_MODULE_OK
Custom reply
 def authorize(p):  Print "* * * * authorize"  PrintRadiusd.radlog (RADIUSD. L_info,' * * * Radlog call in authorize llllll*** ')Print  PrintP reply = ((' Reply-message ',': = ',' Hello from Rlm_python '),           (' Benu-redirection-url ',': = ',' http://baidu.com '),) config = ((' Cleartext-password ',' benu123 '), Radiusd.radlog (RADIUSD). L_info,' * * * python part end * * *)return(RADIUSD. Rlm_module_ok, reply, config)

Config is the user's password, look at the test results

# echo "user-name=cc:ff:ff:ff:ff,user-password=benu123" |radclient 127.0.0.1:1812 auth testing123-xSent access-request Id182  from 0.0. 0. 0:48733  to 127.0. 0. 1:1812 length  WuUser-name ="Cc:ff:ff:ff:ff"User-password ="Benu123"Cleartext-password ="Benu123"Received access-accept Id182  from 127.0. 0. 1:1812  to 0.0. 0. 0:0 length  theReply-message ="Hello from Rlm_python"benu-redirection-URL="Http://baidu.com"
Expand the Billing table field

Take MySQL as a billing table for example.

    1. Adjust the fields of the billing table in MySQL

    2. /mods-enabled/sqlTo set up the MySQL database, or load the default SQLite

    3. mods-config/sql/main/mysql/queries.confin the modified INSERT and UPDATE statements, according to already have the statement as the reference syntax, the SQL can be adjusted.

    4. After the modification radiusd -Xx is used to start, if the syntax is correct can start normally, otherwise it will be an error.

    5. You can then use Radclient to simulate the authentication request test.

"FREERADIUS3" Installation and expansion requirements

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.