# iproute2 wpa_supplicant

## Thesniperofdeath

Normally it works with ifconfig

but how would you use iproute2 and wpa_supplicant for WPA2 pass-phase?

```
modules=( "wpa_supplicant" )

#modules=( "iproute2" )

config_wlan0=( "dhcp" )

wpa_supplicant_wlan0="-Dwext -c /etc/wpa_supplicant/wpa_supplicant.conf"

wpa_timeout_wlan0=60
```

----------

## Bones McCracker

You can put the pass-phrase in the wpa_supplicant.conf file.  For example:

```
# /etc/wpa_supplicant/wpa_supplicant.conf

# BoneKracker

# 2 September 2009

# Re:

# /usr/share/doc/wpa_supplicant-<ver>/wpa_supplicant.conf.bz2

# man pages WPA_SUPPLICANT(8), WPA_SUPPLICANT.CONF(5)

# Notes:

# To reduce startup time, pre-generate wpa psk from passrphrase with utility:

# wpa_passphrase <ssid> <passphrase>

#### global configuration (shared by all network blocks)

# allow frontend (e.g., wpa_cli) to be used by all users in wheel group

#ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=10

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=0

# delegate scanning to the driver, select by SSID and security policy

ap_scan=2

#### per-essid configuration

network={

        ssid="mynetwork"

        scan_ssid=1

        proto=RSN

        key_mgmt=WPA-PSK

        auth_alg=OPEN

        pairwise=CCMP

        group=CCMP

        #psk="S0mE R3@lly 5tup1d @nd l0ng P@ssphr@s3!"

        psk=8465374h5j-20o93ir4s6y2w06wp86q0924q02k03q5x928k7483928h36h23oi5

        proactive_key_caching=1        

}
```

----------

## Thesniperofdeath

 *BoneKracker wrote:*   

> You can put the pass-phrase in the wpa_supplicant.conf file.  For example:

 

It errors

```
 * Starting wlan0

RTNETLINK answers: Unknown error 132

RTNETLINK answers: Unknown error 132

RTNETLINK answers: Unknown error 132

 *   Configuring wireless network for wlan0

 *   wlan0 does not support scanning

 *   You either need to set a preferred_aps list in /etc/conf.d/wireless

 *      preferred_aps=( "ESSID1" "ESSID2" )

 *      and set associate_order_wlan0="forcepreferred"

 *      or set associate_order_wlan0="forcepreferredonly"

 *   or hardcode the ESSID to "any" and let the driver find an Access Point

 *      essid_wlan0="any"

 *   or configure defaulting to Ad-Hoc when Managed fails

 *      adhoc_essid_wlan0="WLAN"

 *   or hardcode the ESSID against the interface (not recommended)

 *      essid_wlan0="ESSID"

 *   Failed to configure wireless for wlan0
```

But works with ifconfig

----------

## Bones McCracker

Works for me.

----------

## Thesniperofdeath

 *BoneKracker wrote:*   

> Works for me.

 

Can you show me your /etc/conf.d/net setup for iproute2?

----------

## Bones McCracker

 *Thesniperofdeath wrote:*   

>  *BoneKracker wrote:*   Works for me. 
> 
> Can you show me your /etc/conf.d/net setup for iproute2?

 

I don't use /etc/conf.d/net.  Under baselayout2, openrc provides a new, simplified (and less functional) set of networking scripts, and the preferred method is to use the initscripts for wpa_supplicant and dhcpcd directly.  Under this arrangement, /etc/conf.d/net has been superseded by /etc/conf.d/network.   Under this arrangement, /etc/conf.d/net and the old networking scripts is still supported for now, but I don't happen to use them.

The /etc/init.d/wpa_supplicant accepts command-line arguments, which are user-configurable via /etc/conf.d/wpa_supplicant.  However, you can also configure wpa_supplicant through /etc/wpa_supplicant/wpa_supplicant.conf.  You can also typically configure your wireless driver through config files that go in /etc/Wireless/<driver_name>.

To diagnose your problem, you should be able to manually walk through the process that the networking scripts are performing, to get more information about what exactly is going wrong.

----------

## Thesniperofdeath

Is there way to tell if iproute2 is handling the networking instead of ifconfig?

----------

