Build Your Own Wireless Access Point

Why buy an expensive router when you can build a cheap one from old hardware?


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



  1. 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.
  2. PC Slot

  3. 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’s plate did not fit the chassis and was removed because I didn’t feel like punching holes through the original plate.
  4. Antennas

Software Install

These directions specifically apply to a machine that is running the Ubuntu 12.04 operating system. I feel this goes without mentioning but have a monitor, keyboard, etc connected to the PC for the next install steps. Install SSH 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.

  1. sudo apt-get install hostapd
  2. sudo apt-get install dhcp3-server

Hostapd provides the hosting services of an access point. It is a daemon for wireless access and authentication servers. Dhcp3-server provides a network service that automatically assigns IP addresses to clients.


The hostapd configuration file needs to be created and edited to contain access point information. The below settings utilize WPA2-PSK authentication.

  1. sudo vim /etc/hostapd/hostapd.conf
  2. Add
  3. interface=wlan0 #wireless network interface
    driver=nl80211 #802.11 standard
    ssid=TheShire #The hotspot name, I'm a sucker for Lord of the Rings :)
    wpa_passphrase=secretPassword #access point password
    wpa_pairwise=TKIP CCMP
  4. Configure the interface for the DHCP server.
  5. sudo vim /etc/default/isc-dhcp-server
  6. Set
  7. INTERFACES=”wlan0″
  8. The next configuration is in the DHCP conf file. Set the range of IP addresses allowed to be allocated to connecting machines.
  9. sudo vim /etc/dhcp/dhcpd.conf
  10. Comment out all lines except:
  11. ddns-update-style none;
  12. Declare the IP range of addresses for DHCP.
  13. subnet netmask {
            option domain-name-servers,;
            option routers;
  14. Enable the hostapd program to run on startup.
  15. sudo vim /etc/default/hostapd
  16. Set:
  17. RUN_DAEMON="yes"

IP Settings

  1. Configure the IP settings for the wireless network.
  2. sudo vim /etc/network/interfaces
  3. Add
  4. auto lo
    iface lo inet loopback
    auto wlan0 #Wireless Network Interface
    iface wlan0 inet static
    address #Local Router IP

Firewall Settings

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.

  1. echo “1” > /proc/sys/net/ipv4/ip_forward
  2. iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

DHCP Monitoring

  1. All DHCP requests can be found in /var/log/syslog. Grep can be used to pull certain requests for monitoring.
  2. cat /var/log/syslog | grep DHCPOFFER


  3. Further DHCP settings can be supplied in the configuration file, such as:
  4. sudo vim /etc/dhcp/dhcpd.conf
  5. Edit
  6. subnet netmask {
            option domain-name-servers,;
            max-lease-time 120; #Set the max release time
            default-lease-time 120;#Set the default lease time
            option routers;

To flush the DHCP leases, the following can be performed:

  1. cd /var/lib/dhcp/
  2. sudo rm dhcpd.leases~
  3. sudo echo “” > dhcpd.leases

Changing Signal Strength

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.

  1. iwconfig wlan0 txpower <LEVEL IN DBM>

Wireless AP
There you have it!

Leave a Reply

Your email address will not be published. Required fields are marked *


Time limit is exhausted. Please reload the CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.