Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Ok, so I finally got my wireless working on Slackware. Trouble is, I don't really understand what I'm doing. I'm currently root and in order to get wireless, I first have to:

wpa_supplicant -c/etc/wpa_supplicant.conf -Dwext -iwlan0

then:

/etc/rc.d/rc.inet1 wlan0_start

If I do the second line first, I get time-out, no connection.

So my questions are:

  1. is there a better way to do this (am I having some kind of conflict between config files)?

  2. can I automate this on startup?

  3. can I automate this for another account besides root?

bash-4.1# wpa_supplicant -c/etc/wpa_supplicant.conf -d -Dwext -iwlan0 &
[1] 2935
bash-4.1# Initializing interface 'wlan0' conf '/etc/wpa_supplicant.conf' driver 'wext' ctrl_interface 'N/A' bridge 'N/A'
Configuration file '/etc/wpa_supplicant.conf' -> '/etc/wpa_supplicant.conf'
Reading configuration file '/etc/wpa_supplicant.conf'
ctrl_interface='/var/run/wpa_supplicant'
ctrl_interface_group='0'
eapol_version=1
ap_scan=1
fast_reauth=1
Priority group 10
   id=0 ssid=(##hidden##)
Priority group 0
   id=1 ssid=''
WEXT: cfg80211-based driver detected
SIOCGIWRANGE: WE(compiled)=22 WE(source)=21 enc_capa=0xf
  capabilities: key_mgmt 0xf enc 0xf flags 0x0
netlink: Operstate: linkmode=1, operstate=5
Own MAC address: (##HIDDEN##)
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_countermeasures
RSN: flushing PMKID list in the driver
Setting scan request: 0 sec 100000 usec
WPS: UUID based on MAC address - (##HIDDEN##)
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
EAPOL: Supplicant port status: Unauthorized
EAPOL: Supplicant port status: Unauthorized
ctrl_interface_group=0
Added interface wlan0
RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
Wireless event: cmd=0x8b06 len=12
RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
Wireless event: cmd=0x8b1a len=16
State: DISCONNECTED -> SCANNING
Starting AP scan for wildcard SSID
Scan requested (ret=0) - scan timeout 5 seconds
EAPOL: disable timer tick
EAPOL: Supplicant port status: Unauthorized
RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
Wireless event: cmd=0x8b19 len=16
Scan results did not fit - trying larger buffer (8192 bytes)
Received 7670 bytes of scan results (15 BSSes)
BSS: Start scan result update 1
(##BUNCH OF SSID's for my local removed##)
New scan results available
WPS: Unsupported attribute type 0x1049 len=6
WPS: Unsupported attribute type 0x1049 len=6
Selecting BSS from priority group 10
Try to find WPA-enabled AP
(##HIDDEN##)
Trying to associate with (##HIDDEN##)
Cancelling scan request
WPA: clearing own WPA/RSN IE
Automatic auth_alg selection: 0x1
RSN: using IEEE 802.11i/D9.0
WPA: Selected cipher suites: group 8 pairwise 24 key_mgmt 2 proto 2
WPA: clearing AP WPA IE
WPA: set AP RSN IE - (##HIDDEN##)
WPA: using GTK TKIP
WPA: using PTK CCMP
WPA: using KEY_MGMT WPA-PSK
WPA: Set own WPA IE default - hexdump (##HIDDEN##)
No keys have been configured - skip key clearing
State: SCANNING -> ASSOCIATING
wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)
netlink: Operstate: linkmode=-1, operstate=5
wpa_driver_wext_associate
wpa_driver_wext_set_drop_unencrypted
wpa_driver_wext_set_psk
Setting authentication timeout: 10 sec 0 usec
EAPOL: External notification - EAP success=0
EAPOL: Supplicant port status: Unauthorized
EAPOL: External notification - EAP fail=0
EAPOL: Supplicant port status: Unauthorized
EAPOL: External notification - portControl=Auto
EAPOL: Supplicant port status: Unauthorized
RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
Wireless event: cmd=0x8b1a len=16
RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
Wireless event: cmd=0x8b06 len=12
RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
Wireless event: cmd=0x8b04 len=16
RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
Wireless event: cmd=0x8b1a len=24
RTM_NEWLINK: operstate=0 ifi_flags=0x11003 ([UP][LOWER_UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
RTM_NEWLINK: operstate=0 ifi_flags=0x11003 ([UP][LOWER_UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
Wireless event: cmd=0x8c08 len=198
AssocResp IE wireless event - hexdump (##HIDDEN##)
RTM_NEWLINK: operstate=0 ifi_flags=0x11003 ([UP][LOWER_UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
Wireless event: cmd=0x8b15 len=24
Wireless event: new AP: (##HIDDEN##)
Association info event
resp_ies - hexdump(len=182): (##HIDDEN##)
State: ASSOCIATING -> ASSOCIATED
wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)
netlink: Operstate: linkmode=-1, operstate=5
Associated to a new BSS: BSSID=(##HIDDEN##)
No keys have been configured - skip key clearing
Associated with (##HIDDEN##)
WPA: Association event - clear replay counter
WPA: Clear old PTK
EAPOL: External notification - portEnabled=0
EAPOL: Supplicant port status: Unauthorized
EAPOL: External notification - portValid=0
EAPOL: Supplicant port status: Unauthorized
EAPOL: External notification - EAP success=0
EAPOL: Supplicant port status: Unauthorized
EAPOL: External notification - portEnabled=1
EAPOL: SUPP_PAE entering state CONNECTING
EAPOL: enable timer tick
EAPOL: SUPP_BE entering state IDLE
Setting authentication timeout: 10 sec 0 usec
Cancelling scan request
RX EAPOL (##HIDDEN##)
Setting authentication timeout: 10 sec 0 usec
IEEE 802.1X RX: version=1 type=3 length=95
  EAPOL-Key type=2
  key_info 0x8a (ver=2 keyidx=0 rsvd=0 Pairwise Ack)
  key_length=16 key_data_length=0
  replay_counter - hexdump(len=8): (##HIDDEN##)
  key_nonce - hexdump(len=32): (##HIDDEN##)
  key_iv - hexdump(len=16): (##HIDDEN##)
  key_rsc - hexdump(len=8): (##HIDDEN##)
  key_id (reserved) - hexdump(len=8): (##HIDDEN##)
  key_mic - hexdump(len=16): (##HIDDEN##)
State: ASSOCIATED -> 4WAY_HANDSHAKE
WPA: RX message 1 of 4-Way Handshake from (##HIDDEN##)
RSN: msg 1/4 key data - hexdump(len=0):
WPA: Renewed SNonce - hexdump(len=32): (##HIDDEN##)
WPA: PTK derivation - A1=(##HIDDEN##)
WPA: PMK - hexdump(len=32): [REMOVED]
WPA: PTK - hexdump(len=48): [REMOVED]
WPA: WPA IE for msg 2/4 - hexdump(len=22): (##HIDDEN##)
WPA: Sending EAPOL-Key 2/4
RX EAPOL from (##HIDDEN##)
IEEE 802.1X RX: version=1 type=3 length=175
  EAPOL-Key type=2
  key_info 0x13ca (ver=2 keyidx=0 rsvd=0 Pairwise Install Ack MIC Secure Encr)
  key_length=16 key_data_length=80
  replay_counter - hexdump(len=8): 00 00 00 00 00 00 00 02
  key_nonce - hexdump(len=32): (##HIDDEN##)
  key_iv - hexdump(len=16): (##HIDDEN##)
  key_rsc - hexdump(len=8): (##HIDDEN##)
  key_id (reserved) - hexdump(len=8): (##HIDDEN##)
  key_mic - hexdump(len=16): (##HIDDEN##)
RSN: encrypted key data - hexdump(len=80): (##HIDDEN##)
WPA: decrypted EAPOL-Key key data - hexdump(len=72): [REMOVED]
State: 4WAY_HANDSHAKE -> 4WAY_HANDSHAKE
WPA: RX message 3 of 4-Way Handshake from (##HIDDEN##)(ver=2)
WPA: IE KeyData - hexdump(len=72): (##HIDDEN##)
WPA: RSN IE in EAPOL-Key - hexdump(len=26): (##HIDDEN##)
WPA: GTK in EAPOL-Key - hexdump(len=40): [REMOVED]
WPA: Sending EAPOL-Key 4/4
WPA: Installing PTK to the driver.
wpa_driver_wext_set_key: alg=3 key_idx=0 set_tx=1 seq_len=6 key_len=16
EAPOL: External notification - portValid=1
State: 4WAY_HANDSHAKE -> GROUP_HANDSHAKE
RSN: received GTK in pairwise handshake - hexdump(len=34): [REMOVED]
WPA: Group Key - hexdump(len=32): [REMOVED]
WPA: Installing GTK to the driver (keyidx=2 tx=0 len=32).
WPA: RSC - hexdump(len=6): 00 01 00 00 00 00
wpa_driver_wext_set_key: alg=2 key_idx=2 set_tx=0 seq_len=6 key_len=32
WPA: Key negotiation completed with  [PTK=CCMP GTK=TKIP]
Cancelling authentication timeout
State: GROUP_HANDSHAKE -> COMPLETED
CTRL-EVENT-CONNECTED - Connection to (##HIDDEN##) completed (auth) [id=0 id_str=]
wpa_driver_wext_set_operstate: operstate 0->1 (UP)
netlink: Operstate: linkmode=-1, operstate=6
EAPOL: External notification - portValid=1
EAPOL: External notification - EAP success=1
EAPOL: SUPP_PAE entering state AUTHENTICATING
EAPOL: SUPP_BE entering state SUCCESS
EAP: EAP entering state DISABLED
EAPOL: SUPP_PAE entering state AUTHENTICATED
EAPOL: Supplicant port status: Authorized
EAPOL: SUPP_BE entering state IDLE
EAPOL authentication completed successfully
RTM_NEWLINK: operstate=1 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
EAPOL: startWhen --> 0
EAPOL: disable timer tick
bash-4.1# /etc/rc.d/rc.inet1 wlan0_start
bash-4.1# BSS: Expire BSS 0 due to age
BSS: Remove id (##HIDDEN##)
BSS: Remove id (##HIDDEN##)
BSS: Remove id (##HIDDEN##)
(etc)

Here's the output from lspci:

ubsystem: Intel Corporation Device 1121
        Flags: bus master, fast devsel, latency 0, IRQ 41
        Memory at f8000000 (64-bit, non-prefetchable) [size=8K]
        Capabilities: [c8] Power Management version 3
        Capabilities: [d0] MSI: Enable+ Count=1/1 Maskable- 64bit+
        Capabilities: [e0] Express Endpoint, MSI 00
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [140] Device Serial Number (##HIDDEN##)
        Kernel driver in use: iwlagn
        Kernel modules: iwlagn
share|improve this question
    
I see two typos: you need a space after '-c' and it's wlan0, not wanl0. Paste the output of 'lspci -v' executed as root. –  schaiba Jun 7 '13 at 16:56
    
@schaiba: you don't need a space after -c, and you need -iwlan0, not just -wlan0. @Xurtio: I would suggest -Dnl80211 with kernels above 3.0. wext is deprecated. I would also suggest to post the output of your wpa_supplicant tentative either as is or with the -d or -dd flag, removing any sensitive information (such as SSID or BSSIDs, passwords are already removed) –  BatchyX Jun 7 '13 at 17:38
    
You're right, I stand corrected. –  schaiba Jun 7 '13 at 17:41
    
ah yes, that's a typo. Should be -iwlan0. Point was that it only worked with this line. Will try solutions when I'm back at my pc. –  Xurtio Jun 7 '13 at 19:41
    
@BatchyX ok, dumped the output from wpa_supplicant, removed all personal info I could find –  Xurtio Jun 7 '13 at 21:41

3 Answers 3

First of all, if you want to use the init scripts, you have to put the wireless configuration into /etc/rc.d/rc.inet1.conf (remember to leave it accessible only for root, since you'd leak the network password otherwise). However, unless this is a machine that for some reason uses the same wireless network all the time, you probably want something better configurable.

From my own experience, I can say that wicd works rather well. It probably doesn't catch all possible authentication possibilities, but should handle most cases just fine.

In the default setup you just need to make sure /etc/rc.d/rc.wicd is executable (which it is by default). That ensures that the daemon is spawned (with enough privileges) and then you need to access it with the client part wicd-client, which is actually just a wrapper for Wicd's various front-ends (command-line, curses, GTK and possibly also QT). If you are using a graphical environment, the client will keep an icon in the system tray.

Another option is the NetworkManager, which I personally am finding to be too heavyweight and quite inflexible over and over again.

If you want to handle the networking yourself, you can get an inspiration from my old script (no error checking, everything is expected to work smoothly, otherwise it fails miserably):

#!/bin/bash
MODULENAME=your_driver
IFWIRED=eth0
IFWIFI=wlan0

case "$1" in
    start)
        # check that the driver module is loaded
        if ! lsmod | grep $MODULENAME &>/dev/null ; then
            echo "loading $MODULENAME"
            modprobe -v $MODULENAME
            sleep 5
        fi
        echo "running wpa_supplicant"
        wpa_supplicant -D wext -i $IFWIFI \
            -c /etc/wpa_supplicant.conf >& /dev/null &
        echo "shutting down $IFWIRED"
        /sbin/ifconfig $IFWIRED down
        # wait for things to settle down
        sleep 10
        echo "running dhcpcd"
        dhcpcd -n -p -d $IFWIFI
        ;;
    stop)
        echo "shutting down dhcpcd on wlan0"
        dhcpcd -k $IFWIRED
        echo "shutting down wpa_supplicant"
        wpa_cli terminate
        echo "unloading $MODULENAME"
        modprobe -rv $MODULENAME
        ;;
    *)
        echo "$0 <start|stop>"
esac

basic wpa_supplicant.conf entry for simple home networks may look like this:

network={
    ssid="YOURNETSSID"
    psk="password"
    proto=WPA2
    key_mgmt=WPA-PSK
    pairwise=TKIP CCMP
    group=TKIP CCMP
}

wpa_supplicant.conf man page has some more examples for more complicated setups (usually useful in corporate networks).

share|improve this answer
    
my wireless configuration is in inet1.conf, it just doesn't work. It suddenly works if I invoke wpa supplicant, but that was supposed to be a debug step in the tutorial I was reading. –  Xurtio Jun 7 '13 at 20:37
up vote 0 down vote accepted

wpa_supplicant is necessary for this wireless configuration.

If your wireless isn't initiating at startup and you think all your information is correct in rc.inet1.conf, then you probably forgot to uncomment the wpa_supplicant line in your rc.inet1.conf file. Once I did that, the wireless initiated during startup without either line having to be entered manually.

I also changed -Dwext to -Dnl80211 per BatchyX's suggestion.

share|improve this answer

When I first setup slackware, I also noticed I had to be root, to be able to use wpa_supplicant. Just try echo $PATH, and make sure /sbin and /usr/sbin (for shutdown and the like) are included in the environment variable, if not add

export PATH=/sbin:/usr/sbin:$PATH

To your .profile or .bashrc file, or export it in the /etc/rc.local file

Since my slackware machine needn't be too secure, I opted to add the wpa_supplicant command to /etc/rc.d/rc.local, simply adding

wpa_supplicant -B -Dwext -ieth1 -c/etc/wpa_supplicant.conf

And, for every network I connect to, doing:

wpa_passphrase somenetwork somekey >> /etc/wpa_supplicant.conf

works fine

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.