한국어

네트워킹

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

조회 수 :
152848
등록일 :
2013.04.19
17:05:28 (*.160.42.88)
엮인글 :
http://www.webs.co.kr/index.php?document_srl=19900&act=trackback&key=bec
게시글 주소 :
http://www.webs.co.kr/index.php?document_srl=19900
List of Articles
번호 제목 글쓴이 날짜 조회 수sort
63 ftp 파일전송 여러파일을 한번에 통째로 전송 admin 2011-12-16 37515
62 스트리밍서버 / 윈도우서버 admin 2011-12-16 37425
61 리눅스 tar 압축 백업복원시 소유자 문제해결 admin 2011-12-16 37026
60 Deploying FreeRADIUS with the MySQL Cluster Database file admin 2013-03-22 36932
59 Start / Stop and Restart Apache 2 Web Server Command 아파치 시작 스톱 명령어 admin 2019-04-08 36791
58 How to start GUI from command line? admin 2014-12-21 36712
57 리눅스 시작시 부팅 시, 프로그램 자동실행 등록하기 admin 2017-08-30 36394
56 WinXP 부팅안되는 현상 NTLDR is missing 메세지 admin 2012-07-12 36169
55 Cloned VMware CentOS6 Server "device eth0 does not seem to be present, admin 2017-08-29 35841
54 Using Windows RDP to Access your Ubuntu Instance admin 2014-12-21 34773
53 문서 편집기 vi vim command 명령어 정리 admin 2014-10-29 33997
52 검색 파일리스트 만든 다음 여러파일 한방에 압축하기 admin 2012-02-14 32856
51 Linux Memory Management – Virtual Memory and Demand Paging admin 2014-03-03 32746
50 [리눅스] 부팅 시 자동 실행 프로그램 등록|작성자 나눔HN admin 2018-06-01 32473
49 리눅스 시스템 유저 추가 명령어 useradd 사용하기 admin 2014-08-09 32271
48 윈도우 ssh 접속 프로그램 admin 2017-09-29 31366
47 Name Server 설정및 이해 admin 2011-12-13 31357
46 리눅스의 막강한 네트워크 필터 iptables admin 2012-04-15 31342
45 Remote Desktop Connection from Windows 7/8 to Ubuntu 14.04 admin 2014-12-21 31278
44 [리눅스] 소프트웨어 레이드의 리빌딩 및 리싱킹 속도를 높이는 5가지 방법 admin 2014-10-17 30828
43 debian 8.8 download cd1 cd2 cd3 etc admin 2017-09-03 30596
42 VMWARE VM Error boot loader install grub - install /dev/sda or /dev/hda MBR linux admin 2016-01-27 30511
41 Install GUI on Ubuntu Server admin 2014-12-21 30325
40 무료백신 여러가지 분류해놓은곳 admin 2011-12-16 30279
39 Event IP 20187 admin 2013-04-08 30274
38 Wireshark admin 2011-12-16 29981
37 zip 압축 파일 및 텍스트 파일의 한글 깨짐 해결 방법 admin 2018-03-28 29971
36 다양한 사운드 파일있는곳 admin 2011-12-19 29846
35 Linux and Unix touch command admin 2015-11-15 28653
34 /bin/false, /sbin/nologin 의 차이점 admin 2014-10-13 28340