Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
wpa_state=COMPLETED but still no ip on wlan0
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
greanie
n00b
n00b


Joined: 13 Nov 2007
Posts: 42

PostPosted: Wed Mar 13, 2013 10:20 pm    Post subject: wpa_state=COMPLETED but still no ip on wlan0 Reply with quote

I have been trying to get my wireless adapter to connect to my network. I have a Ralink 2571W wireless adapter that apparently works with the RT73USB driver.

> lsusb -v | grep -E '\<(Bus|iProduct|bDeviceClass|bDeviceProtocol)' 2>/dev/null
Bus 001 Device 003: ID 18e8:6238 Qcom
bDeviceClass 0 (Defined at Interface level)
bDeviceProtocol 0
iProduct 2 802.11 bg WLAN
(Bus Powered)
bDeviceClass 0 (Defined at Interface level)
bDeviceProtocol 0
(Bus Powered)

> lsmod | grep rt
rt73usb 23301 0
rt2x00usb 7687 1 rt73usb
rt2x00lib 32433 2 rt73usb,rt2x00usb
crc_itu_t 1056 1 rt73usb

I have build the appropriate wireless modules using menuconfig:

> find /lib/modules/3.7.10-gentoo/ -type f -iname '*.ko' | grep wireless
/lib/modules/3.7.10-gentoo/kernel/drivers/net/wireless/rt2x00/rt2x00usb.ko
/lib/modules/3.7.10-gentoo/kernel/drivers/net/wireless/rt2x00/rt73usb.ko
/lib/modules/3.7.10-gentoo/kernel/drivers/net/wireless/rt2x00/rt2x00lib.ko
/lib/modules/3.7.10-gentoo/kernel/drivers/net/wireless/rt2x00/rt2800lib.ko
/lib/modules/3.7.10-gentoo/kernel/drivers/net/wireless/rt2x00/rt2800usb.ko


> ls -la /lib/firmware/
total 12
drwxr-xr-x 2 root root 4096 Mar 12 16:53 .
drwxr-xr-x 10 root root 4096 Mar 12 17:10 ..
-rw-r--r-- 1 root root 2048 Mar 12 16:52 rt73.bin


Contents of /etc/conf.d/net:

config_eth0="192.168.1.205 netmask 255.255.255.0 brd 192.168.1.255"
routes_eth0="default via 192.168.1.1"

modules_wlan0=( "wpa_supplicant" )
wpa_supplicant_wlan0="-Dnl80211 -c/etc/wpa_supplicant/wpa_supplicant.conf -f /var/log/wpa_supplicant.log -dd"
wpa_timeout_wlan0=15
config_wlan0="dhcp"

Contents of /etc/wpa_supplicant/wpa_supplicant.conf:

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel

update_config=1

# Let wpa_supplicant take care of scanning and AP selection
#ap_scan=1

# Chalet La Vire, av. de la Gare 2, 1882 Gryon
network={
ssid="my-ssid"
psk="private-key"
priority=5
}

After getting the parameters wrong a few times, I finally got wpa_cli stat says I am connected
> wpa_cli stat
Selected interface 'wlan0'
bssid=00:24:93:60:e0:00
ssid=my-ssid
id=0
mode=station
pairwise_cipher=CCMP
group_cipher=TKIP
key_mgmt=WPA2-PSK
wpa_state=COMPLETED

The wpa_state isn't always that stable during boot up. The wpa_state may say COMPLETED and when I try it a few seconds later, I get:
> wpa_cli stat
Selected interface 'wlan0'
bssid=00:24:93:60:e0:00
ssid=my-ssid
id=0
mode=station
pairwise_cipher=CCMP
group_cipher=TKIP
key_mgmt=WPA2-PSK
wpa_state=4WAY_HANDSHAKE


However, even when it seems stable on COMPLETED, I can't get an ip address.

> ifconfig wlan0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::20d:f0ff:fe5a:e4ee prefixlen 64 scopeid 0x20<link>
ether 00:0d:f0:5a:e4:ee txqueuelen 1000 (Ethernet)
RX packets 19334 bytes 5620278 (5.3 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 26293 bytes 5367695 (5.1 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

> dhcpcd wlan0
dhcpcd[26932]: dhcpcd already running on pid 26866 (/var/run/dhcpcd-wlan0.pid)

Any idea what I have missed? Why doesn't it get an ip address? Is there a way to see which state the dhcpcd request is at?
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Thu Mar 14, 2013 12:13 am    Post subject: Reply with quote

rc-update show | grep -i dhcpcddhcpcd[/code] if you have dhcpcd in a runlevel get rid of it
Code:
rc-update del dhcpcd
Code:
/etc/init.d/net.wlan0 stop
/etc/init.d/dhcpcd stop
/etc/init.d/wlan0 restart
If the situation is unchanged and assuming wext driver is in your kernel
Quote:
[*] Networking support --->
-*- Wireless --->
--- Wireless
<M> cfg80211 - wireless configuration API
[*] nl80211 testmode command
[ ] enable developer warnings
[ ] cfg80211 regulatory debugging
[ ] enable powersave by default
[ ] cfg80211 DebugFS entries
[*] cfg80211 wireless extensions compatibility
<M> Generic IEEE 802.11 Networking Stack (mac80211)
Default rate control algorithm (Minstrel) --->
[ ] Enable mac80211 mesh networking (pre-802.11s) support
[ ] Export mac80211 internals in DebugFS
[ ] Trace all mac80211 debug messages
[ ] Select mac80211 debugging features --->
replace
Quote:
wpa_supplicant_wlan0="-Dnl80211"
with
Code:
 wpa_supplicant_wlan0="-Dwext -dd -f /var/log/wpa_supplicant.log"
nl80211 may not support your card, this will provide better logging.

wpa_supplicant.conf:
Quote:
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
update_config=1

network={
ssid=myssid"
psk="mypasswd"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
auth_alg=OPEN
}


Code:
/etc/init.d/wlan0 restart
and check the log at /var/log/wpa_supplicant.log
_________________
Defund the FCC.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Thu Mar 14, 2013 9:23 am    Post subject: Reply with quote

DONAHUE wrote:
Code:
wpa_supplicant_wlan0="-Dwext -dd -f /var/log/wpa_supplicant.log"

nl80211 may not support your card, this will provide better logging.

DONAHUE ... with net-wireless/wpa_supplicant-0.7.3-r5 the '-f' (file) switch is only enabled if the 'debug' useflag is set. I reported this as a bug as CONFIG_DEBUG_FILE=y does not enable debugging, but only the capacity to use the '-f' switch. The useflag has been removed from the ~arch keyworded packages, but enabling 'debug' is required to log to a file with 0.7.3-r5. I point this out as 'debug' is not eabled by default and if the OP provides '-f' as an option to 'wpa_supplicant_wlan0=' wpa_supplicant will fail to start.

greanie ... its probably as DONAHUE suggested, you have dhcpcd set to run in the default runlevel, remove it and net.wlan0 will start dhcpcd as and when the interface is brought up.

best ... khay
Back to top
View user's profile Send private message
greanie
n00b
n00b


Joined: 13 Nov 2007
Posts: 42

PostPosted: Fri Mar 15, 2013 10:54 am    Post subject: Reply with quote

Thanks for your ideas and feedback! I found my (n00b) issue. I was working command-line while getting wpa_supplicant and I had several instances of wpa_supplicant going simultaneously. When I tried to stop dhcp on wlan0, another would start it up again. I finally figured it out by doing a ps -ef | grep wpa. Once I killed the other processes, the wpa_state stablized and it was able to get an IP address!

Also, I was able to use the nl80211 driver and did not change to the wext driver.

Thanks again for your feedback. By trying to stop dhcpcd, I was able to find the root problem!!!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum