# Cannot set rt61pci into master mode[SOLVED]

## El_Presidente_Pufferfish

```
# lspci -k

...

01:06.0 Network controller: RaLink RT2561/RT61 802.11g PCI

   Subsystem: Linksys WMP54G ver 4.1

   Kernel driver in use: rt61pci

   Kernel modules: rt61pci

...

```

```
# iwconfig

...

wlan0     IEEE 802.11bg  ESSID:off/any  

          Mode:Managed  Frequency:2.437 GHz  Access Point: Not-Associated   

          Tx-Power=20 dBm   

          Retry  long limit:7   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

```

```
# iwconfig wlan0 mode master

Error for wireless request "Set Mode" (8B06) :

    SET failed on device wlan0 ; Invalid argument.

```

Kernel .config

```
# cat /etc/conf.d/net

# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /etc/conf.d/net.example and save your configuration

# in /etc/conf.d/net (this file :]!).

config_eth0="192.168.1.50/24 brd 192.168.1.255"

routes_eth0="default via 192.168.1.1"

dns_servers_eth0="192.168.1.1"

modules_wlan0="!iwconfig !wpa_supplicant"

#config_wlan0="192.168.1.1 broadcast 192.168.1.255 netmask 255.255.255.0"

config_wlan0="192.168.1.1/24"

channel_wlan0="6"

essid_wlan0="seibzehn"

mode_wlan0="master"

#postup () {

#        iwconfig wlan0 rate 54M

#}

#modules_eth0="!plug"

#config_eth0="192.168.0.1 brd 192.168.0.255"

#dhcp_eth0="nodns"

```

Last edited by El_Presidente_Pufferfish on Sat Nov 27, 2010 9:37 pm; edited 1 time in total

----------

## idella4

El_Presidente_Pufferfish, 

back for more.  I still have your config from last time.  Right,

  your system is pretty similar to mine, a different network hardware.

```

genny bin # iwconfig 

lo        no wireless extensions.

eth0      no wireless extensions.

wlan0     IEEE 802.11bg  ESSID:"delaney"  

          Mode:Managed  Frequency:2.462 GHz  Access Point: 00:1F:C6:5C:3F:CD   

          Bit Rate=1 Mb/s   Tx-Power=20 dBm   

          Retry  long limit:7   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality=28/70  Signal level=-82 dBm  

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

```

So mine is up & running.  Main thing is you're relying on iwconfig to set your master mode.

```

genny bin # iwconfig wlan0 mode master 

Error for wireless request "Set Mode" (8B06) :

    SET failed on device wlan0 ; Invalid argument.

```

I don't offhand know iwconfig well enough to debug it, however, I use wpa_supplicant which has become pretty well the norm in not just gentoo.

```

genny bin # cat wpa.sh 

ifconfig eth0 down

ifconfig wlan0 up

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

dhclient wlan0

```

```

genny bin # cat  /etc/conf.d/net

# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /etc/conf.d/net.example and save your configuration

# in /etc/conf.d/net (this file :]!).

dns_domain_lo=homenetwork

#config_wlan0=("dhcp")

config_eth0=("dhcp")

bridge_virbr0="eth0"

config_virbr0=("dhcp") 

#config_eth0=("null")

#config_eth0=("null")

# Prefer wpa_supplicant over wireless-tools

#modules=( "wpa_supplicant" )

# It's important that we tell wpa_supplicant which driver we should

# be using as it's not very good at guessing yet

#wpa_supplicant_wlan0="-Dmadwifi"

#wpa_supplicant_wlan0="ath5k"

#iwconfig_wlan0="mode managed"

```

Now mine is currently commented out since I have both wired & wireless, and wired is fitrst choice.  The lower half pertains to wpa_supplicant, and just change mode manged to mode master, and post a big smiley.    :Very Happy: 

----------

## El_Presidente_Pufferfish

wpa_supplicant is for client's.  I'm trying to set up an Access Point.

Setting

```
iwconfig_wlan0="mode master" 
```

in /etc/conf.d/net has no effect either.

----------

## idella4

```

genny linux-2.6.34-hardened-r6 # ifconfig eth0 down

genny linux-2.6.34-hardened-r6 # ifconfig wlan0 up 

idella@genny ~/bin $ sudo rm /var/run/wpa_supplicant/wlan0

idella@genny ~/bin $ sudo wpa.sh 

Trying to associate with 00:1f:c6:5c:3f:cd (SSID='delaney' freq=2462 MHz)

Associated with 00:1f:c6:5c:3f:cd

WPA: Key negotiation completed with 00:1f:c6:5c:3f:cd [PTK=TKIP GTK=TKIP]

CTRL-EVENT-CONNECTED - Connection to 00:1f:c6:5c:3f:cd completed (auth) [id=0 id_str=]

CTRL-EVENT-DISCONNECTED bssid=00:1f:c6:5c:3f:cd reason=0

ioctl[SIOCSIWSCAN]: Device or resource busy

Failed to initiate AP scan.

Trying to associate with 00:1f:c6:5c:3f:cd (SSID='delaney' freq=2462 MHz)

Associated with 00:1f:c6:5c:3f:cd

WPA: Invalid EAPOL-Key MIC when using TPTK - ignoring TPTK

WPA: Could not verify EAPOL-Key MIC - dropping packet

WPA: Invalid EAPOL-Key MIC when using TPTK - ignoring TPTK

WPA: Could not verify EAPOL-Key MIC - dropping packet

Authentication with 00:1f:c6:5c:3f:cd timed out.

CTRL-EVENT-DISCONNECTED bssid=00:00:00:00:00:00 reason=0

Trying to associate with 00:1f:c6:5c:3f:cd (SSID='delaney' freq=2462 MHz)

Associated with 00:1f:c6:5c:3f:cd

genny linux-2.6.34-hardened-r6 # dhclient wlan0

Internet Systems Consortium DHCP Client V3.1-ESV-Gentoo

Copyright 2004-2010 Internet Systems Consortium.

All rights reserved.

For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/wlan0/00:11:95:e9:b2:b7

Sending on   LPF/wlan0/00:11:95:e9:b2:b7

Sending on   Socket/fallback

DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4

DHCPOFFER from 192.168.0.1

DHCPREQUEST on wlan0 to 255.255.255.255 port 67

DHCPACK from 192.168.0.1

bound to 192.168.0.5 -- renewal in 1479 seconds.

genny linux-2.6.34-hardened-r6 # iwconfig

lo        no wireless extensions.

eth0      no wireless extensions.

wlan0     IEEE 802.11bg  ESSID:"delaney"  

          Mode:Managed  Frequency:2.462 GHz  Access Point: 00:1F:C6:5C:3F:CD   

          Bit Rate=1 Mb/s   Tx-Power=20 dBm   

          Retry  long limit:7   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality=25/70  Signal level=-85 dBm  

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

```

This          Mode:Managed  Frequency:2.462 GHz  Access Point: 00:1F:C6:5C:3F:CD   

is an access point.  It's in mode managed since I have no idea why it should be in mode master. It works and is supplying the connectivity to the forum as I type.

----------

## El_Presidente_Pufferfish

further googling tells me that setting mode master won't work.  I continued setting up hostapd, and it seems to work just fine, though.

for reference, my hostapd.conf:

```
# egrep "^[^#]" /etc/hostapd/hostapd.conf 

interface=wlan0

logger_syslog=-1

logger_syslog_level=2

logger_stdout=-1

logger_stdout_level=2

dump_file=/tmp/hostapd.dump

ctrl_interface=/var/run/hostapd

ctrl_interface_group=0

ssid=PRIVATE

hw_mode=g

channel=8

auth_algs=3

wpa=2

wpa_passphrase=PRIVATE

wpa_pairwise=TKIP CCMP
```

----------

