Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have setup SoftAP using hostapd and dhcp3-server,

$ sudo ifconfig wlan0 192.168.0.1 netmask 255.255.255.0
$ sudo dhcpd wlan0 -pf /var/run/dhcp-server/dhcpd.pid
Internet Systems Consortium DHCP Server 4.2.4
Copyright 2004-2012 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Wrote 2 leases to leases file.
Listening on LPF/wlan0/88:9f:fa:f8:79:83/192.168.0.0/24
Sending on   LPF/wlan0/88:9f:fa:f8:79:83/192.168.0.0/24
Sending on   Socket/fallback/fallback-net
Can't create PID file /var/run/dhcp-server/dhcpd.pid: Permission denied.
$ sudo bash -c "echo 1 >/proc/sys/net/ipv4/ip_forward"
$ sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE


~$ cat hostapd-myconfig.conf 

#change wlan0 to your wireless device
interface=wlan0
#bridge=br0
driver=nl80211

ssid=MyAP
hw_mode=g
channel=11

macaddr_acl=0
auth_algs=3
#ignore_broadcast_ssid=0
wpa=3
wpa_passphrase=PassWord
#wpa_key_mgmt=WPA-PSK WPA-EAP
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
rsn_pairwise=CCMP

$ tail /etc/dhcp/dhcpd.conf 
#}

subnet 192.168.0.0 netmask 255.255.255.0
{
    range 192.168.0.2 192.168.0.10;
    option routers 192.168.0.1;
    option domain-name-servers 8.8.8.8;

}




$ sudo hostapd hostapd-myconfig.conf
[sudo] password for victor: 
Configuration file: hostapd-myconfig.conf
Failed to update rate sets in kernel module
Using interface wlan0 with hwaddr 88:9f:fa:f8:79:83 and ssid 'MyAP'
wlan0: STA 88:53:d4:26:c4:14 IEEE 802.11: disassociated
wlan0: STA 88:53:d4:26:c4:14 IEEE 802.11: authenticated
wlan0: STA 88:53:d4:26:c4:14 IEEE 802.11: associated (aid 1)
wlan0: AP-STA-CONNECTED 88:53:d4:26:c4:14
wlan0: STA 88:53:d4:26:c4:14 RADIUS: starting accounting session 520CDFB8-00000000
wlan0: STA 88:53:d4:26:c4:14 WPA: pairwise key handshake completed (RSN)
wlan0: STA 88:53:d4:26:c4:14 IEEE 802.11: authenticated
wlan0: STA 88:53:d4:26:c4:14 IEEE 802.11: associated (aid 1)
wlan0: STA 88:53:d4:26:c4:14 RADIUS: starting accounting session 520CDFB8-00000001
wlan0: STA 88:53:d4:26:c4:14 WPA: pairwise key handshake completed (RSN)
wlan0: STA 88:53:d4:26:c4:14 IEEE 802.11: authenticated
wlan0: STA 88:53:d4:26:c4:14 IEEE 802.11: associated (aid 1)
wlan0: STA 88:53:d4:26:c4:14 RADIUS: starting accounting session 520CDFB8-00000002
wlan0: STA 88:53:d4:26:c4:14 WPA: pairwise key handshake completed (RSN)
wlan0: STA 88:53:d4:26:c4:14 IEEE 802.11: authenticated
wlan0: STA 88:53:d4:26:c4:14 IEEE 802.11: associated (aid 1)
wlan0: STA 88:53:d4:26:c4:14 RADIUS: starting accounting session 520CDFB8-00000003
wlan0: STA 88:53:d4:26:c4:14 WPA: pairwise key handshake completed (RSN)
wlan0: STA 88:53:d4:26:c4:14 IEEE 802.11: authenticated
wlan0: STA 88:53:d4:26:c4:14 IEEE 802.11: associated (aid 1)
wlan0: STA 88:53:d4:26:c4:14 RADIUS: starting accounting session 520CDFB8-00000004
wlan0: STA 88:53:d4:26:c4:14 WPA: pairwise key handshake completed (RSN)
wlan0: STA 88:53:d4:26:c4:14 IEEE 802.11: authenticated
wlan0: STA 88:53:d4:26:c4:14 IEEE 802.11: associated (aid 1)
wlan0: STA 88:53:d4:26:c4:14 RADIUS: starting accounting session 520CDFB8-00000005
wlan0: STA 88:53:d4:26:c4:14 WPA: pairwise key handshake completed (RSN)
wlan0: STA 88:53:d4:26:c4:14 IEEE 802.11: authenticated
wlan0: STA 88:53:d4:26:c4:14 IEEE 802.11: associated (aid 1)
wlan0: STA 88:53:d4:26:c4:14 RADIUS: starting accounting session 520CDFB8-00000006
wlan0: STA 88:53:d4:26:c4:14 WPA: pairwise key handshake completed (RSN)
wlan0: STA 88:53:d4:26:c4:14 IEEE 802.11: authenticated
wlan0: STA 88:53:d4:26:c4:14 IEEE 802.11: associated (aid 1)
wlan0: STA 88:53:d4:26:c4:14 RADIUS: starting accounting session 520CDFB8-00000007
wlan0: STA 88:53:d4:26:c4:14 WPA: pairwise key handshake completed (RSN)
wlan0: STA 88:53:d4:26:c4:14 IEEE 802.11: authenticated
wlan0: STA 88:53:d4:26:c4:14 IEEE 802.11: associated (aid 1)
wlan0: STA 88:53:d4:26:c4:14 RADIUS: starting accounting session 520CDFB8-00000008
wlan0: STA 88:53:d4:26:c4:14 WPA: pairwise key handshake completed (RSN)
wlan0: STA 88:53:d4:26:c4:14 IEEE 802.11: authenticated
wlan0: STA 88:53:d4:26:c4:14 IEEE 802.11: associated (aid 1)
wlan0: STA 88:53:d4:26:c4:14 RADIUS: starting accounting session 520CDFB8-00000009
wlan0: STA 88:53:d4:26:c4:14 WPA: pairwise key handshake completed (RSN)
wlan0: STA ac:f7:f3:e0:00:5f IEEE 802.11: authenticated
wlan0: STA ac:f7:f3:e0:00:5f IEEE 802.11: associated (aid 2)
wlan0: AP-STA-CONNECTED ac:f7:f3:e0:00:5f
wlan0: STA ac:f7:f3:e0:00:5f RADIUS: starting accounting session 520CDFB8-0000000A
wlan0: STA ac:f7:f3:e0:00:5f WPA: pairwise key handshake completed (RSN)
wlan0: STA 88:53:d4:26:c4:14 IEEE 802.11: authenticated
wlan0: STA 88:53:d4:26:c4:14 IEEE 802.11: associated (aid 1)
wlan0: STA 88:53:d4:26:c4:14 RADIUS: starting accounting session 520CDFB8-0000000B
wlan0: STA 88:53:d4:26:c4:14 WPA: pairwise key handshake completed (RSN)
wlan0: STA 88:53:d4:26:c4:14 IEEE 802.11: authenticated
wlan0: STA 88:53:d4:26:c4:14 IEEE 802.11: associated (aid 1)
wlan0: STA 88:53:d4:26:c4:14 RADIUS: starting accounting session 520CDFB8-0000000C
wlan0: STA 88:53:d4:26:c4:14 WPA: pairwise key handshake completed (RSN)
wlan0: STA 88:53:d4:26:c4:14 IEEE 802.11: authenticated
wlan0: STA 88:53:d4:26:c4:14 IEEE 802.11: associated (aid 1)
wlan0: STA 88:53:d4:26:c4:14 RADIUS: starting accounting session 520CDFB8-0000000D
wlan0: STA 88:53:d4:26:c4:14 WPA: pairwise key handshake completed (RSN)

Then I used my phone to connect this softAP, but the wifi connection dropped frequently, How to prevent? I am using Ubuntu 13.04 64bit.

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.