Code Monkey home page Code Monkey logo

radius-server's Introduction

RADIUS-SERVER

This is PHP-based radius server.

It's tested and works on PHP up to 8.1, it should work on all 7.X as well, I do not recommend to use 5.X and earlier.

Why use php based radius?

Becouse many applictions are written in PHP that communicate with radius DB to update and synchronize own DB. This is unnecessary as you can override methods to implement your own system for logging the users.

Which applications is suited to use this?

Mainly ISP administration program. Script can do not only login like radius do but many more, like disconnecting users at some condition. You can also implement your system.

Isn't this very slow to do in PHP?

In my test machine which is i5 i can process 30.000 req/sec on one core and using PHP7. In PHP5 i get around 7000. This should be enough for most people as your bottleneck will probalby by DB not PHP.

Config file

In root of the project in config.php you can configure some stuff:

const DEBUG = false;
$config = [
    'serverip' => '0.0.0.0',
    'serverport' => 1812,
    'secret' => 'secret',
    'receive_buffer' => 65535,
    'auth_method' => 'File',
    'debug' => RADIUS_DEBUG,
];

Here auth_method is authentication method used to provide auth and attributes. You need to have class with same name if you want to change this. Your class should contain implementation of specific source like database. "File" is simple file reader that is refreshed every 60 seconds, it is used as example how to do this. I recommend using redis for this purpose as it is very fast and simple.

You class should exists in classes/auth directory.

radius-server's People

Contributors

dr4g0nsr avatar

Stargazers

 avatar Rodrigo M avatar  avatar Alex avatar  avatar Wu Weixin avatar jmj avatar

Watchers

 avatar  avatar Rodrigo M avatar

radius-server's Issues

Custom dictionary attributes not recoginized

I added dictionary.pfsense to the dictionary directory and registered it in the include section of dictionary file but the attributes specified for pfsense e.g pfSense-Bandwidth-Max-Up are not recognized as reply attributes still. How should i register the attributes?
Thanks

User-Password issue

When I try running with @$attr["User-Password"] method to get password which sent by client user that the password is incorrect.

The codes are below:

if (@$attr["User-Password"]) {  // https://tools.ietf.org/html/rfc2058#section-5.2
     $encrypted_password = $this->create_user_password($password, $auth, $this->secret);
     $requested_password = $this->hex_dump($attr["User-Password"]["value"]);
     return $requested_password == $encrypted_password && $user == $attr["User-Name"]["value"];
 }

Could you please help me to solve this issue?

Many thanks.

Can't running. I need help.

When I sent a request to the Radius Server . I got this blow.

Requests: 1/sec minimum 1 maximum 1

** And When I run the server.php script to start running server that it returns some errors message blow **
It was belong to reverse_dictionary function

Notice: Undefined index: id in /home/wwwroot/default/radius/server.php on line 189
PHP Notice: Undefined index: id in /home/wwwroot/default/radius/server.php on line 189

Notice: Undefined index: id in /home/wwwroot/default/radius/server.php on line 189
PHP Notice: Undefined index: id in /home/wwwroot/default/radius/server.php on line 189

Notice: Undefined index: id in /home/wwwroot/default/radius/server.php on line 189
PHP Notice: Undefined index: id in /home/wwwroot/default/radius/server.php on line 189

Notice: Undefined index: id in /home/wwwroot/default/radius/server.php on line 189
PHP Notice: Undefined index: id in /home/wwwroot/default/radius/server.php on line 189

Notice: Undefined index: id in /home/wwwroot/default/radius/server.php on line 189
PHP Notice: Undefined index: id in /home/wwwroot/default/radius/server.php on line 189

Notice: Undefined index: id in /home/wwwroot/default/radius/server.php on line 189
PHP Notice: Undefined index: id in /home/wwwroot/default/radius/server.php on line 189

Notice: Undefined index: id in /home/wwwroot/default/radius/server.php on line 189
Running RADIUS server 0.0.0.0 : 1812 on PHP 7.1.7

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.