{"id":559,"date":"2014-01-17T05:08:35","date_gmt":"2014-01-17T12:08:35","guid":{"rendered":"http:\/\/somethingk.com\/main\/?p=559"},"modified":"2014-01-25T15:41:16","modified_gmt":"2014-01-25T22:41:16","slug":"build-your-own-wireless-access-point","status":"publish","type":"post","link":"https:\/\/somethingk.com\/main\/build-your-own-wireless-access-point\/","title":{"rendered":"Build Your Own Wireless Access Point"},"content":{"rendered":"<p>Why buy an expensive router when you can build a cheap one from old hardware?<\/p>\n<p><strong>Equipment<\/strong><\/p>\n<p>This is what I used:<\/p>\n<ul>\n<li>Ubuntu Desktop 12.04<\/li>\n<li>hostapd v0.7.3<\/li>\n<li>dhcp3-server<\/li>\n<li>HP Compaq DC 7800 Small Form Factor PC<\/li>\n<li>Penguin Wireless N PCIe Card v3 SKU NPCIEV3 ($50-$70)<\/li>\n<li>Ethernet cable<\/li>\n<li>Monitor, VGA cable, mouse and keyboard<\/li>\n<\/ul>\n<p><strong>Setup<\/strong><\/p>\n<p><span style=\"text-decoration: underline;\">Hardware<\/span><\/p>\n<ol>\n<li>The Wireless network card must first be installed. Open up the computer and locate the PCI slot. Insert the network card into the PCI slot.<\/li>\n<p><a href=\"http:\/\/somethingk.com\/main\/wp-content\/uploads\/2014\/01\/pcedit.png\"><img fetchpriority=\"high\" decoding=\"async\" src=\"http:\/\/somethingk.com\/main\/wp-content\/uploads\/2014\/01\/pcedit-300x225.png\" alt=\"PC Slot\" width=\"300\" height=\"225\" class=\"aligncenter size-medium wp-image-566\" srcset=\"https:\/\/somethingk.com\/main\/wp-content\/uploads\/2014\/01\/pcedit-300x225.png 300w, https:\/\/somethingk.com\/main\/wp-content\/uploads\/2014\/01\/pcedit.png 746w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<li>Ensure the two cables are reachable to the outside of the case. The antennas should be connected to these points. In the picture, the wireless network card\u2019s plate did not fit the chassis and was removed because I didn&#8217;t feel like punching holes through the original plate.<\/li>\n<p><a href=\"http:\/\/somethingk.com\/main\/wp-content\/uploads\/2014\/01\/antennasedit.png\"><img decoding=\"async\" src=\"http:\/\/somethingk.com\/main\/wp-content\/uploads\/2014\/01\/antennasedit-300x225.png\" alt=\"Antennas\" width=\"300\" height=\"225\" class=\"aligncenter size-medium wp-image-567\" srcset=\"https:\/\/somethingk.com\/main\/wp-content\/uploads\/2014\/01\/antennasedit-300x225.png 300w, https:\/\/somethingk.com\/main\/wp-content\/uploads\/2014\/01\/antennasedit.png 580w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<\/ol>\n<p><span style=\"text-decoration: underline;\">Software Install<\/span><\/p>\n<p>These directions specifically apply to a machine that is running the Ubuntu 12.04 operating system.\u00a0I feel this goes without mentioning but have a monitor, keyboard, etc connected to the PC for the next install steps. Install <a href=\"https:\/\/help.ubuntu.com\/community\/SSH\" title=\"SSH\" target=\"_blank\">SSH<\/a> in order to shell into the device later without all that necessary crap. In order to create the wireless access point two packages need to be installed.<\/p>\n<ol>\n<li><span style=\"font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px;\">sudo apt-get install hostapd<\/span><\/li>\n<li><span style=\"font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px;\">sudo apt-get install dhcp3-server<\/span><\/li>\n<\/ol>\n<p>Hostapd\u00a0provides the hosting services of an access point. It is a daemon for wireless access and authentication servers. Dhcp3-server\u00a0provides a network service that automatically assigns IP addresses to clients.<\/p>\n<p><span style=\"text-decoration: underline;\">Configuration<\/span><\/p>\n<p>The hostapd configuration file needs to be created and edited to contain access point information. The below settings utilize WPA2-PSK authentication.<\/p>\n<ol>\n<li><span style=\"font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px;\">sudo vim \/etc\/hostapd\/hostapd.conf<\/span><\/li>\n<li>Add<\/li>\n<pre>interface=wlan0 #wireless network interface\r\ndriver=nl80211 #802.11 standard\r\nssid=TheShire #The hotspot name, I'm a sucker for Lord of the Rings :)\r\ncountry_code=US\r\nchannel=11\r\nhw_mode=g\r\nauth_algs=1\r\nwpa=3\r\nwpa_passphrase=secretPassword #access point password\r\nwpa_key_mgmt=WPA-PSK\r\nwpa_pairwise=TKIP CCMP\r\nrsn_pairwise=CCMP<\/pre>\n<li>Configure the interface for the DHCP server.<\/li>\n<pre>sudo vim \/etc\/default\/isc-dhcp-server<\/pre>\n<li>Set<\/li>\n<pre>INTERFACES=\u201dwlan0\u2033<\/pre>\n<li>The next configuration is in the DHCP conf file. Set the range of IP addresses allowed to be allocated to connecting machines.<\/li>\n<pre>sudo vim \/etc\/dhcp\/dhcpd.conf<\/pre>\n<li>Comment out all lines except:<\/li>\n<pre>ddns-update-style none;<\/pre>\n<li>Declare the IP range of addresses for DHCP.<\/li>\n<pre>subnet 10.10.0.0 netmask 255.255.255.0 {\r\n        range 10.10.0.2 10.10.0.24;\r\n        option domain-name-servers 192.168.0.81, 192.168.0.4;\r\n        option routers 10.10.0.1;\r\n}<\/pre>\n<li>Enable the hostapd program to run on startup.<\/li>\n<pre>sudo vim \/etc\/default\/hostapd<\/pre>\n<li>Set:<\/li>\n<pre>RUN_DAEMON=\"yes\"\r\nDAEMON_CONF=\"\/etc\/hostapd\/hostapd.conf\"\r\nDAEMON_OPTS=\"-dd\"<\/pre>\n<\/ol>\n<p><span style=\"text-decoration: underline;\">IP Settings<\/span><\/p>\n<ol>\n<li>Configure the IP settings for the wireless network.<\/li>\n<pre>sudo vim \/etc\/network\/interfaces<\/pre>\n<li>Add<\/li>\n<pre>auto lo\r\niface lo inet loopback\r\n\r\nauto wlan0 #Wireless Network Interface\r\niface wlan0 inet static\r\naddress 10.10.0.1 #Local Router IP\r\nnetmask 255.255.255.0<\/pre>\n<\/ol>\n<p><span style=\"text-decoration: underline;\">Firewall Settings<\/span><\/p>\n<p>Allow IP masquerading in the Iptables. This is a networking function that allows local machines to access the same connection the host router is utilizing.<\/p>\n<ol>\n<li><span style=\"font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px;\">echo &#8220;1&#8221; &gt; \/proc\/sys\/net\/ipv4\/ip_forward<\/span><\/li>\n<li><span style=\"font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px;\">iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE<\/span><\/li>\n<\/ol>\n<p><span style=\"text-decoration: underline;\">DHCP Monitoring<\/span><\/p>\n<ol>\n<li>All DHCP requests can be found in \/var\/log\/syslog. Grep can be used to pull certain requests for monitoring.<\/li>\n<pre>cat \/var\/log\/syslog | grep DHCPOFFER<\/pre>\n<p><a href=\"http:\/\/somethingk.com\/main\/wp-content\/uploads\/2014\/01\/DHCP.png\"><img decoding=\"async\" src=\"http:\/\/somethingk.com\/main\/wp-content\/uploads\/2014\/01\/DHCP-300x205.png\" alt=\"DHCP\" width=\"300\" height=\"205\" class=\"aligncenter size-medium wp-image-569\" srcset=\"https:\/\/somethingk.com\/main\/wp-content\/uploads\/2014\/01\/DHCP-300x205.png 300w, https:\/\/somethingk.com\/main\/wp-content\/uploads\/2014\/01\/DHCP.png 552w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<li>Further DHCP settings can be supplied in the configuration file, such as:<\/li>\n<pre>sudo vim \/etc\/dhcp\/dhcpd.conf<\/pre>\n<li>Edit<\/li>\n<pre>subnet 10.10.0.0 netmask 255.255.255.0 {\r\n        range 10.10.0.2 10.10.0.24;\r\n        option domain-name-servers 192.168.0.81, 192.168.0.4;\r\n        max-lease-time 120; #Set the max release time\r\n        default-lease-time 120;#Set the default lease time\r\n        option routers 10.10.0.1;\r\n}<\/pre>\n<\/ol>\n<p>To flush the DHCP leases, the following can be performed:<\/p>\n<ol>\n<li><span style=\"font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px;\">cd \/var\/lib\/dhcp\/<\/span><\/li>\n<li><span style=\"font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px;\">sudo rm dhcpd.leases~<\/span><\/li>\n<li><span style=\"font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px;\">sudo echo \u201c\u201d &gt; dhcpd.leases<\/span><\/li>\n<\/ol>\n<p><span style=\"text-decoration: underline;\">Changing Signal Strength<\/span><\/p>\n<p>It may be ideal to limit the signal strength to a specific room or region in order to prevent overlapping signals. For cards that support multiple transmit powers, this can be done through iwconfig.<\/p>\n<ol>\n<li><span style=\"font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px;\">iwconfig wlan0 txpower &lt;LEVEL IN DBM&gt;<\/span><\/li>\n<\/ol>\n<p><a href=\"http:\/\/somethingk.com\/main\/wp-content\/uploads\/2014\/01\/WirelessAP.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/somethingk.com\/main\/wp-content\/uploads\/2014\/01\/WirelessAP-300x225.png\" alt=\"Wireless AP\" width=\"300\" height=\"225\" class=\"aligncenter size-medium wp-image-570\" srcset=\"https:\/\/somethingk.com\/main\/wp-content\/uploads\/2014\/01\/WirelessAP-300x225.png 300w, https:\/\/somethingk.com\/main\/wp-content\/uploads\/2014\/01\/WirelessAP.png 590w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nThere you have it!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Why buy an expensive router when you can build a cheap one from old hardware? Equipment This is what I used: Ubuntu Desktop 12.04 hostapd v0.7.3 dhcp3-server HP Compaq DC 7800 Small Form Factor PC Penguin Wireless N PCIe Card v3 SKU NPCIEV3 ($50-$70) Ethernet cable Monitor, VGA cable, mouse and keyboard Setup Hardware The Wireless network card must first [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,93],"tags":[139,138,170,141,140,142,107,137],"class_list":["post-559","post","type-post","status-publish","format-standard","hentry","category-linux","category-networking","tag-access-point","tag-ap","tag-build-your-own-wireless-access-point","tag-dhcp3-server","tag-hostapd","tag-hp","tag-ubuntu","tag-wireless"],"_links":{"self":[{"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/posts\/559","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/comments?post=559"}],"version-history":[{"count":9,"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/posts\/559\/revisions"}],"predecessor-version":[{"id":578,"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/posts\/559\/revisions\/578"}],"wp:attachment":[{"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/media?parent=559"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/categories?post=559"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/tags?post=559"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}