Jump to content

wpa_supplicant in start script - how does it work?


henner
 Share

Recommended Posts

Hi,

 

the reason why my wlan is crypted by WEP-key is, that i have no success with enter the wpa_supplicant command line in the start script (/etc/init.d/network).

 

What is to do that wpa_supplicant comes up with the WLAN initiation at boot time?

 

wpa_supplicant works when i start it manualy.

 

thx for yor help.

 

Henner

Link to comment
Share on other sites

I did all configuration by editing config scripts but that what a while ago. You might be able to achieve the same result using GUI tools. Here is what you need to do:

 

1. In the interface config script (in my case it's /etc/sysconfig/network-scripts/ifcfg-eth1), you need to add lines

ENCRYPTION=ON
WPA=y

2. The script ifup-wireless must include the lines which start wpa supplicant when the interface is up. Append these lines in the end of the file (assuming that wpa_supplicant is in /usr/local/bin/, change as necessary):

 
if [ "$WPA" = "y" -a -x /usr/local/bin/wpa_supplicant ]; then
   /usr/local/bin/wpa_supplicant -Bw -c/etc/wpa_supplicant.conf -i$DEVICE
fi

 

3. Check if you have the script /etc/sysconfig/network-scripts/ifdown-wireless. If not, create it, it should contain these two lines:

#!/bin/bash
killall wpa_supplicant

 

This script will have to be called from /etc/sysconfig/network-scripts/ifdown. You must have these lines in ifdown:

DEVICETYPE=`echo $DEVICE | sed "s/[0-9]*$//"`
[ -z "$REALDEVICE" ] && REALDEVICE=`echo ${DEVICE} | sed 's/:.*//g'`

# is the device wireless?
is_wireless_device ${DEVICE} && . ./ifdown-wireless

If you don't have the last two lines, add them. That's all. Now restart network:

# service network restart

 

Edit: Of course, you need to be root to edit the scripts. All scripts you create must be made executable:

# chmod a+x <scriptname>

Link to comment
Share on other sites

  • 2 months later...
Tried it - no joy :( I can connect with no security, and my XP machines all connect with WPA, but something is wrong with wpa_supplicant :wall:

 

If WPA supplicant won't work from the CLI, it's not going to work by adding those commands to start up.

Link to comment
Share on other sites

  • 4 weeks later...
What is the contents of your wpa_supplicant.conf file? I've had it working perfectly fine under Mandriva 2006.

 

I've tried a lot of different contents based on different threads I've Googled... Currently the contents are:

 

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

eapol_version=1

ap_scan=1

 

network={

ssid="linksys"

key_mgmt=WPA-PSK

proto=WPA

pairwise=TKIP

group=TKIP

psk="my really secret passphrase"

}

 

I can see my access point from the Mandriva One laptop, and it has a new Linksys wireless card and I have a new Linksys WAP54G access point and a new Linksys WRT54G router, but it will not connect to either of them using WPA.

Link to comment
Share on other sites

Here is mine

#ctrl_interface=/var/run/wpa_supplicant
#ctrl_interface_group=wheel
ap_scan=2

network={
 ssid="MySSID"
 scan_ssid=0
 key_mgmt=WPA-PSK
 proto=WPA
 pairwise=TKIP
 group=TKIP
 psk="my really secret passphrase"
}

As you can notice, I have scan_ssid=0 in combination with ap_scan=2. This is because my AP does not broadcast SSID. It took a while for me to get it to work with SSID broadcast disabled, and I had to try several versions of the supplicant. Currently, I use version 0.3.9 built from the source.

 

Try to enable the broadcast (if it's disabled) and also try the combination ap_scan=1, scan_ssid=1. Also, make sure that the WPA key on the router is set to ASCII and that the key length is within the limits (30 ASCII characters if I am not mistaken).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...