# [Solved] wpa_supplicant gives errors

## hadoque

Hi

 I'm trying to configure wpa-supplicant. I have my wireless network working well with wep and iwconfig.

This is /etc/conf.d/net

```

essid_eth1="Aphuset"

modules =( "wpa_supplicant" )

wpa_supplicant_eth1="-Dipw2200"

config_eth1=( "dhcp" )

```

and /etc/wpa_supplicant/wpa_supplicant.conf

```
ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

ap_scan=1

# This is a network block that connects to a specific unsecured access point.

# We give it a higher priority.

network={

ssid="Aphuset"

key_mgmt=NONE

wep_key0=xxxxxxxx

priority=5

}

# This is a network block that connects to any unsecured access point.

# We give it a low priority so any defined blocks are preferred.

network={

   key_mgmt=NONE

   priority=-9999999

}

```

When i restart net.eth1 (the wireless nic) i get:

```
snal ~ # /etc/init.d/net.eth1 restart

 * Caching service dependencies ...

/etc/conf.d/net: line 3: syntax error near unexpected token `('

/etc/conf.d/net: line 3: `modules =( "wpa_supplicant" )'

/etc/conf.d/net: line 3: syntax error near unexpected token `('

/etc/conf.d/net: line 3: `modules =( "wpa_supplicant" )'

/etc/conf.d/net: line 3: syntax error near unexpected token `('

/etc/conf.d/net: line 3: `modules =( "wpa_supplicant" )'                  [ ok ]

/etc/conf.d/net: line 3: syntax error near unexpected token `('

/etc/conf.d/net: line 3: `modules =( "wpa_supplicant" )'

 * Unmounting network filesystems ...                                     [ ok ]

 * Stopping eth1

 *   Bringing down eth1

 *     Stopping dhcpcd on eth1 ...                                        [ ok ]

 *     Shutting down eth1 ...                                             [ ok ]

```

Why doesn't the system understand the syntax? wpa_supplicant package is emerged and driver ipw2200 loads and works nicely with iwconfig.Last edited by hadoque on Wed Sep 17, 2008 6:43 pm; edited 1 time in total

----------

## electronvolt

try removing the brackets from /etc/conf.d/net

```
essid_eth1="Aphuset"

modules="wpa_supplicant"

wpa_supplicant_eth1="-Dipw2200"

config_eth1="dhcp"

```

----------

## hadoque

Now i get 

```
snal ~ # /etc/init.d/net.eth1 restart

 * Caching service dependencies ...

/etc/conf.d/net: line 3: modules: command not found

/etc/conf.d/net: line 3: modules: command not found

/etc/conf.d/net: line 3: modules: command not found                       [ ok ]

/etc/conf.d/net: line 3: modules: command not found

```

I must be missing a package or something, but which one? I have both wireless-tools and wpa_supplicant installed...

----------

## overkll

It's giving you a good hint on where to look - line 3 of /etc/conf.d/net.  Try loosing the space between "modules" and "(".  Don't drop the (), re add them.

Also, if you want to make things easier on yourself, don't specify your ssid in /etc/conf.d/net.  You've already done that in /etc/wpa_supplicant/wpa_supplicant.conf.

If ipl2200 is indeed the correct module AND it's compile against the new mac80211 stack, your configurations should be as follows:

/etc/conf.d/net

```
modules_eth1=( "!iwconfig" "wpa_supplicant" )

wpa_supplicant_eth1="-Dwext"
```

"!iwconfig" disables the iwconfig gentoo module.  If you don't disable it, the init script will use iwconfig instead of wpa_supplicant to scan and associate. 

"-Dwext" means to use the kernel's wireless extensions.  This is the correct way for newer drivers that rely in the new 80211 stack.  Older drivers should use "-Ddrivername"

dhcp doesn't need to be specified, it's the default.

Your wpa_supplicant file looks fine.  Give it another shot...

----------

## hadoque

Thanks a lot! WPA encrypted network is now up and going!

----------

## overkll

You should add [Solved] to the subject line of the original post.

----------

