# wpa_supplicant and dhcp help

## crayztechnique

I was following along on a tutorial for setting up my wireless network and I came across the following issues:

When I ran:

```
wpa_supplicant -B -Dwext -I wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
```

I ran into the following:

```
Successfully initialized wpa_supplicant

ioctl[SIOCSIWENCODEEXT]: Invalid argument

ioctl[SIOCSIWENCODEEXT]: Invalid argument
```

Continuing on I ran:

```
dhcpcd wlan0
```

Only to get:

```
wlan0: waiting for carrier

timed out

dhcpcd exited
```

So . . . . . I could really use some direction here. There were multiple reasons for this on the searches I did and multiple answers none of which worked for me.

----------

## bbgermany

1st: Please post your wpa_supplicant.conf

2nd: Please check, whether you are connected with iwconfig, after you have run wpa_supplicant.

greets, bb

----------

## crayztechnique

```
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel

update_config=1

network={

                 ssid="crayzteknician"

                 proto=RSN

                 key_mgmt=WPA-PSK

                 pairwise=CCMP TKIP

                 group=CCMP TKIP

                 #psk="myPassword"

                 psk=whoopsiedaisiesalongstringofnumbersandletters

}
```

```
wlan0        IEEE 802.11bg 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
```

Last edited by crayztechnique on Tue Apr 19, 2016 6:02 pm; edited 1 time in total

----------

## khayyam

 *crayztechnique wrote:*   

> 
> 
> ```
> ioctl[SIOCSIWENCODEEXT]: Invalid argument
> 
> ...

 

crayztechnique ... these are due to the use of '-Dwext' rather than '-Dnl80211' ... though such errors can occur without the connection failing (as 'wext' will function if/when CONFIG_CFG80211_WEXT is enabled).

 *crayztechnique wrote:*   

> 
> 
> ```
> wlan0: waiting for carrier
> 
> ...

 

That suggests you're not getting connected so focus on wpa_supplicant. The config seems ok, can you do the following add '-dd -f /var/log/wpa_supplicant.log' to the parameters and pastebin the log.

Also, you've just posted your psk, and now google has it ;)

best ... khay

----------

## NeddySeagoon

khayyam,

Google probably had it already, along with all the SSIDs they harvest when they make streetview.

Its only useful if you are within 100 yards or so of crayztechniques AP.

I know I'm not, since crayzteknician does not appear in any WiFi scans I do.

crayztechnique,

dmesg may say something useful about youe failure to associate.  

wpa_supplicant does all the wireless specific things needed to pass traffic over the wireless interface.

Until dmesg show that you are both Associated and Authenticated nothing else can work.  Of course, its possible to connect to some random AP, so do check you get connected to the AP you think you are.

----------

## steveL

 *NeddySeagoon wrote:*   

> Google probably had it already, along with all the SSIDs they harvest when they make streetview.

 

Associated to the "secure" password, your personal/banking details and your address ofc, if you use an Android phone.

By all means prove me wrong about the banking details. ;)

----------

## crayztechnique

```
wpa_supplicant v2.5

random: Trying to read entropy from /dev/random

Successfully initialized wpa_supplicant

Initializing interface 'wlan0' conf '/etc/wpa_supplicant/wpa_supplicant.conf' driver 'wext' ctrl_interface 'N/A' bridge 'N/A'

Configuration file '/etc/wpa_supplicant/wpa_supplicant.conf' -> '/etc/wpa_supplicant/wpa_supplicant.conf'

Reading configuration file '/etc/wpa_supplicant/wpa_supplicant.conf'

ctrl_interface='DIR=/var/run/wpa_supplicant GROUP=wheel'

update_config=1

Line: 7 - start of a new network block

ssid - hexdump_ascii(len=14):

     63 72 61 7a 79 74 65 6b 6e 69 63 69 61 6e         crazyteknician  

proto: 0x2

key_mgmt: 0x2

pairwise: 0x18

group: 0x18

PSK - hexdump(len=32): [REMOVED]

Priority group 0

   id=0 ssid='crazyteknician'

WEXT: cfg80211-based driver detected

wext: interface wlan0 phy: phy0

rfkill: initial event: idx=0 type=1 op=0 soft=0 hard=0

SIOCGIWRANGE: WE(compiled)=22 WE(source)=21 enc_capa=0xf

  capabilities: key_mgmt 0xf enc 0x1f flags 0x0

WEXT: Driver: b43

netlink: Operstate: ifindex=4 linkmode=1 (userspace-control), operstate=5 (IF_OPER_DORMANT)

Add interface wlan0 to a new radio phy0

wlan0: Own MAC address: somethingoranother

wpa_driver_wext_set_key: alg=0 key_idx=0 set_tx=0 seq_len=0 key_len=0

wpa_driver_wext_set_key: alg=0 key_idx=1 set_tx=0 seq_len=0 key_len=0

wpa_driver_wext_set_key: alg=0 key_idx=2 set_tx=0 seq_len=0 key_len=0

wpa_driver_wext_set_key: alg=0 key_idx=3 set_tx=0 seq_len=0 key_len=0

wpa_driver_wext_set_key: alg=0 key_idx=4 set_tx=0 seq_len=0 key_len=0

ioctl[SIOCSIWENCODEEXT]: Invalid argument

Driver did not support SIOCSIWENCODEEXT

wpa_driver_wext_set_key: alg=0 key_idx=5 set_tx=0 seq_len=0 key_len=0

ioctl[SIOCSIWENCODEEXT]: Invalid argument

Driver did not support SIOCSIWENCODEEXT

wpa_driver_wext_set_countermeasures

wlan0: RSN: flushing PMKID list in the driver

wlan0: Setting scan request: 0.100000 sec

ENGINE: Loading dynamic engine

ENGINE: Loading dynamic engine

EAPOL: SUPP_PAE entering state DISCONNECTED

EAPOL: Supplicant port status: Unauthorized

EAPOL: KEY_RX entering state NO_KEY_RECEIVE

EAPOL: SUPP_BE entering state INITIALIZE

EAP: EAP entering state DISABLED

Using existing control interface directory.

ctrl_interface_group=10 (from group name 'wheel')

ctrl_iface bind(PF_UNIX) failed: Address already in use

ctrl_iface exists and seems to be in use - cannot override it

Delete '/var/run/wpa_supplicant/wlan0' manually if it is not used anymore

Failed to initialize control interface 'DIR=/var/run/wpa_supplicant GROUP=wheel'.

You may have another wpa_supplicant process already running or the file was

left by an unclean termination of wpa_supplicant in which case you will need

to manually remove this file before starting wpa_supplicant again.

Failed to add interface wlan0

wlan0: Request to deauthenticate - bssid=00:00:00:00:00:00 pending_bssid=00:00:00:00:00:00 reason=3 state=DISCONNECTED

wlan0: State: DISCONNECTED -> DISCONNECTED

wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)

netlink: Operstate: ifindex=4 linkmode=-1 (no change), operstate=5 (IF_OPER_DORMANT)

EAPOL: External notification - portEnabled=0

EAPOL: External notification - portValid=0

wpa_driver_wext_set_countermeasures

wlan0: WPA: Clear old PMK and PTK

wlan0: Cancelling scan request

wlan0: Cancelling authentication timeout

Remove interface wlan0 from radio phy0

Remove radio phy0

netlink: Operstate: ifindex=4 linkmode=0 (kernel-control), operstate=6 (IF_OPER_UP)

```

----------

## khayyam

crayztechnique ...

that basically shows that you have another instance of wpa_supplicant running. So, either the previous instance of wpa_supplicant you started is still running (in which case kill it), or you're starting net.wlan0 in the runlevel (in which case stop it).

kill/stop ... remove the log file ... and try again.

best ... khay

----------

## khayyam

 *NeddySeagoon wrote:*   

> Google probably had it already, along with all the SSIDs they harvest when they make streetview.

 

NeddySeagoon ... they have it if you provide it (via one or other google products/service ... or via posting it on the internet) ... I'm not going to encourage them ;)

 *NeddySeagoon wrote:*   

> Its only useful if you are within 100 yards or so of crayztechniques AP. I know I'm not, since crayzteknician does not appear in any WiFi scans I do.

 

Right, but if you have enough of them (and you can pick up a lot via searches) you basically have a commodity, and I wouldn't be surprised if someone were doing this and selling them. Similarly its trival to wardrive a whole city and map the SSID's, this sort of data you can also find online (with metadata to google maps). Put these two together and you could effecively take your internet scam on the road ... and be fairly difficult to track down. 

best ... khay

----------

## axl

run a dmesg. make sure you are not missing some firmware files in /lib/firmware. it's usually pretty trivial.

----------

## crayztechnique

Alright so after much sweat and tears (Oh the tears) I got it up and running. First major problem that pretty much fixed everything was getting the SSID set correctly because it's not crazyteknician it's crayzteknician.   :Laughing: 

Then I had to go through the process of going in circles removing the correct config files that wpa_supplicant had put in place with the wrong SSID and finally I used

```
wpa_supplicant -B -Dnl80211 -wlan0 -c /etc/wpa_supplicant.conf
```

Having that log file helped a lot so thanks for that. Much appreciation to everyone for the help. My old Lenovo is wireless these days! I'm gonna take her outside. LOL

----------

