LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-17-2015, 01:01 AM   #1
narnie
Member
 
Registered: Jan 2010
Distribution: Linux Mint, Ubuntu Netbook Edition, et al
Posts: 108

Rep: Reputation: 17
Hostapd fails to configure after first use


Hello,

I have a problem with hostapd. When I first boot up my laptop, I can get my wlan0 logged on, and run a script for hostadp for wlan1 that works flawlessly.

After I stop hostapd and remove the wireless usb (wlan1), when I reinsert it and run my script, I get this:

Code:
# hostapd /home/username/Access\ Point/hostapd-test.conf 
Configuration file: /home/username/Access Point/hostapd-test.conf
nl80211: Could not configure driver mode
nl80211 driver initialization failed.
hostapd_free_hapd_data: Interface wlan1 wasn't started
This is my hostapd.conf file (under a different name).

Code:
# cat /home/username/Access\ Point/hostapd-test.conf 
#change wlan0 to your wireless device
interface=wlan1
driver=nl80211
ssid=animals
channel=1
wpa=3
wpa_passphrase=hidden
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
My script is :

Code:
# cat bin/initSoftAP 
#!/bin/bash
#Initial wifi interface configuration

if [ -z "$1" ]; then
     AP_DEVICE=wlan1
     GATEWAY_DEVICE=wlan0
else
     AP_DEVICE=$1
     GATEWAY_DEVICE=$2
fi
ifconfig $AP_DEVICE up 10.0.0.1 netmask 255.255.255.0
sleep 2
###########Start DHCP, comment out / add relevant section##########
#Thanks to Panji
#Doesn't try to run dhcpd when already running
if [ "$(ps -e | grep dhcpd)" == "" ]; then
dhcpd $AP_DEVICE &
fi
###########
#Enable NAT
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
iptables --table nat --append POSTROUTING --out-interface $GATEWAY_DEVICE -j MASQUERADE
iptables --append FORWARD --in-interface $AP_DEVICE -j ACCEPT
#/root/firewall/firewall-browsing
#iptables -P FORWARD ACCEPT
#Thanks to lorenzo
#Uncomment the line below if facing problems while sharing PPPoE, see lorenzo's comment for more details
#iptables -I FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu

sysctl -w net.ipv4.ip_forward=1
#start hostapd
hostapd /home/woodnt/Access\ Point/hostapd-test.conf #1>/dev/null
/root/firewall/firewall-clear
killall dhcpd
I have configured have configured networking to initialize the card so that Network Manager leaves it unmanaged, so that is not the issue (esp since it works the first time).

Also, I have completely stopped the network-manager service to make sure it isn't the culpret and it still gives this error.

A reboot of the computer solves this problem, but I would like another solution other than this.

I have stopped the network-manager service and the networking service and restarted to see if that would help, which it didn't.

My wireless module is rt2800usb.

Note, dmesg and /var/log/syslog or messages show no new entries after runing hostapd fails.

Other advice would be greatly appreciated.

Kindly,
Narnie
 
Old 05-19-2015, 02:40 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
After I stop hostapd, remove the wireless usb (wlan1) and reinsert it again, does wireless device is found in dmesg? Is wlan1 created agian?
 
Old 05-20-2015, 12:38 AM   #3
narnie
Member
 
Registered: Jan 2010
Distribution: Linux Mint, Ubuntu Netbook Edition, et al
Posts: 108

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by nini09 View Post
After I stop hostapd, remove the wireless usb (wlan1) and reinsert it again, does wireless device is found in dmesg? Is wlan1 created agian?
Yes, it is configured when looking at dmesg.

Code:
# iwconfig 
eth0      no wireless extensions.

wlan0     IEEE 802.11bgn  ESSID:"Hyatt Guest"  
          Mode:Managed  Frequency:2.462 GHz  Access Point: 24:DE:C6:21:D4:50   
          Bit Rate=65 Mb/s   Tx-Power=20 dBm   
          Retry short limit:7   RTS thr=2347 B   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=65/70  Signal level=-45 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:1443   Missed beacon:0

lo        no wireless extensions.

wlan1     IEEE 802.11bgn  ESSID:off/any  
          Mode:Managed  Access Point: Not-Associated   Tx-Power=20 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off

# dmesg
. . .
[ 2916.333247] usb 1-1: new high-speed USB device number 7 using xhci_hcd
[ 2916.534587] usb 1-1: New USB device found, idVendor=148f, idProduct=5370
[ 2916.534590] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2916.534591] usb 1-1: Product: 802.11 n WLAN
[ 2916.534593] usb 1-1: Manufacturer: Ralink
[ 2916.534593] usb 1-1: SerialNumber: 1.0
[ 2916.701647] usb 1-1: reset high-speed USB device number 7 using xhci_hcd
[ 2916.896029] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep ffff88017f2a2048
[ 2916.896033] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep ffff88017f2a2000
[ 2916.896035] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep ffff88017f2a2090
[ 2916.896037] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep ffff88017f2a20d8
[ 2916.896038] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep ffff88017f2a2120
[ 2916.896040] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep ffff88017f2a2168
[ 2916.896042] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep ffff88017f2a21b0
[ 2916.896416] ieee80211 phy3: rt2x00_set_rt: Info - RT chipset 5390, rev 0502 detected
[ 2916.906180] ieee80211 phy3: rt2x00_set_rf: Info - RF chipset 5370 detected
[ 2916.906414] ieee80211 phy3: Selected rate control algorithm 'minstrel_ht'
[ 2916.906892] ieee80211 phy3: rt2x00lib_request_firmware: Info - Loading firmware file 'rt2870.bin'
[ 2916.906915] rt2800usb 1-1:1.0: firmware: direct-loading firmware rt2870.bin
[ 2916.906918] ieee80211 phy3: rt2x00lib_request_firmware: Info - Firmware detected - version: 0.29
[ 2917.043871] IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready

Last edited by narnie; 05-20-2015 at 12:41 AM.
 
Old 05-20-2015, 02:29 PM   #4
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
The wlan1 is created but isn't configured. You need run command, /etc/init.d/hostapd restart, to configure wlan1 again.
At boot-up, hostap is configured automatically.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] hostapd 'make' fails -- fatal error: demangle.h Sum1 Linux - Software 9 11-10-2012 05:51 AM
How to configure hostapd 0.5.8, so it would work with dynamic WEP?? Gilco333 Linux - Wireless Networking 3 01-24-2012 06:20 AM
How to configure hostapd.conf? alex2002 Linux - Wireless Networking 0 07-14-2009 01:43 PM
./configure fails with: libz... configure: error: not found. erpe Linux - Software 17 10-11-2006 05:56 PM
ardour wont configure: configure: error: C preprocessor "/lib/cpp" fails sanity check disciple061 Linux - Software 4 01-22-2005 12:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration