Dear all,
Kindly Check Out skynetconsult.in For More Blog.
Regards,
skynetConsultacy.
1
2
3
| mysql -uroot -puser1234create database radius;grant all on radius.* to radius@localhost identified by "user1234"; |
1
2
3
4
5
| mysql -u root -puser1234 radius < /etc/freeradius/sql/mysql/schema.sqlmysql -u root -puser1234 radius < /etc/freeradius/sql/mysql/nas.sql# For Ubuntu 18, use below...# mysql -u root -puser1234 radius < /etc/freeradius/3.0/mods-config/sql/main/mysql/schema.sql |
1
2
3
4
5
| mysql -uroot -puser1234use radius;INSERT INTO radcheck ( id , UserName , Attribute , op , Value ) VALUES ( NULL , 'zaib', 'Cleartext-Password', ':=', 'zaib');INSERT INTO radreply (username, attribute, op, value) VALUES ('zaib', 'Mikrotik-Rate-Limit', '==', '1024k/1024k');exit |
1
| nano /etc/freeradius/sql.conf file |
1
| readclients = yes |
1
2
3
4
5
6
| # Connection info:server = "localhost"#port = 3306login = "radius"password = "user1234"readclients = yes |
1
| nano /etc/freeradius/sites-enabled/default |
accounting# See “Authorization Queries” in sql.confsqlsession# See “Authorization Queries” in sql.confsqlPost-Auth-Type# See “Authorization Queries” in sql.confsql
1
| nano /etc/freeradius/radiusd.conf |
$INCLUDE sql.conf
1
| nano /etc/freeradius/sites-available/default |
# See “Authorization Queries” in sql.conf
# See “Authorization Queries” in sql.confsql
1
| nano /etc/freeradius/clients.conf |
1
2
3
4
| client 10.11.11.255 {secret = 12345shortname = Mikrotik} |
1
| /etc/init.d/freeradius stop |
1
| freeradius -X |
1
| radtest user userlocalhost 1812 testing123 |
1
2
3
4
5
6
7
8
9
| root@ubuntu:~# radtest user user localhost 1812 testing123Sending Access-Request of id 38 to 127.0.0.1 port 1812User-Name = "user"User-Password = "user"NAS-IP-Address = 10.11.11.245NAS-Port = 1812rad_recv: Access-Accept packet from host 127.0.0.1 port 1812, id=38, length=39Mikrotik-Rate-Limit = "1024k/1024k" |
1
| echo "User-Name = user, Password = user, Calling-Station-Id =00:0C:29:35:F8:2F" | radclient -s localhost:1812 auth testing123 |
1
2
3
4
5
6
7
| root@apnaradius:~# echo "User-Name = user, Password = user, Calling-Station-Id =00:0C:29:35:F8:2F" | radclient -s localhost:1812 auth testing123Received response ID 101, code 3, length = 56Reply-Message = "user- Your account has expired. \r\n"Total approved auths: 0Total denied auths: 1Total lost auths: 0 |
Dear all, Kindly Check Out skynetconsult.in For More Blog. Regards, skynetConsultacy.