Freeradius Beginner's Guide
Total Page:16
File Type:pdf, Size:1020Kb
www.it-ebooks.info FreeRADIUS Beginner's Guide Manage your network resources with FreeRADIUS Dirk van der Walt BIRMINGHAM - MUMBAI www.it-ebooks.info FreeRADIUS Beginner's Guide Copyright © 2011 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: September 2011 Production Reference: 1260811 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-849514-08-8 www.packtpub.com Cover Image by Asher Wishkerman ([email protected]) www.it-ebooks.info Credits Author Project Coordinator Dirk van der Walt Srimoyee Ghoshal Reviewers Proofreader Ante Gulam Chris Smith Atif Razzaq Indexers Acquisition Editor Hemangini Bari Chaitanya Apte Tejal Daruwale Development Editors Graphics Kartikey Pandey Nilesh Mohite Alina Lewis Production Coordinator Technical Editor Adline Swetha Jesuthas Vanjeet D'souza Cover Work Copy Editor Adline Swetha Jesuthas Neha Shetty www.it-ebooks.info About the Author Dirk van der Walt is an open source software specialist from Pretoria, South Africa. He is a firm believer in the potential of open source software. Being a Linux user for almost ten years, it was love at first boot. From then on Dirk spent his available time sharing his knowledge with others equally passionate about the freedom and affordability open source software gives to the community. In 2003, Dirk started coding with Perl as his language of choice and gave his full attention to functional and aesthetic user interface design. He also compiled an online Gtk2-Perl study guide to promote the advancement of Perl on the desktop. As Rich Internet Applications (RIA) became more popular, Dirk added the Dojo toolkit and CakePHP to his skills set to create an AJAX-style front-end to a FreeRADIUS MySQL database. His latest work is YFi Hotspot Manager. Today YFi Hotspot Manager is used in many localities around the globe. With many contributors to the project it proves just how well the open source software model can work. I'd like to thank the Lord Jesus for life and light, my wife Petra and daughter Daniélle for all their support and understanding, my brother Karel for his interest and help. I would also like to thank the people involved with the FreeRADIUS project, from the coders to the commenters. Lastly I'd like to thank Packt Publishing for supporting Open Source software the way they do. www.it-ebooks.info About the Reviewers Ante Gulam is a 26-year-old software and system engineer with more than seven years of working experience in various segments of the IT industry. He has worked as a consultant and system engineer on POSIX-compliant systems (Linux, BSD, SCO, and others), and lately has focused mainly on security, design, and administration of Microsoft-based enterprise solutions. Ante is currently working as a system engineer and software developer, primarily on MS platforms (.NET) in Ri-ing d.o.o., a medium-sized software development company. Being involved in security for several years Ante gained experience in the development of various security tools based on many different technologies and has written articles and co-edited Phearless Security Ezine actively for the last four years. Presently, he is working on large networking projects and enterprise environments; adopting them for standards like PCI-DSS enables him to stay in touch with security on the enterprise level. I would like to thank my family, my friends, and my girlfriend for the their patience. Also all the guys from the "gn00bz" team for all the hours full of fun and knowledge while playing CTF for the past couple of years. www.it-ebooks.info Atif Razzaq holds an MSc degree from Strathclyde University, Glasgow, UK in Communication, Control, and Digital Signal Processing, and a BSc degree in Computer Science from NUCES, Pakistan. After his MSc degree, he started his career as a software engineer in the area of Mobile Application Development in J2ME in Tricastmedia, Glasgow, UK. During this period he also published an article at Java.net titled Getting Started with BlackBerry J2ME Development. He is currently working as the Development Manager at Terminus Technologies who specializes in telecom billing software development. His responsibilities include the development of the billing system and its integration with other applications both proprietary and open source (Asterisk, FreeSwitch, FreeRADIUS, and others). Prior to joining Terminus Technologies, he worked on telecom billing at Comcerto, Bahrain. He has been working on telecom billing and VoIP/SIP Telephony for about three years. In his free time, he writes his own blog on different ICT topics available at http://atif- razzaq.blogspot.com. He can be contacted at [email protected]. It has been a great experience working on this project. I'd like to thank the whole team working on this project: the author and all members from Packt Publishing. I'd like to thank my family for giving up their share of time which I gave to this project. Finally, I'd thank the Great Lord for everything and then my parents who taught me and made me what I am. www.it-ebooks.info www.PacktPub.com Support files, eBooks, discount offers, and more You might want to visit www.PacktPub.com for support files and downloads related to your book. Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details. At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks. http://PacktLib.PacktPub.com Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read, and search across Packt's entire library of books. Why Subscribe? Fully searchable across every book published by Packt Copy and paste, print and bookmark content On demand and accessible via web browser Free Access for Packt account holders If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access. www.it-ebooks.info www.it-ebooks.info Table of Contents Preface 1 Chapter 1: Introduction to AAA and RADIUS 7 Authentication, Authorization, and Accounting 7 Authentication 8 Authorization 9 Accounting 9 RADIUS 10 RADIUS protocol (RFC2865) 11 The data packet 12 AVPs 15 Vendor-Specific Attributes (VSAs) 16 Proxying and realms 17 RADIUS server 17 RADIUS client 17 RADIUS accounting (RFC2866) 18 Operation 18 Packet format 18 Acct-Status-Type (Type40) 19 Acct-Input-Octets (Type42) 20 Acct-Output-Octets (Type43) 20 Acct-Session-Id (Type44) 21 Acct-Session-Time (Type46) 21 Acct-Terminate-Cause (Type49) 21 Conclusion 21 RADIUS extensions 21 Dynamic Authorization extension (RFC5176) 21 RADIUS support for EAP (RFC3579) 22 FreeRADIUS 23 History 23 Strengths 23 www.it-ebooks.info Table of Contents Weaknesses 24 The competition 24 Summary 25 Chapter 2: Installation 27 Before you start 27 Pre-built binary 28 Time for action – installing FreeRADIUS 29 Advantages 29 Extra packages 29 Available packages 30 CentOS 30 SUSE 30 Ubuntu 31 Special considerations 31 Remember the firewall 32 CentOS 32 SUSE 33 Building from source 34 Advantages of building packages 34 CentOS 34 Time for action – building CentOS RPMs 35 Installing rpm-build 36 The source RPM package 36 The package name 36 Updating an existing installation 37 SUSE 37 Time for action – SUSE: from tarball to RPMs 37 Adding an OpenSUSE repository 37 zypper or yast -i 39 Tweaks done by hand 40 Ubuntu 40 Time for action – Ubuntu: from tarball to debs 40 Installing dpkg-dev 42 Using build-dep 42 fakeroot 42 dpkg-buildpackage 42 Installing the debs 43 For those preferring the old school 43 Installed executables 43 Running as root or not 44 Dictionary access for client programs 44 Ensure proper start-up 45 Summary 46 [ ii ] www.it-ebooks.info Table of Contents Chapter 3: Getting Started with FreeRADIUS 49 A simple setup 50 Time for action – configuring FreeRADIUS 50 Configuring FreeRADIUS 52 Clients 52 Sections 52 Client identification 53 Shared secret 53 Message-Authenticator 54 Nastype 54 Common errors 54 Users 54 Files module 54 PAP module 55 Users file 55 Radtest 57 Helping yourself 57 Installed documentation 58 Man pages 58 Time for action – discovering available man pages for FreeRADIUS 58 Configuration file comments 60 Online documentation 61 Online help 62 Golden rules 62 Inside radiusd 62 Configuration files 62 Important includes 63 Libraries and dictionaries 63 FreeRADIUS-specific AVPs 64 Running as ..