# [SOLVED] WPA Access Problem

## Holysword

Hi there

I must connect my new laptop to a WPA network. Seems that the guides that I found are too confusing though.

It follows my wpa_supplicant.conf:

```
# The below line not be changed otherwise we refuse to work

ctrl_interface=/var/run/wpa_supplicant

# Ensure that only root can read the WPA configuration

ctrl_interface_group=0

# Let wpa_supplicant take care of scanning and AP selection

ap_scan=1

# Simple case: WPA-PSK, PSK as an ASCII passphrase, allow all valid ciphers

network={

  ssid="WL-CFC"

  key_mgmt=WPA-PSK

  psk="mypass"

  # The higher the priority the sooner we are matched

  priority=5

}
```

My /etc/conf.d/net:

```
config_wlan0=("wpa_supplicant")

wpa_supplicant_wlan0="-Diwlagn"
```

Everytime I try to start /etc/init.d/net.wlan0 it gives me a "WEP key is not set for "WL-CFC" - not connecting", which is weird since I'm trying to use WPA.

Something funny also is that eth0 is not in any runlevel, but whenever I boot it tries to start eth0.

Appreciate any help

EDIT#1: I can connect in this network using Ubuntu LiveDVD. According to it, its a WPA & WPA2-Personal network.

----------

## Holysword

Found out that the problem was the route. Adding routes_wlan0=("default gw 138.63.201.1") in /etc/conf.d/net changes the error. It complains saying that iwlagn is not supported. Suppressing this line in /etc/conf.d/net it works.

The problem is that it stills try to start eth0 everytime I boot the computer, which is annoying (and doesn't work). Moreover I must run "dhcpcd wlan0" everytime.

Any clue?

----------

## Ahenobarbi

 *Holysword wrote:*   

> 
> 
> The problem is that it stills try to start eth0 everytime I boot the computer, which is annoying (and doesn't work). Moreover I must run "dhcpcd wlan0" everytime.
> 
> Any clue?

 

There are already a few thereds around started by people who want not to start interfaces.

---

edit

https://forums.gentoo.org/viewtopic-t-818057.html

----------

## d2_racing

Again, that's not good :

```

wpa_supplicant_wlan0="-Diwlagn"

```

Should be :

```

wpa_supplicant_wlan0="-Dwext"

```

----------

## Holysword

 *Ahenobarbi wrote:*   

> There are already a few thereds around started by people who want not to start interfaces.

 

Thanks, man. Setting RC_PLUG_SERVICES='!net.eth0'  solved this problem for me.

 *d2_racing wrote:*   

> Should be :
> 
> ```
> wpa_supplicant_wlan0="-Dwext" 
> ```
> ...

 

Okay, changed.

But I still need to re-run dhcpcd everytime I boot up. Sometimes I think that, in the past, I used to set dhcpcd to start during bootup in rc-update, but my memory sux. I tried to do so but it says that dhcpcd has no start function. Am I missing something?

----------

## Rexilion

```
dhcpcd --background --timeout 0
```

Will cause it to try forever. But I'm not 100% sure if it works, because I don't know if it always keep sending discovery signals.

----------

## d2_racing

Maybe try :

```

RC_PLUG_SERVICES='!net.eth0 !bet.wlan0
```

'

----------

## fathom

Shouldn't  the /etc/conf.d/net file for the wlan0 config block just include

```

modules=( "dhcpcd" )

dhcpcd_wlan0="-t 30"

config_wlan0="dhcp" 

```

I might stilll have problems with my net.wlan0 but dhcpcd is definately working as it should.

and for the wpa_supplicant.conf maybe you should include the lines

```
        proto=RSN

        pairwise=CCMP TKIP

        group=CCMP TKIP 

```

in the block for wlan0

first line tells wpa_supplicant to use wpa2 the second and 3rd lines tell it to use only aes and tkip for pairwise and group key handshakes. This stops wpa_supplicant from getting strange ideas about using WEP when the ap offers them

----------

## d2_racing

```

proto=WPA2

```

Really, it's for WPA2.

----------

## fathom

yeah, just read up on that my mistake, seems wpa2 keyword is accepted the alias for rsn

----------

## Holysword

Well, I solved all my problems by installing wicd. I just realized that doing all this thing every time I need to connect to a different network (I use a laptop) is quite prohibitive.

Moreover, I re-emerged the entire system, and then it started to initialize eth0 again. It seems that its udev that starts these things. I found the following in /etc/conf.d/udev:

```
# udev can trigger coldplug events which cause services to start and

# kernel modules to be loaded.

# Services are deferred to start in the boot runlevel.

# Set rc_coldplug="NO" if you don't want this.

# If you want module coldplugging but not coldplugging of services then you

# can disable service coldplugging in baselayout/openrc config files.

# The setting is named different in different versions.

# in /etc/rc.conf: rc_hotplug="!*" or

# in /etc/conf.d/rc: rc_plug_services="!*"

#rc_coldplug="YES"
```

So, changing /etc/conf.d/rc was not enough for me, but changing /etc/rc.conf too solved the problem.

----------

