한국어

네트워킹

온누리070 플레이스토어 다운로드
    acrobits softphone
     온누리 070 카카오 프러스 친구추가온누리 070 카카오 프러스 친구추가친추
     카카오톡 채팅 상담 카카오톡 채팅 상담카톡
    
     라인상담
     라인으로 공유

     페북공유

   ◎위챗 : speedseoul


  
     PAYPAL
     
     PRICE
     

pixel.gif

    before pay call 0088 from app



http://blog.naver.com/PostView.nhn?blogId=pcw4844&logNo=70132882598


FreeRADIUS 설치(freeradius-sever-2.1.8)

1. Confiture FreeRadius
#./configure --prefix=/usr/local/radius

 

2. 설치
#make

#make install

 

 

FreeRADIUS 기본 설정

1. Radius Server 세팅

vi /usr/local/radius/etc/raddb/radiusd.conf

 

listen  {

ipaddr = 192.168.11.8   -> radius 서버 ip

port = 1812            -> 수신 port 설정(udp 1812)

         interface = eth0        -> 해당 인터페이스로 수신/응답

}

 

2. Radius Client 세팅
vi /usr/local/radius/etc/raddb/clients.conf

client 192.168.1.0/24 {             -> NAS(radius 클라이언트, VPN ) IP 대역단일 IP도 가능

           secret      = netmania      

        nastype    = other

}

 

3. user 세팅
vi /usr/local/radius/etc/raddb/users

 

test01    Cleartext-Password := "test_01"   -> 인증 대상이 되는 사용자 ID/PW

 

4. Radius Server실행
#cd /usr/local/radius/sbin

#./radiusd -X    -> 디버그 모드로 실행로그가 바로 화면에 출력됨단 로그는 쌓이지 않음

#./radiusd       -> 백그라운드로 실행로그 저장 됨

5. 로그 저장 경로

#/usr/local/radius/var/log/radius/radius.log


MySQL 연동

 

1. DB에 저장 되는 부분

mysql과 연동 시 mysql DB에 저장 되는 내용은 /usr/local/radius/etc/raddb/users에서 설정해야

하는 내용으로 인증 대상이 되는 사용자 ID/PW 이다.

 

2. radiusd.conf 파일 설정

vi /usr/local/radius/etc/raddb/radiusd.conf

authorize {

       preprocess

       chap

       mschap

       suffix

       eap

       files

       sql

       pap

}

 

preacct {

       preprocess

       acct_unique

       suffix

       files

}

 

accounting {

       detail

       unix

       radutmp

       sql

}

-> , MODULE CONFIGURATION 앞에 추가 시킴

 

# PROXY CONFIGURATION

proxy_requests  = no     -> proxy는 테스트 전이며 이 설정은 안 해도 됨

 

 

# MODULE CONFIGURATION

modules {

$INCLUDE sql.conf          -> 주석 처리를 해제 하여, SQL 모듈이 동작되도록 함

}

 

3. sql.conf 파일 설정

vi /usr/local/radius/etc/raddb/sql.conf

 

sql {

           database = "mysql"

           server = "localhost"            -> mysql 서버 IP

           port = 3306

           login = "radius"               -> mysql 접속 ID

           password = "radpass"          -> mysql 접속 PW

           radius_db = "radius"           -> mysql 접속 DB 이름

}

 

4. MySQL 설정

- radius DB 생성

#mysql -uroot -prootpass

mysql> create database radius;

 

- radius DB에 접속 가능한 사용자 등록

mysql> GRANT ALL PRIVILEGES ON radius.* TO radius@localhost IDENTIFIED BY "radpass"WITH GRANT OPTION;                   -> 사용자 계정 등록

mysql> flush privileges;             -> 권한 로드

 

- radius DB Table 생성

freeradius-1.1.7

cd /usr/share/doc/packages/freeradius/doc/examples/

또는cd /usr/local/src/freeradius-1.1.7/doc/examples/

mysql -uroot -p radius < mysql.sql

Enter Password : ######

-> freeradius-1.1.7를 설치 했다면 해당 디렉토리 경로에 mysql.sql 파일이 있을 수 있다.

   하지만 테스트 한 버전 freeradius-2.1.8에서는 해당 경로에 mysql.sql이 없다.

freeradius-2.1.8

cd /usr/local/radius/etc/raddb/sql/mysql

mysql -uroot -p radius < schema.sql

Enter Password : ######

 

 freeradius-1.1.7 freeradius-2.1.8는 생성되는 table 이름과 수에서도 약간 차이가 있음.

  우선적으로 차이가 나는 부분은 username groupname 필드를 가지고 있는 table인데freeradius-1.1.7은 ‘usergroup’, freeradius-2.1.8은 ‘radusergroup’이라는 table 이름을 가지고

  있음.

 

- Table field에 데이터 입력하기

#mysql -uroot -prootpass

mysql> use radius;

mysql> show tables;

+------------------+

| Tables_in_radius |

+------------------+

| radacct          |

| radcheck         |

| radgroupcheck    |

| radgroupreply    |

| radpostauth      |

| radreply         |

| radusergroup     |

+------------------+

 

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',':=','255.255.255.255');

mysql> insert into radgroupreply (groupname,attribute,op,value) values ('user','Framed-IP-Netmask',':=','255.255.255.0');

mysql> insert into radcheck (username,attribute,op,value) values ('test','User-Password',':=','test');

mysql> insert into radusergroup (username,groupname) values ('test','user');

-> local 서버에서 테스트 계정인 test(pw test)를 생성하기 위한 입력 데이터 값

 

5. Radius Server실행

#cd /usr/local/radius/sbin

#./radiusd -X

 

다음과 같은 에러가 발생 시

Fri Feb 19 22:10:46 2010 : Error: Could not link driver rlm_sql_mysql: /usr/lib/libmysqlclient_r.so.15:

cannot restore segment prot after reloc: Permission denied

Fri Feb 19 22:10:46 2010 : Error: Make sure it (and all its dependent libraries!) are in the search path of your system

's ld.

Fri Feb 19 22:10:46 2010 : Error: /usr/local/radius/etc/raddb/sql.conf[22]: Instantiation failed for module "sql"

Fri Feb 19 22:10:46 2010 : Error: /usr/local/radius/etc/raddb/radiusd.conf[649]: Failed to find module "sql".

Fri Feb 19 22:10:46 2010 : Error: /usr/local/radius/etc/raddb/radiusd.conf[641]: Errors parsing authorize section.

Fri Feb 19 22:10:46 2010 : Error: Failed to load virtual server <default>

-> 디버그 모드로 실행 시 밑줄 친 내용 처럼 에러가 발생 할 수 있음.

   SElinux에 의해 실행되지 않는 것으로 SElinux Disable 시킨다.

# vi /etc/sysconfig/selinux

 

# This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

#       enforcing - SELinux security policy is enforced.

#       permissive - SELinux prints warnings instead of enforcing.

#       disabled - No SELinux policy is loaded.

SELINUX=disabled

 

6. Radius Test

#cd /usr/local/radius/bin

#./radtest test test localhost 0 testing123

Sending Access-Request of id 62 to 127.0.0.1 port 1812

        User-Name = "test"

        User-Password = "test"

        NAS-IP-Address = 127.0.0.1

        NAS-Port = 0

rad_recv: Access-Accept packet from host 127.0.0.1 port 1812, id=62, length=38

        Service-Type = Framed-User

        Framed-IP-Address = 255.255.255.255

        Framed-IP-Netmask = 255.255.255.0

[출처] freeradius 설치|작성자 대장

조회 수 :
151536
등록일 :
2013.04.19
17:05:28 (*.160.42.88)
엮인글 :
http://webs.co.kr/index.php?document_srl=19900&act=trackback&key=c87
게시글 주소 :
http://webs.co.kr/index.php?document_srl=19900
List of Articles
번호 제목 글쓴이 날짜 조회 수
123 Tls ssl admin 2020-02-13 9540
122 Redis 소개와 설치 방법, 보안 설정 방법(ip 허용, 비밀번호 설정)등 빠르게 세팅하기 admin 2020-01-10 14495
121 debian Ubuntu 에서 Timezone 확인 및 변경하기 쉽게 간단하게 date time admin 2019-11-09 13981
120 Install Missing ifconfig Command on Debian ip address admin 2019-11-05 26101
119 데비안 vs 우분투 : 데스크탑과 서버로 비교 해외 글 과 댓글 admin 2019-10-31 25588
118 Debian vs Ubuntu: Compared as a Desktop and as a Server 데비안 vs 우분투 비교 admin 2019-10-31 15629
117 Error : unary operator expected – 쉘스크립트 타입관련 문법 admin 2019-09-14 22563
116 vi 에디터에서 ^M 문자 한번에 모두 지우기 ( ^M, ^L을 이해하자) admin 2019-06-20 14657
115 데비안 제시 jessie 소스리스트 sourcelist admin 2019-06-17 13487
114 File Descriptor (파일 디스크립터) 설명 무엇인가 사용방법 admin 2019-06-01 18048
113 Start / Stop and Restart Apache 2 Web Server Command 아파치 시작 스톱 명령어 admin 2019-04-08 36605
112 DebianPackageManagement admin 2019-04-08 11839
111 리눅스 우분투, 32비트 64비트 확인 명령어 admin 2019-01-06 16342
110 How to install a Debian 9 (Stretch) Minimal Server 데비안 9 설치 admin 2018-06-13 63199
109 Which is better, GCC or Clang? admin 2018-06-13 62513
108 고정ip설정, dns설정(데비안) linux 리눅스 admin 2018-06-13 19129
107 [리눅스] 부팅 시 자동 실행 프로그램 등록|작성자 나눔HN admin 2018-06-01 32249
106 리눅스 서버 유지보수 점검 메인터넌스 상황 파악 admin 2018-04-14 18166
105 Top 20 OpenSSH Server Best Security Practices 보안 대책 실제 적용 admin 2018-04-14 23103
104 Start Stop Restart Apache 2 Web Server Command Debian Ubuntu CentOS RHEL Fedora admin 2018-04-14 17591
103 리눅스 한글 2014 뷰어 다운로드 - hwpviewer admin 2018-03-28 19270
102 리눅스를 백업 복구 tar admin 2018-03-28 21409
101 zip 압축 파일 및 텍스트 파일의 한글 깨짐 해결 방법 admin 2018-03-28 29748
100 Lnux export how to admin 2017-12-17 23240
99 What's the difference between “adduser” and “useradd”? admin 2017-12-15 21911
98 useradd Command 리눅스 admin 2017-12-15 62575
97 How To Install Java with Apt-Get on Ubuntu 16.04 oracle java admin 2017-10-13 46864
96 우분투 Linux(Ubuntu)에 Java설치 및 환경 설정하는 방법 admin 2017-10-13 25215
95 우분투 다운로드 사이트 주소 ubuntu download 16.04.3 17.04 site link admin 2017-10-13 25861
94 How to install Java on linux with no Internet connectivity (using local repository) admin 2017-10-01 41748