{"id":6241,"date":"2017-06-23T14:52:01","date_gmt":"2017-06-23T06:52:01","guid":{"rendered":"https:\/\/kyle.ai\/blog\/?p=6241"},"modified":"2017-06-23T14:52:01","modified_gmt":"2017-06-23T06:52:01","slug":"%e5%a6%82%e4%bd%95%e6%89%8b%e5%8a%a8%e6%90%ad%e5%bb%bawpa2%e4%bc%81%e4%b8%9a%e7%ba%a7%e8%ae%a4%e8%af%81%e7%9a%84wi-fi","status":"publish","type":"post","link":"https:\/\/kyle.ai\/blog\/6241.html","title":{"rendered":"\u5982\u4f55\u624b\u52a8\u642d\u5efaWPA2\u4f01\u4e1a\u7ea7\u8ba4\u8bc1\u7684Wi-Fi"},"content":{"rendered":"<p>\u76f8\u6bd4\u666e\u901a\u7684wifi\uff0c\u642d\u5efawpa2\u4f01\u4e1a\u7ea7\u8ba4\u8bc1\u7684wifi\uff0c\u4e3b\u8981\u6709\u4e24\u4e2a\u5927\u7684\u6b65\u9aa4\uff1a<\/p>\n<ol>\n<li>\u7528freeradius\u642d\u5efa\u4e00\u4e2a\u8ba4\u8bc1\u7cfb\u7edf\uff0c\u7528\u4e8e\u7528\u6237\u8ba4\u8bc1<\/li>\n<li>\u5728\u8def\u7531\u5668\u6216AP\u4e0a\u914d\u7f6eRADIUS\u8ba4\u8bc1\u53c2\u6570\uff0c\u6dfb\u52a0radius\u670d\u52a1\u5668\uff0c\u5305\u62ec\u8ba4\u8bc1\u670d\u52a1\u5668\u548c\u8ba1\u8d39\u670d\u52a1\u5668\u3002<\/li>\n<\/ol>\n<h1>\u5b89\u88c5freeradius<\/h1>\n<p>\u6211\u521a\u5f00\u59cb\u7528\u7684\u662fapt-get\u5b89\u88c5\uff0c\u7136\u540e\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u7684\u65b9\u5f0f\uff0c\u53ef\u4ee5\u53c2\u8003\uff1a<\/p>\n<p>https:\/\/www.packet6.com\/install-freeradius-ubuntu-server\/<\/p>\n<p>\u914d\u7f6e\u5c24\u5176\u590d\u6742\uff0c\u6211\u641e\u4e86\u534a\u5929\u3002<\/p>\n<p>\u4e0e\u5176\u624b\u52a8\u914d\u7f6e\uff0c\u4e0d\u5982\u7528docker\u6765\u62c9\u53d6\u522b\u4eba\u914d\u7f6e\u597d\u7684\u955c\u50cf\u3002<\/p>\n<p>\u6700\u540e\u6211\u662f\u7528\u7684\u8fd9\u4e2adocker\u914d\u7f6e\uff1a<\/p>\n<p>https:\/\/github.com\/marcelmaatkamp\/docker-compose-applications\/tree\/master\/freeradius<\/p>\n<p>\u53ea\u9700\u8981\u4fee\u6539clients.conf\u548cusers\u6587\u4ef6\u3002<\/p>\n<p>\u4fee\u6539clients.conf\uff1a<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nclient 10.255.255.1\/24 {\r\n secret = your_secrect\r\n}\r\nclient 192.168.0.45 {\r\n secret = your_secrect\r\n}\r\n<\/pre>\n<p>\u5176\u4e2dip\uff0c192.168.0.45\u548c10.255.255.1\/24\u4fee\u6539\u6210\u4f60\u81ea\u5df1\u7684ip\uff0c\u5e94\u8be5\u914d\u7f6e\u6210\u4f60wifi\u8def\u7531\u5668\u6216AP\u7684ip\u5730\u5740\uff0c\u56e0\u4e3a\u5230\u65f6\u5019\u7528\u6237\u8fde\u63a5wifi\u65f6\uff0c\u662f\u8def\u7531\u5668\u548cAP\u6765\u8bf7\u6c42radius\u670d\u52a1\u5668\u7684\u3002<\/p>\n<p>\u4fee\u6539users:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nusername Cleartext-Password := &quot;user_password&quot;, MS-CHAP-Use-NTLM-Auth := 0\r\n<\/pre>\n<p>\u5176\u4e2d\u7528\u6237\u540d\u4e0e\u5bc6\u7801\u4fee\u6539\u6210\u4f60\u81ea\u5df1\u7684\u3002\u8fd9\u4e2a\u7528\u6237\u5bc6\u7801\u5c31\u662f\u666e\u901a\u7528\u6237\u8fde\u63a5\u8be5wifi\u65f6\uff0c\u9700\u8981\u8f93\u5165\u7684\u8ba4\u8bc1\u4fe1\u606f\u3002<\/p>\n<p>\u6211\u914d\u7f6e\u4e86\u53e6\u4e00\u53f0192.168.0.45 ubuntu\uff0c\u7528\u6765\u505a\u6d4b\u8bd5\uff0cssh\u767b\u9646\u5230 192.168.0.45\u4e0a\u9762\uff0c\u7136\u540e\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u6d4b\u8bd5\uff1a<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nradtest username user_password 192.168.0.30 1812 your_secrect\r\n<\/pre>\n<p>\u5176\u4e2d 192.168.0.30 \u4e3a\u6211\u4eecradius\u670d\u52a1\u5668\u6240\u5728\u7684ip\u5730\u5740\u3002<\/p>\n<p>\u8fde\u63a5\u6210\u529f\u540e\uff0c\u4f1a\u6709\u5982\u4e0b\u63d0\u793a\uff1a<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nSending Access-Request of id 168 to 192.168.0.30 port 1812\r\n\tUser-Name = &quot;username&quot;\r\n\tUser-Password = &quot;user_password&quot;\r\n\tNAS-IP-Address = 127.0.1.1\r\n\tNAS-Port = 1812\r\n\tMessage-Authenticator = 0x00000000000000000000000000000000\r\nrad_recv: Access-Accept packet from host 192.168.0.30 port 1812, id=168, length=20\r\n<\/pre>\n<p>\u5b89\u88c5\u597dradius\u670d\u52a1\u5668\u540e\uff0c\u5c31\u9700\u8981\u5728\u8def\u7531\u5668\u4e0a\u914d\u7f6ewifi\u7684\u8ba4\u8bc1\u65b9\u6cd5\u4e86\u3002<\/p>\n<h1>\u914d\u7f6e\u8def\u7531\u6216AP<\/h1>\n<p>\u6211\u662f\u7528\u7684H3C\u7684AP\u8bbe\u5907\uff0c\u4f60\u81ea\u5df1\u7684\u8def\u7531\u6216AP\u8bbe\u5907\uff0c\u53ef\u80fd\u4e0d\u592a\u4e00\u6837\u3002<\/p>\n<p>\u6211\u53c2\u8003\u7684\u662f\u6587\u6863\uff1a<\/p>\n<p>http:\/\/www.h3c.com\/cn\/Service\/Document_Center\/Wlan\/WA\/WA2600\/Configure\/User_Manual\/H3C_WCG-6W105\/201611\/958733_30005_0.htm<\/p>\n<p>\u9996\u5148\u5728\u5de6\u8fb9\u83dc\u5355\u8fdb\u5165 \u8ba4\u8bc1-&gt;RADIUS\uff0c\u65b0\u5efa\u4e00\u4e2a<\/p>\n<ul>\n<li>\u670d\u52a1\u7c7b\u578b\u9009\u62e9 Extended<\/li>\n<li>\u7528\u6237\u540d\u683c\u5f0f\u9009\u62e9 \u4fdd\u6301\u7528\u6237\u539f\u8f93\u5165<\/li>\n<li>\u5206\u522b\u6dfb\u52a0\u4e00\u4e2a\u4e3b\u8ba4\u8bc1\u670d\u52a1\u5668\uff0c\u4e0e\u4e3b\u8ba1\u8d39\u670d\u52a1\u5668\uff0cip\u5730\u5740\u5373\u4e3a\u6211\u4eec\u4e0a\u9762\u914d\u7f6e\u597d\u7684radius server\u7684ip\u5730\u5740\uff0c\u5bc6\u94a5\u4e3a\u521a\u6211\u4eec\u5728clients.conf\u6587\u4ef6\u4e2d\u914d\u7f6e\u7684secrect\u503c\u3002<\/li>\n<\/ul>\n<p><a href=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2017\/06\/1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6242\" src=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2017\/06\/1.png\" alt=\"1\" width=\"2080\" height=\"960\" \/><\/a><\/p>\n<p>\u5de6\u8fb9\u83dc\u5355\u8fdb\u5165 \u8ba4\u8bc1-&gt;AAA<\/p>\n<ul>\n<li>\u5728\u8ba4\u8bc1\u3001\u6388\u6743\u3001\u8ba1\u8d39\u4e09\u4e2a\u914d\u7f6e\u9875\u9762\u4e2d\uff0c\u90fd\u8bbe\u7f6eLAN-access\u8ba4\u8bc1\u4e3aRADIUS\uff0c\u53c2\u8003\u5982\u56fe\uff1a<\/li>\n<\/ul>\n<p><a href=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2017\/06\/2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6243\" src=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2017\/06\/2.png\" alt=\"2\" width=\"1410\" height=\"642\" \/><\/a><\/p>\n<p>\u5de6\u8fb9\u83dc\u5355\u8fdb\u5165 \u65e0\u7ebf\u670d\u52a1-&gt;\u63a5\u5165\u670d\u52a1<\/p>\n<ul>\n<li>\u9009\u62e9\u4f60\u8981\u4fee\u6539\u7684SSID\uff0c\u5148\u628awifi\u5173\u95ed\u6389\uff0c\u7136\u540e\u4fee\u6539\u8bbe\u7f6e<\/li>\n<li>\u5728\u5b89\u5168\u8bbe\u7f6e\u4e0b\u9762\u7684\u7aef\u53e3\u5b89\u5168\u914d\u7f6e\u4e2d\uff0c\u7aef\u53e3\u6a21\u5f0f\u9009\u62e9 userlogin-secure-ext<\/li>\n<li>\u57df\u540d\u9009\u62e9system\uff0c\u8ba4\u8bc1\u65b9\u6cd5\u9009\u62e9EAP<\/li>\n<\/ul>\n<p><a href=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2017\/06\/3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6244\" src=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2017\/06\/3.png\" alt=\"3\" width=\"1514\" height=\"700\" \/><\/a><\/p>\n<p>\u4fdd\u5b58\u540e\uff0c\u91cd\u65b0\u542f\u7528wifi\uff0c\u4e0d\u51fa\u610f\u5916\uff0cwpa2\u4f01\u4e1a\u7ea7\u8ba4\u8bc1\u5c31\u53ef\u4ee5\u8fde\u63a5\u4e86\u3002<\/p>\n<p>\u5982\u679c\u8fde\u63a5\u6709\u95ee\u9898\uff0c\u53ef\u4ee5\u7528<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo freeradius -X\r\n<\/pre>\n<p>\u547d\u4ee4\u6765\u542f\u52a8radius\uff0c\u5f00\u542f\u8c03\u8bd5\u6a21\u5f0f\uff0c\u5e76\u89c2\u5bdf\u65e5\u5fd7\u8f93\u51fa\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u76f8\u6bd4\u666e\u901a\u7684wifi\uff0c\u642d\u5efawpa2\u4f01\u4e1a\u7ea7\u8ba4\u8bc1\u7684wifi\uff0c\u4e3b\u8981\u6709\u4e24\u4e2a\u5927\u7684\u6b65\u9aa4\uff1a \u7528freeradius\u642d\u5efa\u4e00\u4e2a\u8ba4\u8bc1 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-6241","post","type-post","status-publish","format-standard","hentry","category-skill"],"_links":{"self":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/6241","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/comments?post=6241"}],"version-history":[{"count":1,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/6241\/revisions"}],"predecessor-version":[{"id":6245,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/6241\/revisions\/6245"}],"wp:attachment":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/media?parent=6241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/categories?post=6241"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/tags?post=6241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}