<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sébastien Wains &#187; RADIUS</title>
	<atom:link href="http://www.wains.be/index.php/category/radius/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wains.be</link>
	<description>Linux, Open Source, VoIP and other stuff</description>
	<lastBuildDate>Tue, 07 Sep 2010 21:25:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Local user authentication with FreeRADIUS</title>
		<link>http://www.wains.be/index.php/2010/01/25/local-user-authentication-with-freeradius/</link>
		<comments>http://www.wains.be/index.php/2010/01/25/local-user-authentication-with-freeradius/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 19:26:47 +0000</pubDate>
		<dc:creator>Sébastien Wains</dc:creator>
				<category><![CDATA[Debian/Ubuntu]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[RADIUS]]></category>
		<category><![CDATA[Wifi]]></category>

		<guid isPermaLink="false">http://www.wains.be/?p=934</guid>
		<description><![CDATA[This one is a bit less complex than http://www.wains.be/index.php/2009/09/13/wpa2-freeradius-eap-tls/ This is actually the most basic RADIUS configuration ever, useful for quick tests. I can only recommend checking the post mentioned above if you want to do something serious. # apt-get install freeradius # vim /etc/freeradius/users login Cleartext-Password := "password" login2 Cleartext-Password := "password2" #vim /etc/freeradius/clients.conf [...]]]></description>
			<content:encoded><![CDATA[<p>This one is a bit less complex than <a href="http://www.wains.be/index.php/2009/09/13/wpa2-freeradius-eap-tls/">http://www.wains.be/index.php/2009/09/13/wpa2-freeradius-eap-tls/</a></p>
<p>This is actually the most basic RADIUS configuration ever, useful for quick tests. I can only recommend checking the post mentioned above if you want to do something serious. </p>
<p><code># apt-get install freeradius</code></p>
<pre><code># vim /etc/freeradius/users

login     Cleartext-Password := "password"
login2     Cleartext-Password := "password2"</code></pre>
<pre><code>#vim /etc/freeradius/clients.conf

client localhost {
	ipaddr = 127.0.0.1
        secret = radiuspassword
}

client router {
	ipaddr = 10.0.0.1
        secret = radiuspassword
}</code></pre>
<p><code># /etc/init.d/freeradius restart</code></p>
<p>Check if RADIUS is working :</p>
<p><code># radtest login password localhost 1812 radiuspassword<br />
Sending Access-Request of id 222 to 127.0.0.1 port 1812<br />
	User-Name = "login"<br />
	User-Password = "password"<br />
	NAS-IP-Address = 127.0.1.1<br />
	NAS-Port = 1812<br />
rad_recv: Access-Accept packet from host 127.0.0.1 port 1812, id=222, length=20</code></p>
<p><code># radtest login2 password2 localhost 1812 radiuspassword<br />
Sending Access-Request of id 1 to 127.0.0.1 port 1812<br />
	User-Name = "login2"<br />
	User-Password = "password2"<br />
	NAS-IP-Address = 127.0.1.1<br />
	NAS-Port = 1812<br />
rad_recv: Access-Accept packet from host 127.0.0.1 port 1812, id=1, length=20</code></p>
<p>We expect Access-Accept from the server, not Access-Reject&#8230;</p>
<p><strong>Configure your wireless access point :</strong></p>
<p>Usually found under Security tab (or RADIUS, 802.1X, etc.)<br />
Configure your device at 10.0.0.1 to authenticate against the Radius server with password radiuspassword.<br />
Try to connect to your wireless access point using login and password.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wains.be/index.php/2010/01/25/local-user-authentication-with-freeradius/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WPA2 + FreeRADIUS + EAP-TLS</title>
		<link>http://www.wains.be/index.php/2009/09/13/wpa2-freeradius-eap-tls/</link>
		<comments>http://www.wains.be/index.php/2009/09/13/wpa2-freeradius-eap-tls/#comments</comments>
		<pubDate>Sun, 13 Sep 2009 18:08:26 +0000</pubDate>
		<dc:creator>Sébastien Wains</dc:creator>
				<category><![CDATA[Debian/Ubuntu]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[RADIUS]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Wifi]]></category>

		<guid isPermaLink="false">http://www.wains.be/?p=791</guid>
		<description><![CDATA[Tested under Debian Lenny BUILDING AND INSTALLING FREERADIUS WITH TLS SUPPORT Install the necessary packages : apt-get install dpkg-dev fakeroot Download the source : cd /root mkdir freeradius-tls cd freeradius-tls apt-get source freeradius Make the changes : Edit /root/freeradius-tls/debian/rules : and change --with by --without for eap_tls, eap_ttls, eap_peap and openssl Just as : --with-rlm_eap_tls [...]]]></description>
			<content:encoded><![CDATA[<p><em>Tested under Debian Lenny</em></p>
<p><strong>BUILDING AND INSTALLING FREERADIUS WITH TLS SUPPORT</strong></p>
<p><strong>Install the necessary packages :</strong></p>
<p><code>apt-get install dpkg-dev fakeroot</code></p>
<p><strong>Download the source :</strong></p>
<p><code>cd /root<br />
mkdir freeradius-tls<br />
cd freeradius-tls<br />
apt-get source freeradius</code></p>
<p><strong>Make the changes :</strong></p>
<p>Edit /root/freeradius-tls/debian/rules :</p>
<p>and change<br />
<code>--with</code><br />
by<br />
<code>--without </code><br />
for eap_tls, eap_ttls, eap_peap and openssl</p>
<p>Just as :<br />
<code>--with-rlm_eap_tls \<br />
--with-rlm_eap_ttls \<br />
--with-rlm_eap_peap \<br />
--without-rlm_eap_tnc \<br />
--without-rlm_otp \<br />
--with-rlm_sql_postgresql_lib_dir=`pg_config --libdir`\<br />
--with-rlm_sql_postgresql_include_dir=`pg_config --includedir` \<br />
--with-openssl \<br />
--without-rlm_eap_ikev2 \<br />
--without-rlm_sql_oracle \<br />
--without-rlm_sql_unixodbc \</code></p>
<p>Then, comment the following :<br />
<code>for pkg in ${pkgs} ; do \<br />
if dh_shlibdeps -p $$pkg -- -O 2&gt;/dev/null | grep -q libssl; then \<br />
echo "$$pkg links to openssl" ;\<br />
exit 1 ;\<br />
fi ;\<br />
done</code></p>
<p>Edit /root/freeradius-tls/debian/control :<br />
On the line beginning by &#8220;Build-Depends&#8221;<br />
Add the folowing :<br />
<code>", libssl-dev" </code><br />
at the end of the line (without the quotes)</p>
<p>Install dev libraries :<br />
<code>apt-get install libssl-dev debhelper libgdbm-dev libiodbc2-dev libkrb5-dev libldap2-dev libltdl3-dev libmysqlclient15-dev libpam0g-dev libpcap-dev libperl-dev libpq-dev libsasl2-dev libsnmp-dev python-dev</code></p>
<p>Build freeradius :<br />
<code>dpkg-buildpackage -rfakeroot</code></p>
<p>Building will end by a warning message, this is not important.</p>
<p>Put the packages on hold to avoid upgrading with a non-TLS version of FreeRADIUS  :</p>
<p><code>echo “freeradius hold” | dpkg --set-selections<br />
echo "libfreeradius2 hold" | dpkg --set-selections<br />
echo "freeradius-common hold" | dpkg --set-selections</code></p>
<p>Install the packages we&#8217;ve just built :<br />
<code>dpkg --install freeradius-common_2.0.4+dfsg-6_all.deb libfreeradius2_2.0.4+dfsg-6_i386.deb</code></p>
<p><strong>CERTIFICATES </strong></p>
<p><strong>Creating the CA</strong></p>
<p><code>apt-get install openssl</code></p>
<p>Edit /etc/ssl/openssl.cnf</p>
<p><code>[ CA_default ]<br />
dir = ./PKI</code></p>
<p>Edit /usr/lib/ssl/misc/CA.sh</p>
<p><code>CATOP=./PKI</code></p>
<p>Then type :</p>
<p><code>cd /etc/ssl<br />
/usr/lib/ssl/misc/CA.sh -newca</code></p>
<p>Set a challenge password and a passphrase. This is needed.<br />
The CA created will be copied to the server and clients later on.</p>
<p><strong>Optional : if you have Windows XP clients</strong></p>
<p>Create /etc/openssl/PKI/xpextensions</p>
<pre><code>[xpclient_ext]
extendedKeyUsage=1.3.6.1.5.5.7.3.2

[xpserver_ext]
extendedKeyUsage=1.3.6.1.5.5.7.3.1</code></pre>
<p><strong>Server certificate signing request :</strong></p>
<p><code>cd /etc/ssl<br />
openssl req -new -nodes -keyout PKI/server_key.pem -out PKI/server_req.pem -days 730 -config openssl.cnf</code></p>
<p>Set a challenge password</p>
<p><strong>Sign the server certificate request (if winxp clients) :</strong><br />
<code>cd /etc/ssl<br />
openssl ca -config openssl.cnf -policy policy_anything -out PKI/server_cert.pem -extensions xpserver_ext -extfile PKI/xpextensions -infiles PKI/server_req.pem</code></p>
<p><strong>Mac clients :</strong><br />
<code>openssl ca -config openssl.cnf -policy policy_anything -out PKI/server_cert.pem -infiles PKI/server_req.pem</code></p>
<p>Then :<br />
<code>cp server_cert.pem server_cert.pem-backup</code></p>
<p>Edit server_cert.pem<br />
Remove everything before the line &#8212;&#8211;BEGIN CERTIFICATE&#8212;&#8211; (this is needed for winxp clients)</p>
<p>Next :<br />
<code>cat server_key.pem server_cert.pem &gt; server_keycert.pem</code></p>
<p><strong>Create a client certificate signing request :</strong><br />
<code>cd /etc/ssl<br />
openssl req -new -keyout PKI/client_key.pem -out PKI/client_req.pem -days 730 -config openssl.cnf</code></p>
<p><strong>Sign client cert request :</strong><br />
<code>cd /etc/ssl</code><br />
Windows xp client :<br />
<code>openssl ca -config openssl.cnf -policy policy_anything -out PKI/client_cert.pem -extensions xpclient_ext -extfile PKI/xpextensions -infiles PKI/client_req.pem</code><br />
Mac OS X client :<br />
<code>openssl ca -config openssl.cnf -policy policy_anything -out PKI/client_cert.pem -infiles PKI/client_req.pem</code></p>
<p><strong>Export P12 certs (Windows and Mac clients ) :</strong></p>
<p><code>openssl pkcs12 -export -in client_cert.pem -inkey client_key.pem -out client_cert.p12 -clcerts</code></p>
<p><strong>FREERADIUS CONFIG</strong></p>
<p><strong>FreeRadius</strong></p>
<p>Do :<br />
<code>cp /etc/ssl/PKI/cacert.pem /etc/freeradius/certs/cacert.pem<br />
cp /etc/ssl/PKI/server_keycert.pem /etc/freeradius/certs/server_keycert.pem</code></p>
<p>Then :<br />
<code>cd /etc/freeradius/certs<br />
openssl dhparam -check -text -5 512 -out dh<br />
dd if=/dev/urandom of=random count=2<br />
chown freerad dh<br />
chmod o-w dh</code></p>
<p>Next :<br />
<code>cp /etc/freeradius/eap.conf /etc/freeradius/eap.conf-default</code></p>
<p>/etc/freeradius/eap.conf :</p>
<pre><code>eap {
        default_eap_type = tls
        timer_expire     = 60
        ignore_unknown_eap_types = no
        cisco_accounting_username_bug = no         

        tls {
                certdir = ${confdir}/certs
                cadir = ${confdir}/certs
                private_key_password = whatever
                private_key_file = ${certdir}/server_keycert.pem
                certificate_file = ${certdir}/server_keycert.pem
                CA_file = ${cadir}/cacert.pem
                dh_file = ${certdir}/dh
                random_file = ${certdir}/random
                fragment_size = 1024
                include_length = yes
                check_cert_cn = %{User-Name}
                cipher_list = "DEFAULT"
        }
} </code></pre>
<p><strong>Edit /etc/freeradius/clients.conf</strong></p>
<p>We will consider the access-point that will authenticate users against the RADIUS server has the IP 192.168.7.45 :</p>
<pre><code>client localhost {
        ipaddr = 127.0.0.1
        secret          = testing123
        require_message_authenticator = no
        nastype     = other     # localhost isn't usually a NAS...
}

client 192.168.7.45 {
        secret = suchasecurepassword
        shortname = linksys
}</code></pre>
<p><strong>Start FreeRADIUS :</strong><br />
<code>freeradius -X -f</code></p>
<p><strong>Set up wifi access point for authentication against our new RADIUS server</strong></p>
<p>It depends on your hardware here.<br />
You must usually go under the security panel of your device, where you can specify the IP/hostname and port of the RADIUS server, and the password (in our example : suchasecurepassword)</p>
<p><strong>Configure clients</strong></p>
<p>This will be the subject of a separate post as I will try to publish the method for all majors OSes (Linux, Mac and Windows) but don&#8217;t have much time for now.<br />
Stay tuned ! </p>
<p><strong>This post is a stripped down version of the following howto by my colleague Jérôme : </strong><br />
<a href="http://hanoteau.blogspot.com/2009/03/howto-setup-eap-tls-wpa-network-with.html">http://hanoteau.blogspot.com/2009/03/howto-setup-eap-tls-wpa-network-with.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wains.be/index.php/2009/09/13/wpa2-freeradius-eap-tls/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
