{"id":422,"date":"2019-02-01T17:24:24","date_gmt":"2019-02-01T09:24:24","guid":{"rendered":"https:\/\/www.sumju.net\/?p=422"},"modified":"2019-02-01T17:24:24","modified_gmt":"2019-02-01T09:24:24","slug":"%e6%a0%91%e8%8e%93%e6%b4%be%e6%90%ad%e5%bb%ba%e5%81%9a%e6%97%a0%e7%ba%bf%e8%b7%af%e7%94%b1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/sumju.net\/?p=422","title":{"rendered":"\u6811\u8393\u6d3e\u642d\u5efa\u505a\u65e0\u7ebf\u8def\u7531\u5668"},"content":{"rendered":"<p style=\"margin: 0px 0px 12px; padding: 0px; font-size: 14px; line-height: 1.8em; color: rgba(0, 0, 0, 0.75); font-family: Georgia, 'Times New Roman', Times, sans-serif;\">\u53c2\u8003\u6559\u7a0b\uff1a<br \/>\n<a style=\"outline: none; border: 0px; color: #058c05; text-decoration-line: none;\" href=\"https:\/\/frillip.com\/using-your-raspberry-pi-3-as-a-wifi-access-point-with-hostapd\/\" target=\"_blank\" rel=\"noopener\">https:\/\/frillip.com\/using-your-raspberry-pi-3-as-a-wifi-access-point-with-hostapd\/<\/a><\/p>\n<p style=\"margin: 0px 0px 12px; padding: 0px; font-size: 14px; line-height: 1.8em; color: rgba(0, 0, 0, 0.75); font-family: Georgia, 'Times New Roman', Times, sans-serif;\"><a style=\"outline: none; border: 0px; color: #058c05; text-decoration-line: none;\" href=\"https:\/\/gist.github.com\/Lewiscowles1986\/fecd4de0b45b2029c390#file-rpi3-ap-setup-sh\" target=\"_blank\" rel=\"noopener\">https:\/\/gist.github.com\/Lewiscowles1986\/fecd4de0b45b2029c390#file-rpi3-ap-setup-sh<\/a><\/p>\n<h3 id=\"\u914d\u7f6e\u65e0\u7ebf\u70ed\u70b9\" style=\"padding: 0px 0px 5px; margin: 20px 0px 5px; font-size: 18px; border-bottom: 1px solid #dddddd; font-family: Georgia, 'Times New Roman', Times, sans-serif;\">\u914d\u7f6e\u65e0\u7ebf\u70ed\u70b9<a style=\"outline: none; border: 0px; color: #058c05; text-decoration-line: none;\" href=\"https:\/\/spaces.ac.cn\/archives\/3728#%E9%85%8D%E7%BD%AE%E6%97%A0%E7%BA%BF%E7%83%AD%E7%82%B9\">\u00a0#<\/a><\/h3>\n<p style=\"margin: 0px 0px 12px; padding: 0px; font-size: 14px; line-height: 1.8em; color: rgba(0, 0, 0, 0.75); font-family: Georgia, 'Times New Roman', Times, sans-serif;\">\u4e3b\u8981\u7528\u5230\u7684\u8f6f\u4ef6\u6709hostapd\u3001dnsmasq\uff1a<\/p>\n<pre class=\"line-numbers language-bash\" style=\"font-size: 13px; color: black; background: #f5f2f0; text-shadow: white 0px 1px; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; word-break: normal; overflow-wrap: normal; line-height: 1.5; tab-size: 4; hyphens: none; padding: 0.5em 0.5em 0.5em 3.5em; margin: 0.5em 0.5em 1em; overflow: auto; border: 1px solid #dddddd; position: relative; counter-reset: linenumber 0;\"><code class=\" language-bash\" style=\"color: black; background-image: none; background-color: initial; text-shadow: white 0px 1px; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; word-spacing: normal; word-break: normal; overflow-wrap: normal; line-height: 1.5; tab-size: 4; hyphens: none; position: relative;\"><span class=\"token function\" style=\"color: #dd4a68;\">sudo<\/span> <span class=\"token function\" style=\"color: #dd4a68;\">apt-get<\/span> <span class=\"token function\" style=\"color: #dd4a68;\">install<\/span> hostapd dnsmasq<\/code><\/pre>\n<p style=\"margin: 0px 0px 12px; padding: 0px; font-size: 14px; line-height: 1.8em; color: rgba(0, 0, 0, 0.75); font-family: Georgia, 'Times New Roman', Times, sans-serif;\">\u7136\u540e\u5728\/etc\/dnsmasq.conf\u672b\u52a0\u5165\uff08\u81ea\u5df1\u4fee\u6539IP\u548c\u7f51\u6bb5\uff0c\u8fd9\u4e2a\u6587\u4ef6\u662f\u5df2\u5b58\u5728\u7684\uff0c\u5f88\u8be6\u7ec6\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u4f46\u662f\u6240\u6709\u884c\u90fd\u52a0\u5165\u4e86#\u53f7\u6ce8\u91ca\u6389\uff09<\/p>\n<blockquote style=\"table-layout: fixed; word-break: break-word; overflow: hidden; background: #f2f2f2; font-size: 13px; border: 1px solid #dddddd; margin: 0.5em 0em 1em; padding: 10px 15px; line-height: 1.8em; font-family: Georgia, 'Times New Roman', Times, sans-serif;\"><p>interface=wlan0<br \/>\ndhcp-range=10.0.0.2,10.0.0.5,255.255.255.0,12h<\/p><\/blockquote>\n<p style=\"margin: 0px 0px 12px; padding: 0px; font-size: 14px; line-height: 1.8em; color: rgba(0, 0, 0, 0.75); font-family: Georgia, 'Times New Roman', Times, sans-serif;\">\u7136\u540e\u65b0\u5efa\/etc\/hostapd\/hostapd.conf\uff0c\u52a0\u5165<\/p>\n<blockquote style=\"table-layout: fixed; word-break: break-word; overflow: hidden; background: #f2f2f2; font-size: 13px; border: 1px solid #dddddd; margin: 0.5em 0em 1em; padding: 10px 15px; line-height: 1.8em; font-family: Georgia, 'Times New Roman', Times, sans-serif;\"><p>interface=wlan0<br \/>\nhw_mode=g<br \/>\nchannel=10<br \/>\nauth_algs=1<br \/>\nwpa=2<br \/>\nwpa_key_mgmt=WPA-PSK<br \/>\nwpa_pairwise=CCMP<br \/>\nrsn_pairwise=CCMP<br \/>\nwpa_passphrase=wifi\u5bc6\u7801<br \/>\nssid=wifi\u540d\u5b57<\/p><\/blockquote>\n<p style=\"margin: 0px 0px 12px; padding: 0px; font-size: 14px; line-height: 1.8em; color: rgba(0, 0, 0, 0.75); font-family: Georgia, 'Times New Roman', Times, sans-serif;\">\u63a5\u7740\u4fee\u6539\/etc\/sysctl.conf\uff0c\u66f4\u6539\uff08\u5982\u679c\u6709\u8fd9\u4e00\u884c\uff0c\u628a#\u53f7\u53bb\u6389\u5c31\u884c\uff09<\/p>\n<blockquote style=\"table-layout: fixed; word-break: break-word; overflow: hidden; background: #f2f2f2; font-size: 13px; border: 1px solid #dddddd; margin: 0.5em 0em 1em; padding: 10px 15px; line-height: 1.8em; font-family: Georgia, 'Times New Roman', Times, sans-serif;\"><p>net.ipv4.ip_forward=1<\/p><\/blockquote>\n<p style=\"margin: 0px 0px 12px; padding: 0px; font-size: 14px; line-height: 1.8em; color: rgba(0, 0, 0, 0.75); font-family: Georgia, 'Times New Roman', Times, sans-serif;\">\u6700\u540e\uff0c\u5c06\u4e0b\u9762\u811a\u672c\u52a0\u5165\u5230\/etc\/rc.local\u7684exit 0\u524d\uff1a<\/p>\n<pre class=\"line-numbers language-bash\" style=\"font-size: 13px; color: black; background: #f5f2f0; text-shadow: white 0px 1px; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; word-break: normal; overflow-wrap: normal; line-height: 1.5; tab-size: 4; hyphens: none; padding: 0.5em 0.5em 0.5em 3.5em; margin: 0.5em 0.5em 1em; overflow: auto; border: 1px solid #dddddd; position: relative; counter-reset: linenumber 0;\"><code class=\" language-bash\" style=\"color: black; background-image: none; background-color: initial; text-shadow: white 0px 1px; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; word-spacing: normal; word-break: normal; overflow-wrap: normal; line-height: 1.5; tab-size: 4; hyphens: none; position: relative;\"><span class=\"token function\" style=\"color: #dd4a68;\">ifconfig<\/span> wlan0 down\r\n<span class=\"token function\" style=\"color: #dd4a68;\">ifconfig<\/span> wlan0 10.0.0.1 netmask 255.255.255.0 up\r\niwconfig wlan0 power off\r\n<span class=\"token function\" style=\"color: #dd4a68;\">service<\/span> dnsmasq restart\r\nhostapd -B \/etc\/hostapd\/hostapd.conf <span class=\"token operator\" style=\"color: #a67f59; background: rgba(255, 255, 255, 0.5);\">&amp;<\/span> <span class=\"token operator\" style=\"color: #a67f59; background: rgba(255, 255, 255, 0.5);\">&gt;<\/span> \/dev\/null 2<span class=\"token operator\" style=\"color: #a67f59; background: rgba(255, 255, 255, 0.5);\">&gt;<\/span><span class=\"token operator\" style=\"color: #a67f59; background: rgba(255, 255, 255, 0.5);\">&amp;<\/span>1\r\n<span class=\"token function\" style=\"color: #dd4a68;\">sudo<\/span> iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE  \r\n<span class=\"token function\" style=\"color: #dd4a68;\">sudo<\/span> iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT  \r\n<span class=\"token function\" style=\"color: #dd4a68;\">sudo<\/span> iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT<\/code><\/pre>\n<p style=\"margin: 0px 0px 12px; padding: 0px; font-size: 14px; line-height: 1.8em; color: rgba(0, 0, 0, 0.75); font-family: Georgia, 'Times New Roman', Times, sans-serif;\">\u91cd\u542f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u53c2\u8003\u6559\u7a0b\uff1a https:\/\/frillip.com\/using-your-raspberry-pi-&hellip; <a href=\"https:\/\/sumju.net\/?p=422\" class=\"more-link read-more\" rel=\"bookmark\">\u7ee7\u7eed\u9605\u8bfb <span class=\"screen-reader-text\">\u6811\u8393\u6d3e\u642d\u5efa\u505a\u65e0\u7ebf\u8def\u7531\u5668<\/span><i class=\"fa fa-arrow-right\"><\/i><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[14,16],"tags":[],"class_list":{"0":"post-422","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-linux","7":"category-raspberry-pi","8":"h-entry","10":"h-as-article"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/sumju.net\/index.php?rest_route=\/wp\/v2\/posts\/422","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sumju.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sumju.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sumju.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sumju.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=422"}],"version-history":[{"count":1,"href":"https:\/\/sumju.net\/index.php?rest_route=\/wp\/v2\/posts\/422\/revisions"}],"predecessor-version":[{"id":425,"href":"https:\/\/sumju.net\/index.php?rest_route=\/wp\/v2\/posts\/422\/revisions\/425"}],"wp:attachment":[{"href":"https:\/\/sumju.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sumju.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=422"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sumju.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}