{"id":492,"date":"2014-04-11T21:04:51","date_gmt":"2014-04-11T13:04:51","guid":{"rendered":"http:\/\/www.sulabs.net\/?p=492"},"modified":"2014-04-11T21:06:25","modified_gmt":"2014-04-11T13:06:25","slug":"centos%e8%ae%a9pc%e5%90%8c%e6%97%b6%e6%94%af%e6%8c%81%e6%9c%89%e7%ba%bf%e5%92%8c%e6%97%a0%e7%ba%bf%e6%96%b9%e5%bc%8f%e6%8e%a5%e5%85%a5%e7%9a%84%e9%85%8d%e7%bd%ae%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.sulabs.net\/?p=492","title":{"rendered":"CentOS\u8ba9PC\u540c\u65f6\u652f\u6301\u6709\u7ebf\u548c\u65e0\u7ebf\u65b9\u5f0f\u63a5\u5165\u7684\u914d\u7f6e\u65b9\u6cd5"},"content":{"rendered":"<p>\u603b\u89c9\u5f97\u65f6\u95f4\u4e0d\u591f\u7528\uff0c\u5feb\u534a\u5e74\u6ca1\u66f4\u65b0\u535a\u5ba2\u4e86.<br \/>\n\u516c\u53f8\u91c7\u8d2d\u4e861\u53f0\u8054\u60f3\u626c\u5929A8000u \u8ff7\u4f60\u4e3b\u673a\uff0c\u673a\u5668\u81ea\u5e26\u4e00\u4e2a\u5343\u5146\u7f51\u5361\u548c\u4e00\u4e2a11N\u65e0\u7ebf\u7f51\u5361\uff0c\u7528\u4e8e\u5916\u51fa\u505a\u670d\u52a1\u5668\u7ed9\u5ba2\u6237\u6f14\u793a\u4ea7\u54c1\uff0c\u56e0\u8981\u652f\u6301\u624b\u673a\u5ba2\u6237\u7aef\u8bbf\u95ee\uff0c\u4ee5\u5f80\u5fc5\u987b\u5355\u72ec\u8fde\u63a5\u65e0\u7ebf\u8def\u7531\u5668\uff0c\u62bd\u65f6\u95f4\u6298\u817e\u4e86\u4e0b\uff0c\u4f7f\u7528\u81ea\u5e26\u7684\u65e0\u7ebf\u7f51\u5361\u6765\u5145\u5f53AP\uff0c\u5e76\u6865\u63a5\u81f3\u6709\u7ebf\u7f51\u7edc\uff0c\u81ea\u52a8\u83b7\u53d6IP\u5730\u5740,\u505a\u5230\u53ef\u540c\u65f6\u8bbf\u95ee,\u5982\u56fe\u6240\u793a<br \/>\n<a href=\"https:\/\/www.sulabs.net\/wp-content\/uploads\/2014\/04\/a8000u_br.jpg\"><img loading=\"lazy\" decoding=\"async\" alt=\"a8000u_br\" src=\"https:\/\/www.sulabs.net\/wp-content\/uploads\/2014\/04\/a8000u_br.jpg\" width=\"510\" height=\"182\" \/><\/a><\/p>\n<p>\u57fa\u672c\u73af\u5883 CentOS 6.5 X64\u6700\u5c0f\u5316\u5b89\u88c5<\/p>\n<p><!--more--><\/p>\n<p>1.\u914d\u7f6e\u7f51\u5361IP\u5730\u5740<br \/>\n# vim \/etc\/sysconfig\/network-scripts\/ifcfg-eth0<br \/>\n\u4fee\u6539\u7f51\u5361IP\u4e3a 192.168.2.254<\/p>\n<p>2.\u5b89\u88c5Hostapd \u5de5\u5177\uff0c\u8ba9\u65e0\u7ebf\u7f51\u5361\u53d8\u6210AP<br \/>\n# rpm -Uvh\u00a0<a href=\"http:\/\/mirrors.ustc.edu.cn\/fedora\/epel\/6\/x86_64\/epel-release-6-7.noarch.rpm\">http:\/\/mirrors.ustc.edu.cn\/fedora\/epel\/6\/x86_64\/epel-release-6-7.noarch.rpm<\/a><br \/>\n\/\/\u5b89\u88c5EPEL\u6e90<br \/>\n# yum install -y hostapd<\/p>\n<p>3.\u914d\u7f6eHostapd<br \/>\n# vim \/etc\/hostapd\/hostapd.conf<br \/>\n\u53c2\u8003\u4ee5\u4e0b\u4fe1\u606f\u8fdb\u884c\u914d\u7f6e<\/p>\n<pre class=\"brush: shell; gutter: true\">ctrl_interface=\/var\/run\/hostapd\r\nctrl_interface_group=wheel\r\nmacaddr_acl=0\r\nauth_algs=1\r\nwpa=3\r\nwpa_key_mgmt=WPA-PSK\r\nwpa_pairwise=TKIP\r\nrsn_pairwise=CCMP\r\nwpa_passphrase=AP\u5bc6\u7801\r\ndriver=nl80211\r\ninterface=wlan0 \r\nhw_mode=g\r\nchannel=\u4fe1\u9053 \u63a8\u83501,6,11\r\nssid=SSID\u540d\u79f0\r\n#ignore_broadcast_ssid=0<\/pre>\n<p>\u6ce8\u610f\u6700\u540e\u4e00\u884c\u00a0ignore_broadcast_ssid\u00a0\u786e\u4fdd\u6ce8\u91ca\uff0c\u5426\u5219\u627e\u4e0d\u5230SSID<\/p>\n<p>4. \u5b89\u88c5Dhcpd<br \/>\n# yum install -y dhcpd<br \/>\n# vim \/etc\/dhcp\/dhcpd.conf<br \/>\n\/\/\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6<\/p>\n<pre class=\"brush: shell; gutter: true\">option domain-name &quot;example.org&quot;;\r\n option domain-name-servers ns1.example.org, ns2.example.org;\r\n default-lease-time 600;\r\n max-lease-time 7200;\r\n log-facility local7;\r\n\r\nsubnet 192.168.2.0 netmask 255.255.255.0 {\r\n   option subnet-mask 255.255.255.0;\r\n  option broadcast-address 192.168.2.255;\r\n   option routers 192.168.2.254;  \r\n   range  192.168.2.2 192.168.2.253;\r\n}<\/pre>\n<p>5. \u914d\u7f6e\u7f51\u5361\u6865\u63a5<br \/>\n# yum install bridge-utils<br \/>\n\/\/\u5b89\u88ddbridge-utils<\/p>\n<div># brctl addbr br0<\/div>\n<div># \u521b\u5efa\u4e00\u4e2abr0 \u63a5\u53e3<\/div>\n<div># brctl stp br0 off<\/div>\n<div><span style=\"color: #00b0f0;\"><span style=\"color: #333333;\">\/\/\u5173\u95ed\u751f\u6210\u6811\u534f\u8bae\uff0c\u907f\u514d\u5e7f\u64ad\u98ce\u66b4<br \/>\n<\/span><\/span><\/div>\n<div># brctl addif br0 eth0<\/div>\n<div># brctl addif br0 wlan0<\/div>\n<div>\/\/\u5206\u522b\u5c06eth0\u548cwlan0 \u6dfb\u52a0\u81f3br0 \u63a5\u53e3,\u6210\u529f\u540eeth1\u548cwlan0 \u4e0d\u9700\u8981\u518d\u914d\u7f6eIP<\/div>\n<div><\/div>\n<div># ifoncfig eth0 down<\/div>\n<div># ifconfig\u00a0wlan0 down<\/div>\n<div>\/\/\u505c\u6b62eth0 \u548c wlan0 \u8bbe\u5907<\/div>\n<div><\/div>\n<div># ifconfig eth0 0.0.0.0 promisc<\/div>\n<div># ifconfig\u00a0wlan0 0.0.0.0 promisc<br \/>\n\/\/\u5f00\u542feth0\u548cwlan0 \u7f51\u5361\u6df7\u6742\u6a21\u5f0f<\/div>\n<div><\/div>\n<div># echo \"1\" &gt; \/proc\/sys\/net\/ipv4\/ip_forward<br \/>\n\/\/\u5f00\u542f\u8f6c\u53d1<\/div>\n<div><\/div>\n<div>ifconfig br0\u00a0192.168.2.254 up<\/div>\n<div>\/\/\u8bbe\u7f6ebr0\u6865\u63a5IP\u5730\u5740route add default gw 192.168.2.254<\/div>\n<div>\/\/\u6dfb\u52a0\u4e00\u6761\u9ed8\u8ba4\u8def\u7531<\/div>\n<div># service dhcpd restart<br \/>\n\/\/\u91cd\u542fDHCP\u670d\u52a1\uff0c\u4fbf\u4e8e\u8bbe\u5907\u83b7\u53d6IP<\/div>\n<div><\/div>\n<div>\u4ee5\u4e0a\u914d\u7f6e\u53ef\u4ee5\u505a\u6210\u542f\u52a8\u811a\u672c\u653e\u7f6e\u5728 rc.local\u4e2d\u8fd0\u884c\uff0c\u6700\u540e\u9700\u8981\u91cd\u542f\u4e0b dhcpd \u670d\u52a1\uff0c\u8bbe\u5907\u624d\u80fd\u6b63\u786e\u83b7\u53d6IP<\/div>\n<div><\/div>\n<div><\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u603b\u89c9\u5f97\u65f6\u95f4\u4e0d\u591f\u7528\uff0c\u5feb\u534a\u5e74\u6ca1\u66f4\u65b0\u535a\u5ba2\u4e86. \u516c\u53f8\u91c7\u8d2d\u4e861\u53f0\u8054\u60f3\u626c\u5929A8000u \u8ff7\u4f60 &hellip;<\/p>\n<p class=\"read-more\"><a href=\"https:\/\/www.sulabs.net\/?p=492\">\u7ee7\u7eed\u9605\u8bfb &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-492","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.sulabs.net\/index.php?rest_route=\/wp\/v2\/posts\/492","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sulabs.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sulabs.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sulabs.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sulabs.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=492"}],"version-history":[{"count":6,"href":"https:\/\/www.sulabs.net\/index.php?rest_route=\/wp\/v2\/posts\/492\/revisions"}],"predecessor-version":[{"id":503,"href":"https:\/\/www.sulabs.net\/index.php?rest_route=\/wp\/v2\/posts\/492\/revisions\/503"}],"wp:attachment":[{"href":"https:\/\/www.sulabs.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=492"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sulabs.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=492"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sulabs.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=492"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}