Source: Internet
Author: User
Tags freeradius

This document to learn the experimental environment, the content of experimental results are all in the computer room calibration, all correct.

System environment: RHEL6 x86_64 SELinux and iptables disabled
Software Download: http://Poptop.  SourceForge. Net/yum/stable/rhel 6/

Installation Configuration pptpd
Echo 1 >/proc/sys/net/ipv4/ip_forward
Yum Install Ppp-y
RPM-IVH pptpd-1.3.4-2.el6.x86_64.rpm
Configuration file for pptpd/etc/pptpd.conf
LOCALIP:PPTPD server IP address, which can be set to any IP address bound by the server
REMOTEIP: Sets the range of Ip addresses that are available for assignment after a client connects to PPTPD server
Add test User/etc/ppp/chap-secrets
#client Server Secret IP addresses
Yakexi pptpd Westos *
Note: The server name must match the name set in/ETC/PPP/OPTIONS.PPTPD, otherwise the login
Validation cannot be passed
Service PPTPD Start
Now you can test it with Yakexi!
Installation Configuration Freeradius
Yum Install Freeradius Freeradius-mysql freeradius-utils-y
Tar zxf ppp-2.4.5.tar.gz
CP ppp-2.4.5/pppd/plugins/radius/etc/*/etc/radiusclient
Add the RADIUS server address and password in the servers file
localhost Westos
Modify the radiusclient.conf file to ensure that all radiusclient-related paths in this file are
Beginning with the/etc/radiusclient. For example:
Modified to:
To modify/ETC/PPP/OPTIONS.PPTPD, add the following line:
Modify Clients.conf
Client localhost {
Secret = Westos (consistent with settings in/etc/radiusclient/servers)
Support MySQL
$INCLUDE sql.conf #去掉注释
Authorize {
Accounting {
Post-auth {
Database = "MySQL"
Driver = "Rlm_sql_mysql"
Server = "localhost"
Login = "radius"
Password = "Radpass"
radius_db = "radius"
Modify the/etc/raddb/sql/mysql/dialup.conf to remove the comment from the following line:
Simul_count_query = "SELECT count (*) \
From ${acct_table1} \
WHERE username = '%{sql-user-name} ' \
And Acctstoptime is NULL "
Yum install MySQL Mysql-server-y
Service mysqld Start
Mysqladmin Create Radius
MySQL Radius < Schema.sql
MySQL < Admin.sql
mysql> INSERT INTO radgroupreply (Groupname,attribute,op,value) values
(' User ', ' auth-type ', ': = ', ' Local ');
mysql> INSERT INTO radgroupreply (Groupname,attribute,op,value) values
(' User ', ' service-type ', ': = ', ' Framed-user ');
mysql> INSERT INTO radgroupreply (Groupname,attribute,op,value) values
(' User ', ' framed-ip-address ', ': = ', ' ');
mysql> INSERT INTO radgroupreply (Groupname,attribute,op,value) values
(' User ', ' framed-ip-netmask ', ': = ', ' ');
Mysql>insert into Radgroupcheck (groupname,attribute,op,value) values
(' User ', ' simultaneous-use ', ': = ', ' 1 '); (Limit one account can only be dialed once, optional)
mysql> INSERT INTO Radcheck (username,attribute,op,value) VALUES (' Test ', ' UserPassword ', ': = ', ' test '); (Add account test, password test)
mysql> INSERT INTO Radusergroup (username,groupname) VALUES (' Test ', ' user ');
Adding an account later requires only two steps above
Service RADIUSD Start
Service PPTPD Stop
Service PPTPD Start
Execute the command to test:
# radtest test test localhost 0 westos
Sending access-request of ID Port 1812
User-name = "Test"
User-password = "Test"
Nas-ip-address =
Nas-port = 0
Rad_recv:access-accept packet from host Port 1812, id=13, length=38
Service-type = Framed-user
Framed-ip-address =
Framed-ip-netmask =
To see the access-accept words means success.

Related Article

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.