You are not logged in.

#1 2006-02-27 12:15:54

tezem
Member
Registered: 2004-11-04
Posts: 51
Website

Roaming Wireless config with wpa_supplicant?

Hi everybody,
as far as I understood it, it should be possible to configure wpa_supplicant so it will configure the wifi card after the APs it will find.
I'm not sure if wpa_supplicant will make periodic lookups and if neccesary connect to a new AP. Can somebody tell me if this is done when the daemon is running or not?

My problem with wpa_supplicant is that I cannot figure out why it is not working for me.
I followed http://wiki.archlinux.org/index.php/Wpa_supplicant but somehow it does not work.
Here are the important parts of my config files:

/etc/rc.conf

lo="lo 127.0.0.1"
eth0="dhcp"
wlan0="dhcp"
INTERFACES=(lo) # add eth0 into brackets if change back to original

NET_PROFILES=(home)

/etc/network-profile/home:

DESCRIPTION="home"

# Network Settings
INTERFACE=wlan0
HOSTNAME=Gomorrah

# Interface Settings (use IFOPTS="dhcp" for DHCP)
IFOPTS="dhcp" #"192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255"
#GATEWAY=192.168.0.1

# DNS Settings (optional)
#DOMAIN=localdomain
#DNS1=192.168.0.1
#DNS2=

# Wireless Settings (optional)
ESSID=genesis.net
#KEY=
IWOPTS="mode managed essid $ESSID channel 4"

#WIFI_INTERFACE=wlan0      # use this if you have a special wireless interface
                           # that is linked to the real $INTERFACE

#WIFI_WAIT=5            # seconds to wait for the wireless card to
                        # associate before bringing the interface up

USEWPA="yes"            # start wpa_supplicant with the profile
WPAOPTS="-D wext"       # use "" for normal operation or specify additional
                        # options (eg, "-D ipw")
                        # see /etc/wpa_supplicant.conf for configuration

/etc/wpa_supplicant.conf:

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
eapol_version=1
ap_scan=1
fast_reauth=1

network={
       ssid="genesis.net"
       key_mgmt=NONE
       wep_key0="my_key"
       #wep_key1=0102030405
       #wep_key2="1234567890123"
       wep_tx_keyidx=0
       priority=5
       #auth_alg=SHARED
}

blob-base64-exampleblob={
SGVsbG8gV29ybGQhCg==
}

The output to:

netcfg --stop wlan0

iwconfig wlan0 mode managed essid genesis.net channel 4

ifconfig wlan0 up

wpa_supplicant -D wext -i wlan0 -c /etc/wpa_supplicant.conf -dddd

is:

Initializing interface 'wlan0' conf '/etc/wpa_supplicant.conf' driver 'wext' ctrl_interface '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
Line: 647 - start of a new network block
ssid - hexdump_ascii(len=11):
     67 65 6e 65 73 69 73 2e 6e 65 74                  genesis.net     
key_mgmt: 0x4
wep_key0 - hexdump(len=15): [REMOVED]
wep_tx_keyidx=0 (0x0)
priority=5 (0x5)
Line: 658 - start of a new named blob 'exampleblob'
Priority group 5
   id=0 ssid='genesis.net'
Initializing interface (2) 'wlan0'
EAPOL: SUPP_PAE entering state DISCONNECTED
EAPOL: KEY_RX entering state NO_KEY_RECEIVE
EAPOL: SUPP_BE entering state INITIALIZE
EAP: EAP entering state DISABLED
EAPOL: External notification - portEnabled=0
EAPOL: External notification - portValid=0
SIOCGIWRANGE: WE(compiled)=19 WE(source)=16 enc_capa=0x0
  capabilities: key_mgmt 0x0 enc 0x3
Own MAC address: 00:0e:35:5d:a6:29
wpa_driver_wext_set_wpa
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
wpa_driver_wext_set_drop_unencrypted
Setting scan request: 0 sec 100000 usec
Added interface wlan0
Wireless event: cmd=0x8b06 len=8
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
State: DISCONNECTED -> SCANNING
Starting AP scan (broadcast SSID)
Scan timeout - try to get results
Received 744 bytes of scan results (4 BSSes)
Scan results: 4
Selecting BSS from priority group 5
0: 00:0c:20:00:9a:56 ssid='genesis.net' wpa_ie_len=0 rsn_ie_len=0 caps=0x11
   skip - no WPA/RSN IE
1: 00:0f:b5:22:75:c4 ssid='sepp' wpa_ie_len=0 rsn_ie_len=0 caps=0x11
   skip - no WPA/RSN IE
2: 00:0f:b5:55:a7:3a ssid='broome' wpa_ie_len=0 rsn_ie_len=0 caps=0x11
   skip - no WPA/RSN IE
3: 00:14:6c:21:37:02 ssid='<hidden>' wpa_ie_len=0 rsn_ie_len=0 caps=0x11
   skip - no WPA/RSN IE
   selected non-WPA AP 00:0c:20:00:9a:56 ssid='genesis.net'
Trying to associate with 00:0c:20:00:9a:56 (SSID='genesis.net' freq=0 MHz)
Cancelling scan request
WPA: clearing own WPA/RSN IE
Automatic auth_alg selection: 0x1
WPA: clearing AP WPA IE
WPA: clearing AP RSN IE
WPA: clearing own WPA/RSN IE
No keys have been configured - skip key clearing
wpa_driver_wext_set_key: alg=1 key_idx=0 set_tx=1 seq_len=0 key_len=15
wpa_driver_wext_set_drop_unencrypted
State: SCANNING -> ASSOCIATING
wpa_driver_wext_associate
Setting authentication timeout: 10 sec 0 usec
EAPOL: External notification - portControl=ForceAuthorized
Wireless event: cmd=0x8b15 len=20
Wireless event: new AP: 00:00:00:00:00:00
Added BSSID 00:00:00:00:00:00 into blacklist
State: ASSOCIATING -> DISCONNECTED
EAPOL: External notification - portEnabled=0
EAPOL: External notification - portValid=0
CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys
Wireless event: cmd=0x8b15 len=20
Wireless event: new AP: 00:00:00:00:00:00
BSSID 00:00:00:00:00:00 blacklist count incremented to 2
State: DISCONNECTED -> DISCONNECTED
EAPOL: External notification - portEnabled=0
EAPOL: External notification - portValid=0
CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys
Wireless event: cmd=0x8b15 len=20
Wireless event: new AP: 00:00:00:00:00:00
BSSID 00:00:00:00:00:00 blacklist count incremented to 3
State: DISCONNECTED -> DISCONNECTED
EAPOL: External notification - portEnabled=0
EAPOL: External notification - portValid=0
CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys
Wireless event: cmd=0x8b15 len=20
Wireless event: new AP: 00:00:00:00:00:00
.
.
.
BSSID 00:00:00:00:00:00 blacklist count incremented to 125
State: DISCONNECTED -> DISCONNECTED
EAPOL: External notification - portEnabled=0
EAPOL: External notification - portValid=0
CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys
Wireless event: cmd=0x8b15 len=20
Wireless event: new AP: 00:00:00:00:00:00
BSSID 00:00:00:00:00:00 blacklist count incremented to 126
State: DISCONNECTED -> DISCONNECTED
EAPOL: External notification - portEnabled=0
EAPOL: External notification - portValid=0
CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys
Wireless event: cmd=0x8b15 len=20
Wireless event: new AP: 00:00:00:00:00:00
BSSID 00:00:00:00:00:00 blacklist count incremented to 127
State: DISCONNECTED -> DISCONNECTED
EAPOL: External notification - portEnabled=0
EAPOL: External notification - portValid=0
CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys
Wireless event: cmd=0x8b15 len=20
Wireless event: new AP: 00:00:00:00:00:00
BSSID 00:00:00:00:00:00 blacklist count incremented to 128
State: DISCONNECTED -> DISCONNECTED
EAPOL: External notification - portEnabled=0
EAPOL: External notification - portValid=0
CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys
Wireless event: cmd=0x8b15 len=20
Wireless event: new AP: 00:00:00:00:00:00
BSSID 00:00:00:00:00:00 blacklist count incremented to 129
State: DISCONNECTED -> DISCONNECTED
EAPOL: External notification - portEnabled=0
EAPOL: External notification - portValid=0
CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys
Authentication with 00:00:00:00:00:00 timed out.
BSSID 00:00:00:00:00:00 blacklist count incremented to 130
State: DISCONNECTED -> DISCONNECTED
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
EAPOL: External notification - portEnabled=0
EAPOL: External notification - portValid=0
Setting scan request: 0 sec 0 usec
State: DISCONNECTED -> SCANNING
Starting AP scan (broadcast SSID)
CTRL-EVENT-TERMINATING - signal 2 received
Removing interface wlan0
State: SCANNING -> DISCONNECTED
No keys have been configured - skip key clearing
EAPOL: External notification - portEnabled=0
EAPOL: External notification - portValid=0
wpa_driver_wext_set_wpa
wpa_driver_wext_set_drop_unencrypted
wpa_driver_wext_set_countermeasures
No keys have been configured - skip key clearing
Removed BSSID 00:00:00:00:00:00 from blacklist (clear)
Cancelling scan request

I hope somebody can tell me about my mistake/s.

thx,
tezem[/code][/url]

Offline

#2 2006-05-02 11:34:27

tezem
Member
Registered: 2004-11-04
Posts: 51
Website

Re: Roaming Wireless config with wpa_supplicant?

Today I tried again to get wifi running over wpa_supplicant but this wasn't successfull.
I don't understand why it is not working because when I make "wpa_supplicant -D wext -i wlan0 -c /etc/wpa_supplicant.conf -dddd" I get:

Initializing interface 'wlan0' conf '/etc/wpa_supplicant.conf' driver 'wext' ctrl_interface '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
Line: 647 - start of a new network block
ssid - hexdump_ascii(len=11):
     67 65 6e 65 73 69 73 2e 6e 65 74                  genesis.net
key_mgmt: 0x4
wep_key0 - hexdump(len=15): [REMOVED]
wep_tx_keyidx=0 (0x0)
priority=5 (0x5)
Line: 658 - start of a new named blob 'exampleblob'
Priority group 5
   id=0 ssid='genesis.net'
Initializing interface (2) 'wlan0'
EAPOL: SUPP_PAE entering state DISCONNECTED
EAPOL: KEY_RX entering state NO_KEY_RECEIVE
EAPOL: SUPP_BE entering state INITIALIZE
EAP: EAP entering state DISABLED
EAPOL: External notification - portEnabled=0
EAPOL: External notification - portValid=0
SIOCGIWRANGE: WE(compiled)=19 WE(source)=18 enc_capa=0xf
  capabilities: key_mgmt 0xf enc 0xf
Own MAC address: 00:0e:35:5d:a6:29
wpa_driver_wext_set_wpa
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
wpa_driver_wext_set_drop_unencrypted
Setting scan request: 0 sec 100000 usec
Added interface wlan0
Wireless event: cmd=0x8b06 len=8
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
State: DISCONNECTED -> SCANNING
Starting AP scan (broadcast SSID)
Scan timeout - try to get results
Received 551 bytes of scan results (3 BSSes)
Scan results: 3
Selecting BSS from priority group 5
0: 00:0c:20:00:9a:56 ssid='genesis.net' wpa_ie_len=0 rsn_ie_len=0 caps=0x11
   skip - no WPA/RSN IE
1: 00:0f:b5:55:a7:3a ssid='broome' wpa_ie_len=0 rsn_ie_len=0 caps=0x11
   skip - no WPA/RSN IE
2: 00:0f:b5:22:75:c4 ssid='sepp' wpa_ie_len=0 rsn_ie_len=0 caps=0x11
   skip - no WPA/RSN IE
   selected non-WPA AP 00:0c:20:00:9a:56 ssid='genesis.net'
Trying to associate with 00:0c:20:00:9a:56 (SSID='genesis.net' freq=0 MHz)
Cancelling scan request
WPA: clearing own WPA/RSN IE
Automatic auth_alg selection: 0x1
WPA: clearing AP WPA IE
WPA: clearing AP RSN IE
WPA: clearing own WPA/RSN IE
No keys have been configured - skip key clearing
wpa_driver_wext_set_key: alg=1 key_idx=0 set_tx=1 seq_len=0 key_len=15
ioctl[SIOCSIWENCODEEXT]: Invalid argument
Driver did not support SIOCSIWENCODEEXT
wpa_driver_wext_set_drop_unencrypted
State: SCANNING -> ASSOCIATING
wpa_driver_wext_associate
Setting authentication timeout: 10 sec 0 usec
EAPOL: External notification - portControl=ForceAuthorized
Wireless event: cmd=0x8b06 len=8
Wireless event: cmd=0x8b1a len=20
Wireless event: cmd=0x8b15 len=20
Wireless event: new AP: 00:00:00:00:00:00
Added BSSID 00:00:00:00:00:00 into blacklist
State: ASSOCIATING -> DISCONNECTED
EAPOL: External notification - portEnabled=0
EAPOL: External notification - portValid=0
CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
Wireless event: cmd=0x8b15 len=20
Wireless event: new AP: 00:0c:20:00:9a:56
State: DISCONNECTED -> ASSOCIATED
Associated to a new BSS: BSSID=00:0c:20:00:9a:56
Associated with 00:0c:20:00:9a:56
WPA: Association event - clear replay counter
EAPOL: External notification - portEnabled=0
EAPOL: External notification - portValid=0
EAPOL: External notification - portEnabled=1
EAPOL: SUPP_PAE entering state S_FORCE_AUTH
EAPOL: SUPP_BE entering state IDLE
Cancelling authentication timeout
State: ASSOCIATED -> COMPLETED
CTRL-EVENT-CONNECTED - Connection to 00:0c:20:00:9a:56 completed (auth)
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added

For me this looks quite promising. The interface is also listed under ifconfig after that:

wlan0     Link encap:Ethernet  HWaddr 00:0E:35:5D:A6:29
          inet6 addr: fe80::20e:35ff:fe5d:a629/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1 errors:0 dropped:23 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:30284 (29.5 Kb)
          Interrupt:5 Base address:0xe000 Memory:d0002000-d0002fff

But when I make "dhcpcd wlan0" I don't receive an IP address.
This doesn't work also if I set the routes before:

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     *               255.255.255.0   U     0      0        0 wlan0
192.168.1.0     *               255.255.255.0   U     0      0        0 eth0
default         192.168.1.254   0.0.0.0         UG    0      0        0 wlan0
default         192.168.1.254   0.0.0.0         UG    0      0        0 eth0

Does anybody know whats missing or wrong?

Offline

#3 2006-05-02 17:06:55

gwine
Member
From: Finland
Registered: 2006-03-20
Posts: 14

Re: Roaming Wireless config with wpa_supplicant?

What kind of wlan-interface you have? And I think rc.conf is missing something - here's my suggestion

# NETWORKING
# -----------------------------------------------------------------------
#
HOSTNAME="your hostname"
#
# Interfaces to start at boot-up (in this order)
# Declare each interface then list in INTERFACES
#   - prefix an entry in INTERFACES with a ! to disable it
#
# Note: to use DHCP, set your interface to be "dhcp" (eth0="dhcp")
#
lo="lo 127.0.0.1"
#eth0="dhcp"
wlan0=dhcp
INTERFACES=(lo !eth0 wlan0)
#
# Routes to start at boot-up (in this order)
# Declare each route then list in ROUTES
#   - prefix an entry in ROUTES with a ! to disable it
#
# gateway="default gw 192.168.0.1"
# ROUTES=(!gateway)
#
# Enable these network profiles at boot-up.  These are only useful
# if you happen to need multiple network configurations (ie, laptop users)
#   - set to 'menu' to present a menu during boot-up
#   - prefix an entry with a ! to disable it
#
# Network profiles are found in /etc/network-profiles
#
#NET_PROFILES=(main)

Offline

#4 2006-05-04 18:45:48

tezem
Member
Registered: 2004-11-04
Posts: 51
Website

Re: Roaming Wireless config with wpa_supplicant?

I have a ipw2200 card and the connection is working with some older scripts only useable for WEP encryption.

The script in /etc/network-profiles/ will only work if it is listed in the NET_PROFILES array in the /etc/rc.conf
So this has nothing to do with the Interfaces array afair.

Offline

Board footer

Powered by FluxBB