Use 8188eu and Hostapd For Setting Soft-AP Router

TurnToJPG -->


Install HostAPD via following commands:

$ sudo apt-get autoremove hostapd
$ wget
$ tar -zxvf v2.0.tar.gz
$ cd RTL8188-hostapd-2.0/hostapd
$ sudo make
$ sudo make install
$ sudo service hostapd restart
[ ok ] Stopping advanced IEEE 802.11 management: hostapd.
[ ok ] Starting advanced IEEE 802.11 management: hostapd.


We need a dhcp server for assigning a new IP address to the clients who joins the ap:
An example file is listed as following:

ddns-update-style none;
ignore client-updates;
option local-wpad code 252 = text;
subnet netmask {
# --- default gateway
option routers;
# --- Netmask
option subnet-mask;
# --- Broadcast Address
option broadcast-address;
# --- Domain name servers, tells the clients which DNS servers to use.
option domain-name-servers,,;
option time-offset
default-lease-time 1209600;
max-lease-time 1814400;

WLAN0 Network

The WLAN0 equipment network should be configured as following:

$ cat /etc/network/interface
# wireless wlan0
allow-hotplug wlan0
iface wlan0 inet static

So next time you reboot the computer, it will automatically get the ip address for wlan0.

Enable the ip forwarding

Using following 2 commands for enabling your AP.

$ sudo iptables -t nat -A POSTROUTING -s ! -d  -j MASQUERADE
$ sudo dhcpd wlan0

I add these two lines into the start file of awesome(My desktop environment).

Disable hostapd

You should remove the definition of the dhcpd, and the iptables forwarding rules, and also the definition in /etc/network/interfaces, and the hostapd configuration in /etc/rc*.d from S to K, while the rc*.d ranges from rc0 to rc6.