한국어

네트워킹

온누리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 설치|작성자 대장

조회 수 :
151069
등록일 :
2013.04.19
17:05:28 (*.160.42.88)
엮인글 :
http://webs.co.kr/index.php?document_srl=19900&act=trackback&key=5e2
게시글 주소 :
http://webs.co.kr/index.php?document_srl=19900
List of Articles
번호 제목 글쓴이 날짜 조회 수
63 Ubuntu 14.04 원격 접속(xrdp) 설정 admin 2014-12-21 130539
62 Remote Desktop Connection from Windows 7/8 to Ubuntu 14.04 admin 2014-12-21 31057
61 Using Windows RDP to Access your Ubuntu Instance admin 2014-12-21 34567
60 Install GUI on Ubuntu Server admin 2014-12-21 30123
59 How to start GUI from command line? admin 2014-12-21 36527
58 Download all files in a directory using WGET admin 2014-12-16 24310
57 문서 편집기 vi vim command 명령어 정리 admin 2014-10-29 33832
56 find 명령 사용 예제들 admin 2014-10-29 23935
55 특정 IP 엑세스 못하게 하는방법 admin 2014-10-29 26474
54 scp 명령어를 이용한 파일 복사 및 전송 admin 2014-10-29 37649
53 [리눅스] 소프트웨어 레이드의 리빌딩 및 리싱킹 속도를 높이는 5가지 방법 admin 2014-10-17 30633
52 /bin/false, /sbin/nologin 의 차이점 admin 2014-10-13 28072
51 리눅스 시스템 유저 추가 명령어 useradd 사용하기 admin 2014-08-09 32094
50 리눅스 시스템 시작시에 자동 실행할 파일 등록하기 admin 2014-03-22 191641
49 linux 에티터 명령어 정리 포그라운드 전환 : ctrl + z 다시 vi 모드로 돌아오려면 fg admin 2014-03-05 126069
48 Linux Memory Management – Virtual Memory and Demand Paging admin 2014-03-03 32544
47 iptables rules tcp drop all port except tcp 22 admin 2014-02-26 81065
46 seagate HD 시게이트 하드 디스크 A/S 에이에스 기간 조회 및 받는 3가지 방법 admin 2013-12-09 37722
45 SSH Without Authentication Using Key Files (CentOS 5.6) admin 2013-11-22 38062
44 Getting started with SSH public key cryptography admin 2013-09-05 148043
43 암호 없이 SSH 접속하기 admin 2013-09-05 37552
42 Linux Date Command Examples to Display and Set System Date Time admin 2013-07-11 103182
» FreeRADIUS 설치(freeradius-sever-2.1.8) admin 2013-04-19 151069
40 Radius를 이용한 ssh 인증 서버 구축하기 admin 2013-04-19 97332
39 CentOS 5.4에서 RADIUS 서버 설치하기 admin 2013-04-19 141839
38 Event IP 20187 admin 2013-04-08 30055
37 리눅스에서 자바(JDK) 설치하기 admin 2013-04-08 38072
36 리눅스 네트워크 설정 멸령어 Linux admin 2013-04-08 37768
35 [linux]리눅스 버전및 CPU등 환경정보 확인하기 admin 2013-04-08 173140
34 Linux 시스템 백업과 복원 admin 2013-04-04 73001