{"id":3085,"date":"2014-03-24T07:48:25","date_gmt":"2014-03-23T22:48:25","guid":{"rendered":"http:\/\/pchero21.com\/?p=3085"},"modified":"2014-03-24T07:48:25","modified_gmt":"2014-03-23T22:48:25","slug":"how-to-make-wifi-ap-in-gentoo","status":"publish","type":"post","link":"http:\/\/pchero21.com\/?p=3085","title":{"rendered":"How to make wifi ap in gentoo"},"content":{"rendered":"<p>\uc9d1\uc5d0\uc11c \uc0ac\uc6a9\ud558\ub294 \ubb34\uc120\ub79c\uc774 \ubcbd\uacfc \ubcbd\uc744 \ud1b5\uacfc\ud558\uba74\uc11c \uc815\uc791 \ub0b4\ubc29\uc5d0\uc11c\ub294 \uac70\uc758 \uc7a1\ud788\uc9c0 \uc54a\uac8c \ub418\uc5c8\ub2e4.<\/p>\n<p>\uadf8\ub3d9\uc548 \uc720\uc120\uc73c\ub85c\ub9cc \uc4f0\uace0 \uc788\uc5c8\ub294\ub370.. \uc774\ubc88\uc5d0 \uc0c8\ub86d\uac8c \ud0dc\ube14\ub9bf\uacfc \ud734\ub300\ud3f0\uc744 \uad6c\uc785\ud558\uba74\uc11c \ub108\ubb34\ub098 \ubd88\ud3b8\ud558\uac8c \ub418\uc5c8\ub2e4.<br \/>\n\uadf8\ub798\uc11c \uc820\ud22c\uc5d0 Wifi \uacf5\uc720\uae30 \uc124\uc815\uc744 \ud558\uac8c \ub418\uc5c8\ub2e4.<\/p>\n<p><strong>AP \uc9c0\uc6d0 \ubaa8\ub4dc \ud655\uc778<\/strong><br \/>\n\uba3c\uc800 \ud604\uc7ac \uc0ac\uc6a9\uc911\uc778 \ubb34\uc120\ub79c \uce74\ub4dc\uac00 AP \ubaa8\ub4dc\ub97c \uc9c0\uc6d0\ud558\ub294\uc9c0\ub97c \ud655\uc778\ud574\uc57c \ud55c\ub2e4.<\/p>\n<pre class=\"brush:shell\">$ sudo emerge iw\n$ iw list\nWiphy phy0\n\tmax # scan SSIDs: 4\n\tmax scan IEs length: 2257 bytes\n\tRTS threshold: 2347\n\tCoverage class: 0 (up to 0m)\n\tDevice supports RSN-IBSS.\n\tSupported Ciphers:\n\t\t* WEP40 (00-0f-ac:1)\n\t\t* WEP104 (00-0f-ac:5)\n\t\t* TKIP (00-0f-ac:2)\n\t\t* CCMP (00-0f-ac:4)\n\t\t* CMAC (00-0f-ac:6)\n\tAvailable Antennas: TX 0 RX 0\n\tSupported interface modes:\n\t\t * IBSS\n\t\t * managed\n\t\t * AP\n\t\t * AP\/VLAN\n\t\t * monitor\n\t\t * mesh point\n\t\t * P2P-client\n\t\t * P2P-GO<\/pre>\n<p>\uc704\uc640 \uac19\uc774 iw list \uba85\ub839\uc5b4\ub85c \ud655\uc778\ud588\uc744 \ub54c, Supported interface modes: \ud56d\ubaa9\uc5d0 AP \ud56d\ubaa9\uc774 \ud45c\uc2dc\uac00 \ub418\uc5b4\uc57c\ud55c\ub2e4. \uaf2d \ud655\uc778\ud558\ub3c4\ub85d \ud558\uc790.<\/p>\n<p><strong>\ud544\uc694 \ud328\ud0a4\uc9c0<\/strong><br \/>\n\ub2e4\uc74c\uc758 \ud328\ud0a4\uc9c0\ub4e4\uc744 \uc124\uce58\ud574\uc8fc\uc790.<\/p>\n<pre class=\"brush:shell\">$ sudo emerge hostapd\n$ sudo emerge dhcp<\/pre>\n<p><strong>dhcp \uc124\uc815<\/strong><\/p>\n<p>\uc0dd\uc131\ub41c(\uace7 \uc0dd\uc131\ud560..) \ubb34\uc120 AP\uc5d0 Client\uac00 \uc811\uc18d\ud588\uc744 \ub54c, \uc790\ub3d9\uc73c\ub85c \uc0ac\uc6a9\uac00\ub2a5\ud55c IP \ub97c \ud560\ub2f9\ud574\uc8fc\uc5b4\uc57c \ud55c\ub2e4. \uadf8\ub7ec\uae30 \uc704\ud574\uc11c\ub294 dhcp \uc124\uc815\uc774 \ud544\uc694\ud558\ub2e4. \uc774 \uc608\uc81c\uc5d0\uc11c\ub294 \uc784\uc758\ub85c 10.10.0.0\/24 \ub300\uc5ed\uc758 IP \uc8fc\uc18c\ub97c \uc0ac\uc6a9\ud558\uae30\ub85c \ud55c\ub2e4.<\/p>\n<p>dhcp \uc124\uc815\uc744 \uc704\ud574\uc11c \ub2e4\uc74c\uc758 \ub0b4\uc6a9\uc744 \/etc\/dhcp\/dhcpd.conf \ud30c\uc77c\uc5d0 \uc785\ub825\ud55c\ub2e4.<\/p>\n<pre class=\"brush:shell\">subnet 10.10.0.0 netmask 255.255.255.0 {\n        range 10.10.0.25 10.10.0.50;\n        option domain-name-servers 8.8.8.8;\n        option routers 10.10.0.1;\n}<\/pre>\n<p><strong>hostapd \uc124\uc815<\/strong><\/p>\n<p>hostapd \ub294 \uc2e4\uc81c\ub85c wifi ap\ub97c \uc0dd\uc131\ud574\uc8fc\ub294 \uc720\ud2f8\uc774\ub2e4. \/etc\/hostapd\/hostapd.conf \ud30c\uc77c\uc5d0 \uc544\ub798\uc758 \ub0b4\uc6a9\uc744 \uc785\ub825\ud558\ub3c4\ub85d \ud558\uc790.<\/p>\n<pre class=\"brush:shell\">interface=wlan0\ndriver=nl80211\nssid=pchero_gentoo\nhw_mode=g\nchannel=1\nmacaddr_acl=0\nauth_algs=3\n\nwpa=3\nwpa_passphrase=yourpassword\nwpa_psk_radius=0\nwpa_key_mgmt=WPA-PSK WPA-EAP\nwpa_pairwise=CCMP\nwpa_ptk_rekey=600<\/pre>\n<p>\uac04\ud639 \uc124\uc815 \ub0b4\uc6a9\uc774 \uc798 \uc548 \ub9de\uc544\uc11c \uc548\ub418\ub294 \uc778\uc99d\uc774 \uacbd\uc6b0\uac00 \uc788\ub2e4. \uc774\ub7f0 \uacbd\uc6b0, \uc5b4\ub290 \ubd80\ubd84\uc5d0\uc11c \ubb38\uc81c\uac00 \uc0dd\uae30\ub294\uc9c0 \uc54c\uae30 \uc5b4\ub824\uc6b8 \uc218 \uc788\ub2e4. \ub54c\ubb38\uc5d0 \ucc98\uc74c\uc5d0\ub294 \uac00\uae09\uc801 \uc554\ud638\ud654 \uc5c6\ub294 Open \uc73c\ub85c \uc124\uc815\ud55c \ub4a4, \uc815\uc0c1\uc791\ub3d9\ud558\ub294 \uac83\uc744 \ud655\uc778\ud558\uace0 \ud558\ub098\uc529 \uc218\uc815\ud558\ub294 \uac83\uc744 \uad8c\ud55c\ub2e4. \uc544\ub798 \ub0b4\uc6a9\uc740 \uc554\ud638\ud654\ub97c \ud558\uc9c0 \uc54a\uc740 Open \ubc29\uc2dd \uc124\uc815 \uc608\uc81c\uc774\ub2e4.<\/p>\n<pre class=\"brush:shell\">interface=wlan0\ndriver=nl80211\nssid=pchero_gentoo\nhw_mode=g\nchannel=11<\/pre>\n<p><strong>Ip masquerade<\/strong><\/p>\n<p>wifi ap \uc0dd\uc131 \ud6c4, \ud328\ud0b7\uc744 \ud3ec\uc6cc\ub529\ud574\uc8fc\uc5b4\uc57c \ud558\uae30 \ub54c\ubb38\uc5d0 masquerade \uc124\uc815\uc744 \ud574\uc57c\ud55c\ub2e4. \uc544\ub798 \uba85\ub839\uc740 root \ub85c su \ud55c \ub2e4\uc74c\uc5d0 \uc9c4\ud589\ud574\uc57c \ud55c\ub2e4.<\/p>\n<pre class=\"brush:shell\">$ sudo su -\n$ echo \"1\" &gt; \/proc\/sys\/net\/ipv4\/ip_forward\n$ iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE<\/pre>\n<p><strong>NetworkManager<\/strong><\/p>\n<p>\uace0\uc0dd\ud588\ub358 \ubd80\ubd84\uc774\ub2e4&#8230;.. \uc5ec\uae30\uae4c\uc9c0 \uc9c4\ud589\ud558\uba74\uc11c \ubb38\uc81c\uac00 \uc5c6\uc5c8\ub294\ub370, \uc774\uc0c1\ud558\uac8c hostapd \ub97c \uc2dc\uc791\ud558\uba74 \uc774\uc0c1\ud55c \uc624\ub958\ub97c \ub0b4\uba74\uc11c \uc8fd\ub294 \ud604\uc0c1\uc774 \ub098\ud0c0\ub0ac\ub2e4. \uc544\ub798\ub294 \uadf8 \uc624\ub958 \ub0b4\uc6a9\uc774\ub2e4.<\/p>\n<pre class=\"brush:shell\">pchero@localhost ~ $ sudo hostapd -dd \/etc\/hostapd\/hostapd.conf\nrandom: Trying to read entropy from \/dev\/random\nConfiguration file: \/etc\/hostapd\/hostapd.conf\nctrl_interface_group=10 (from group name 'wheel')\nnl80211: Could not add multicast membership for vendor events: -2 (No such file or directory)\nrfkill: initial event: idx=0 type=1 op=0 soft=0 hard=0\nnl80211: Supported cipher 00-0f-ac:1\nnl80211: Supported cipher 00-0f-ac:5\nnl80211: Supported cipher 00-0f-ac:2\nnl80211: Supported cipher 00-0f-ac:4\nnl80211: Supported cipher 00-0f-ac:6\nnl80211: Using driver-based off-channel TX\nnl80211: interface wlan0 in phy phy0\nnl80211: Set mode ifindex 6 iftype 3 (AP)\nnl80211: Setup AP(wlan0) - device_ap_sme=0 use_monitor=0\nnl80211: Subscribe to mgmt frames with AP handle 0x1c6d390\nnl80211: Register frame type=0xb0 nl_handle=0x1c6d390 match=\nnl80211: Register frame type=0x0 nl_handle=0x1c6d390 match=\nnl80211: Register frame type=0x20 nl_handle=0x1c6d390 match=\nnl80211: Register frame type=0xa0 nl_handle=0x1c6d390 match=\nnl80211: Register frame type=0xc0 nl_handle=0x1c6d390 match=\nnl80211: Register frame type=0xd0 nl_handle=0x1c6d390 match=\nnl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)\nnl80211: Register frame match - hexdump(len=0): [NULL]\nnl80211: Could not configure driver mode\nnl80211: Remove monitor interface: refcount=0\nnl80211: Remove beacon (ifindex=6)\nnetlink: Operstate: ifindex=6 linkmode=0 (kernel-control), operstate=6 (IF_OPER_UP)\nnl80211: Set mode ifindex 6 iftype 2 (STATION)\nnl80211: Teardown AP(wlan0) - device_ap_sme=0 use_monitor=0\nnl80211 driver initialization failed.\nhostapd_interface_deinit_free(0x1c6c990)\nhostapd_interface_deinit_free: num_bss=1 conf-&gt;num_bss=1\nhostapd_interface_deinit(0x1c6c990)\nhostapd_bss_deinit: deinit bss wlan0\nhostapd_cleanup(hapd=0x1c70370 (wlan0))\nhostapd_free_hapd_data: Interface wlan0 wasn't started\nhostapd_interface_deinit_free: driver=(nil) drv_priv=(nil) -&gt; hapd_deinit\nhostapd_interface_free(0x1c6c990)\nhostapd_interface_free: free hapd 0x1c70370\nhostapd_cleanup_iface(0x1c6c990)\nhostapd_cleanup_iface_partial(0x1c6c990)\nhostapd_cleanup_iface: free iface=0x1c6c990<\/pre>\n<p>\uacb0\ub860\uc740 NetworkManager \ub54c\ubb38\uc774\uc5c8\ub2e4. hostapd \uc640 NetworkManager \ub294 \uac19\uc774 \uc2e4\ud589\uc2dc\ud0ac \uc218 \uc5c6\ub2e4. \uc989, hostapd \ub97c \uc2e4\ud589\uc2dc\ud0a4\uae30 \uc704\ud574\uc11c\ub294 NetworkManager \ub97c \uc885\ub8cc \uc2dc\ucf1c\uc57c \ud55c\ub2e4.<\/p>\n<pre class=\"brush:shell\">sudo \/etc\/init.d\/NetworkManager stop<\/pre>\n<p><strong>Set wlan0<\/strong><\/p>\n<p>\uc774\uc81c wlan0 \uc758 IP \ub97c \uc124\uc815\ud574\uc8fc\uc790. \uae30\ubcf8\uc801\uc73c\ub85c dhcpd.conf \uc758 \uc124\uc815 \ub0b4\uc6a9\uacfc \ub9de\ucdb0\uc57c \ud558\ubbc0\ub85c 10.10.0.1 \ub85c \uc124\uc815\ud558\ub3c4\ub85d \ud558\uc790.<\/p>\n<pre class=\"brush:shell\">ifconfig wlan0 10.10.0.1 netmask 255.255.255.0<\/pre>\n<p><strong>Start hostapd<\/strong><\/p>\n<p>\ub2e4 \ub05d\ub0ac\ub2e4. dhcp \uc640 hostapd \ub97c \uc2dc\uc791\ud558\ub3c4\ub85d \ud558\uc790. dhcp \uc2dc\uc791\uc2dc, wlan0 \uc5d0 \ub300\ud574\uc11c\ub9cc dhcp \uc11c\ube44\uc2a4\ub97c \ud558\ub3c4\ub85d \uba85\uc2dc\ud574 \uc8fc\uc5b4\uc57c \ud55c\ub2e4. \uc8fc\uc758\ud558\uc790.<br \/>\n\ub9cc\uc57d interface\ub97c \uba85\uc2dc\ud558\uc9c0 \uc54a\uc744 \uacbd\uc6b0, eth0 \uae4c\uc9c0\ub3c4 dhcp \uc11c\ube44\uc2a4\ub97c \ud558\ub824\uace0 \ud55c\ub2e4. \uadf8\ub807\uac8c \ub418\uba74 eth0\uc5d0 \uc124\uc815\ub418\uc5b4 \uc788\ub294 IP \uc815\ubcf4\uac00 \ub0a0\uc544\uac00\uac8c \ub418\uace0, \uacb0\ub860\uc801\uc73c\ub85c\ub294 AP \ub85c\uc368 \uc815\uc0c1\uc791\ub3d9\ud558\uc9c0 \uc54a\uac8c \ub41c\ub2e4.<\/p>\n<pre class=\"brush:shell\"># dhcp\n$ sudo dhcpd -cf \/etc\/dhcp\/dhcpd.conf wlan0 start\n\n# hostapd\n$ sudo hostapd -dd \/etc\/hostapd\/hostapd.conf<\/pre>\n<p><strong>Miscellaneous<\/strong><\/p>\n<p>\ub9e4\ubc88 ap \ub97c \uad6c\ub3d9\ud558\uae30 \uc704\ud574 \uc704\uc758 \uba85\ub839\uc5b4\ub97c \uc785\ub825\ud560 \uc218\ub294 \uc5c6\ub2e4. \uac04\ub2e8\ud788 \uc2a4\ud06c\ub9bd\ud2b8\ub97c \ub9cc\ub4e4\ub3c4\ub85d \ud558\uc790.<\/p>\n<pre class=\"brush:shell\">#!\/bin\/bash\n\n# stop Network Manager\n#service NetworkManager stop\n\/etc\/init.d\/NetworkManager stop\n\n# Set wlan0 IP\nifconfig wlan0 10.10.0.1 netmask 255.255.255.0\n\n# Ip forwarding\necho \"1\" &gt; \/proc\/sys\/net\/ipv4\/ip_forward\niptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE\n\n# dhcp\ndhcpd -cf \/etc\/dhcp\/dhcpd.conf wlan0 start\n\n# hostapd\nhostapd -B \/etc\/hostapd\/hostapd.conf<\/pre>\n<p><strong>\ucc38\uace0<\/strong><br \/>\n&#8211; <a title=\"http:\/\/exain.wordpress.com\/2011\/03\/31\/making-a-wifi-hotspot-access-point-using-linux-wifi-lan-cardusb-adapter\" href=\"http:\/\/exain.wordpress.com\/2011\/03\/31\/making-a-wifi-hotspot-access-point-using-linux-wifi-lan-cardusb-adapter\" target=\"_blank\">http:\/\/exain.wordpress.com\/2011\/03\/31\/making-a-wifi-hotspot-access-point-using-linux-wifi-lan-cardusb-adapter<\/a><br \/>\n&#8211; <a title=\"http:\/\/www.sentabi.com\/how-to-fix-hostapd-nl80211driver-initialization\" href=\"http:\/\/www.sentabi.com\/how-to-fix-hostapd-nl80211driver-initialization\" target=\"_blank\">http:\/\/www.sentabi.com\/how-to-fix-hostapd-nl80211driver-initialization<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\uc9d1\uc5d0\uc11c \uc0ac\uc6a9\ud558\ub294 \ubb34\uc120\ub79c\uc774 \ubcbd\uacfc \ubcbd\uc744 \ud1b5\uacfc\ud558\uba74\uc11c \uc815\uc791 \ub0b4\ubc29\uc5d0\uc11c\ub294 \uac70\uc758 \uc7a1\ud788\uc9c0 \uc54a\uac8c \ub418\uc5c8\ub2e4. \uadf8\ub3d9\uc548 \uc720\uc120\uc73c\ub85c\ub9cc \uc4f0\uace0 \uc788\uc5c8\ub294\ub370.. \uc774\ubc88\uc5d0 \uc0c8\ub86d\uac8c \ud0dc\ube14\ub9bf\uacfc \ud734\ub300\ud3f0\uc744 \uad6c\uc785\ud558\uba74\uc11c \ub108\ubb34\ub098 \ubd88\ud3b8\ud558\uac8c \ub418\uc5c8\ub2e4. \uadf8\ub798\uc11c \uc820\ud22c\uc5d0 Wifi \uacf5\uc720\uae30 \uc124\uc815\uc744 \ud558\uac8c \ub418\uc5c8\ub2e4. AP \uc9c0\uc6d0 \ubaa8\ub4dc \ud655\uc778 \uba3c\uc800 \ud604\uc7ac \uc0ac\uc6a9\uc911\uc778 \ubb34\uc120\ub79c \uce74\ub4dc\uac00 &hellip; <a href=\"http:\/\/pchero21.com\/?p=3085\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[25],"tags":[96,152,189,204,424],"_links":{"self":[{"href":"http:\/\/pchero21.com\/index.php?rest_route=\/wp\/v2\/posts\/3085"}],"collection":[{"href":"http:\/\/pchero21.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/pchero21.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/pchero21.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/pchero21.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3085"}],"version-history":[{"count":0,"href":"http:\/\/pchero21.com\/index.php?rest_route=\/wp\/v2\/posts\/3085\/revisions"}],"wp:attachment":[{"href":"http:\/\/pchero21.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3085"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/pchero21.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3085"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/pchero21.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3085"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}