problems in configuration of hostapd

esolve esolve esolvepolito at
Thu Aug 30 10:34:50 EDT 2012

Hi, all:

    I want to use my laptop as an AP. The laptop is installed with fedora
16. and I have installed hostapd.  I connect my laptop to wired Ethernet
and I have two wireless cards on the laptop. One card (wlan0) is built-in
but doesn't support AP mode, so I use a plug-in wireless card wlan1 (D-Link
aripus DWL-G650) for AP interface.

     Currently, I have some problems in making it work.

      (1) sometimes, the following command line doesn't work

             ifconfig wlan1

wlan1 is temporarily set to  and after several or tens of
seconds, wlan1 is not binded with any IPV4 address (I use ifconfig wlan1 to
check and notice there is no IPV4 address), I reset it again and again, it
may be still like this.

      (2) the command line: hostapd -B /etc/hostapd/hostapd.conf
may fail. The error message is: "failed to create interface mon.wlan1"
Whether I kill the process or delete  /var/run/hostapd  is of no use.

       But sometimes, occasionally, by resetting the IP address of wlan1 or
deleting /var/run/hostapd and restart it or restart dhcpd, the AP works,
which means I can use the laptop as AP successfully. And I really don't
know why.
Can anybody give me some advices on these issues?

My configuration procedures are as follows:

1 config  /etc/hostapd/hostapd.conf  and  /etc/dhcp/dhcpd.conf (after the
first setting, it is usually done)

(1) Modify /etc/hostapd/hostapd.conf and put the following
wpa_pairwise=TKIP CCMP

(2)in /etc/dhcp/dhcpd.conf, put
subnet netmask {
        option routers;
        option subnet-mask;
        option domain-name-servers,,;

2 If more than one network interface is attached to the system, but the
DHCP server should only be started on one of the interfaces, configure the
DHCP server to start only on that device. In /etc/sysconfig/dhcpd, add the
name of the interface to the list of DHCPDARGS: # Command line options here
DHCPDARGS=wlan1 (after the first setting, it is usually done)

3 ifconfig wlan1  (the same as the "routers" in
/etc/dhcp/dhcpd.conf )

4 Allow ip masquerading
      echo "1" > /proc/sys/net/ipv4/ip_forward (or sysctl -w
net.ipv4.ip_forward=1) (sysctl net.ipv4.ip_forward shows the state)
      iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

5 start hostapd

      hostapd -B /etc/hostapd/hostapd.conf
      if there is problem: cd /var/run/hostapd and remove "wlan1"
      if it shows:failed to create interface mon.wlan1, ps -ef|grep
"hostapd" and then kill them

6  start DHCP server

               systemctl start dhcpd.service (systemctl status
dhcpd.service to check the status)
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the HostAP mailing list