# Can't connect to wireless network

## kahlil88

I installed the drivers + firmware for my Airlink AWLH5025 wireless card (Ralink RT61 chipset) and NetworkManager sees the wireless networks but won't connect to them. I tweaked my /etc/conf.d/net as instructed by the Gentoo Handbook (for both wpa_supplicant and wireless-tools), but no dice. I know my wireless works because I'm connected now in Windows 7 RC and have also tested it with Ubuntu.

----------

## My_World

First of, give us the output of:

ifconfig -a

Also the output of the following files will be needed:

/etc/conf.d/net

/etc/wpa_supplicant/wpa_supplicant.conf (Just remember to mask your SSID and PSK.)

----------

## kahlil88

ifconfig -a

 *Quote:*   

> eth0      Link encap:Ethernet  HWaddr 00:18:f3:75:c6:01  
> 
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
> 
>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
> ...

 

/etc/conf.d/net

 *Quote:*   

> config_eth0=( "dhcp" )
> 
> config_wlan0=( "dhcp" )
> 
> modules=( "wpa_supplicant" )
> ...

 

/etc/wpa_supplicant/wpa_supplicant.conf

 *Quote:*   

> ctrl_interface=/var/run/wpa_supplicant
> 
> ctrl_interface_group=0
> 
> ap_scan=1

 

----------

## My_World

Do you have two interfaces in /etc/init.d/ as well?

net.eth0 and net.wlan0

If not:

ln -s /etc/init.d/net.lo /etc/init.d/net.eth0

ln -s /etc/init.d/net.lo /etc/init.d/net.wlan0

Also, I cannot see how you pass your WPA key through wpa_supplicant, do you have ssid and passkey entries?

Also have a read here and see if this helps:

http://en.gentoo-wiki.com/wiki/Wireless_Networking

----------

## cach0rr0

let's see if we can get just wpa_supplicant to connect, by hand, without using the net.* init scripts

This is what I used for sysresccd

/scripts/networkup.sh

```

#!/bin/bash

/sbin/modprobe ipw2200

/sbin/ifconfig eth1 up

/usr/sbin/wpa_supplicant -Dwext -ieth1 -c /scripts/conf/wpa_supplicant.conf &

/sbin/dhclient

```

and my /scripts/conf/wpa_supplicant.conf

for a Linksys WRT54GS

```

ap_scan=1

ctrl_interface=/var/run/wpa_supplicant

network={

ssid="myssid"

scan_ssid=0

proto=WPA

key_mgmt=WPA-PSK

psk="my-wpa-password"

pairwise=TKIP

group=TKIP

}

```

use that as a base, see if we can connect via wpa_supplicant first and foremost, then let us go from there.

----------

## cach0rr0

also, should be pointed out, NetworkManager doesn't use wpa_supplicant stuff I don't think

as well it requires the net.* init scripts are nuked (except for net.lo - go ahead and keep that handy)

do you have gentoolkit emerged? if so, let us see equery

```

meat@laptop01 ~ $ sudo equery uses networkmanager

[ Searching for packages matching networkmanager... ]

[ Colour Code : set unset ]

[ Legend : Left column  (U) - USE flags from make.conf              ]

[        : Right column (I) - USE flags packages was installed with ]

[ Found these USE variables for net-misc/networkmanager-0.6.6 ]

 U I

 + + crypt : Add support for encryption -- using mcrypt or gpg where applicable

 - - debug : Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see http://www.gentoo.org/proj/en/qa/backtraces.xml

 - - doc   : Adds extra documentation (API, Javadoc, etc)

 + + gnome : Adds GNOME support

```

I don't know that it'd make a huge difference, but worth seeing. 

Have you done the bit with adding your user to the plugdev group? I seem to recall that being required in the HOWTO

----------

## lindegur

I had a similar problem.  Finally I'm almost happy with my netbook Ethernet configuration.

I have an "empty" /etc/conf.d/net and an default (=almost empty) /etc/wpa_supplicant/wpa_supplicant.conf

I added 

```
rc-update add NetworkManager default
```

Networkmanager does now everything, it connects to wired Ethernet, it looks around on the wlan, connects to my WPA router and handles the key, but if I'm on the way it connects well to some non encrypted network.

Small problem remains. There are still some boot scripts that fail at boot and cause a delay (waiting for the unplugged ethernet cable, try to connect unsuccessful to all kinds of Wlan access points).

----------

## kahlil88

 *My_World wrote:*   

> Do you have two interfaces in /etc/init.d/ as well?
> 
> net.eth0 and net.wlan0
> 
> If not:
> ...

 

My network doesn't use a WPA key, and yes, I have both net.eth0 and net.wlan0

 *cach0rr0 wrote:*   

> do you have gentoolkit emerged? if so, let us see equery
> 
> Have you done the bit with adding your user to the plugdev group? I seem to recall that being required in the HOWTO

 

I did add myself to plugdev. Here is the equery output:

```
* Found these USE flags for net-misc/networkmanager-0.7.1-r6:

 U I

 - - avahi              : Add avahi/Zeroconf support

 - - connection-sharing : Use net-dns/dnsmasq and net-firewall/iptables for

                          connection sharing

 - - dhclient           : Use dhclient from net-misc/dhcp for getting ip.

 - - dhcpcd             : Use net-misc/dhcpcd for getting ip.

 - - doc                : Adds extra documentation (API, Javadoc, etc)

 - - gnutls             : Adds support for net-libs/gnutls (TLS 1.0 and SSL 3.0

                          support)

 - - nss                : Use dev-libs/nss for cryptography.

 - - resolvconf         : Use net-dns/openresolv for managing DNS information
```

 *lindegur wrote:*   

> Small problem remains. There are still some boot scripts that fail at boot and cause a delay (waiting for the unplugged ethernet cable, try to connect unsuccessful to all kinds of Wlan access points).

 

My system hangs for several seconds trying to get a lease for eth0 on boot, but so far I haven't seen it look for Wlan access points. Maybe this has something to do with when I tried to scan for networks (using wpa_supplicant and wireless-tools) and it told me my device doesn't support scanning.

----------

## Dagger

1) if you use networkmanager,  dont need gentoo init.d/net.xx scripts (especially net.wlan0) that will cause lots of problems (both will try to use wpa_supplicant and you wont be able to connect).

2) networkmanager uses wpa_supplicant a lot

So, to get it up and running do:

1) backup /etc/init.d/net.eth0 scripts

2) restart/reload dbus

3) start networkmanager

4) make sure wpa_supplicant is running (networkmanager should activate it over dbus).

5) if wpa_supplicant isn't running, re-install dbus (dont as me why - it does help)

6) add yourself policykit privileges

login to your DM and use NM applet (either gnome or kde).

That should just work.

----------

## kahlil88

I tweaked my /etc/conf.d/net and listed my wireless network under "preferred_aps" and now it's working. The /etc/init.d/net.wlan0 file is still there, but I'll remove it to prevent future problems.

----------

