How to setup an Access Point via hostapd – Including using the TL-WN725N

Introduction

I recently had to setup an Access Point using my TL-WN725N which allowed me to share my internet to multiple devices whilst my in-built WiFi on my laptop was connected to a WiFi Access Point with an internet connection. This was because only one device could be connected using the access code which I paid quite a lot of money for and thus I couldn’t connect my phone, or other devices.

In this tutorial, I will guide you through step by step on how to install the required software, and use a very helpful piece of software that does all the hard work for you.

Install the required software

Download and Install create_ap

create_ap is an excellent piece of software that manages hostapd and all the networking for you. It is run via command line and is very easy to use. You can read the README for it here on Its github page.

In order to install this, we are going to create a directory called “src” in the home directory. This is where we will download the code to and run the install command from.

NOTE: The install command places the file in /usr/bin or /usr/local/bin so it can be used from the command line without specifying its directory.

Start an AP

In order to start an Access Point (AP) we need to know what the device is called.

Run the following command;

We should see something like this;

NOTE: I removed my MAC Address and replaced it with numbers for privacy 🙂

I know wlan1 is going to be my Access Point adapter since I ran ifconfig before and after I plugged it in. All you need to know now is the other name of the device you want to share internet from.

To start an AP with wlan1 as the AP, and let’s say, wlan0 as the source adapter which is currently connected to a WiFi network with internet access, then run;

This should start up correctly and you should be able to find and connect to the WiFi AP. When you connect, you should be able to use the internet. You can find more examples by reading the README on the github page.

Using the TL-WN725N as an AP

If you followed everything above and it fails to start an AP, this is probably because you need to download a special version of hostapd for Ralink support. This is what I had to do in order to use the TL-WN725N USB adapter which uses the ralink drivers.

Before we start, let’s remove hostapd since we’re going to compile and install our own version;

Now we download hostapd to our src directory and extract it;

And finally, compile and install;

The last step will move the compiled hostapd binary to /usr/local/bin, add a startup script and create a configuration file in /etc/hostapd/hostapd.conf.

Now it is a good idea to reboot your device and then try and use the command above with the “–driver rtl871xdrv” paramter to start an AP. Hopefully it works!

An example would be;