# IWConfig and MadWifi

## arsirc

Hello!

https://forums.gentoo.org/viewtopic-t-429133.html

thx ... Andreas

----------

## Ferdinando

Can you post the output of:

```
$ grep ath /etc/conf.d/net

$ grep -v '^#' /etc/conf.d/wireless | grep -v '^$'
```

Bye

----------

## arsirc

hello

@Ferdinando

thx for you help ...

here are the outputs:

```

xp2600 conf.d # grep ath /etc/conf.d/net

xp2600 conf.d # grep -v '^#' /etc/conf.d/wireless | grep -v '^$'

essid_ath0="THCLan"

mode_ath0="auto"

channel_ath0="3"

xp2600 conf.d #

```

----------

## Ferdinando

 *arsirc wrote:*   

> 
> 
> ```
> mode_ath0="auto"
> ```
> ...

 

try

```
mode_ath0="Managed"
```

or unset that option

Bye

----------

## arsirc

have set it to "managed":

```

xp2600 conf.d # /etc/init.d/net.ath0 start

 * Caching service dependencies ...                                                                [ ok ]

 * Starting ath0

 *   Configuring wireless network for ath0

 *   Failed to configure wireless for ath0                                                         [ !! ]

xp2600 conf.d #

```

unset:

```

xp2600 conf.d # /etc/init.d/net.ath0 start

 * Caching service dependencies ...                                                                [ ok ]

 * Starting ath0

 *   Configuring wireless network for ath0

 *   Failed to configure wireless for ath0                                                         [ !! ]

xp2600 conf.d #

```

kernel modules are loaded right.

output of lspci:

```

xp2600 conf.d # lspci

00:00.0 Host bridge: VIA Technologies, Inc. VT8366/A/7 [Apollo KT266/A/333]

00:01.0 PCI bridge: VIA Technologies, Inc. VT8366/A/7 [Apollo KT266/A/333 AGP]

00:07.0 Ethernet controller: Atheros Communications, Inc. AR5212 802.11abg NIC (rev 01)

00:08.0 Ethernet controller: 3Com Corporation 3c905B 100BaseTX [Cyclone] (rev 30)

00:0c.0 RAID bus controller: Promise Technology, Inc. PDC20276 (MBFastTrak133 Lite) (rev 01)

00:10.0 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 80)

00:10.1 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 80)

00:10.2 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 80)

00:10.3 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 82)

00:11.0 ISA bridge: VIA Technologies, Inc. VT8235 ISA Bridge

00:11.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06)

00:11.5 Multimedia audio controller: VIA Technologies, Inc. VT8233/A/8235/8237 AC97 Audio Controller (rev 50)

01:00.0 VGA compatible controller: nVidia Corporation NV17 [GeForce4 MX 440] (rev a3)

xp2600 conf.d #

```

any other idea to solve the problem?

----------

## Ferdinando

You have a dhcp client, right? Well, if you don't, we found the problem   :Very Happy: 

Try starting it directly, e.g.

```
ifconfig ath0 up

iwconfig ath0 mode managed

iwconfig ath0 essid "THCLan"

iwconfig ath0 channel 3

dhcpcd ath0
```

and then looking at the logs (or check to see if that just works).

Are you sure that net doesn't have WEP or WPA authentication?

Bye

----------

## arsirc

ok ...

first i would get my wlan card working with static ip.

it should run in ad-hoc mode

and yes my net is without an authentication.

but i have tried for test with:

```

xp2600 conf.d # ifconfig ath0 up

xp2600 conf.d # iwconfig ath0 mode ad-hoc

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

    SET failed on device ath0 ; Invalid argument.

xp2600 conf.d #

```

and also with:

```

xp2600 conf.d # iwconfig ath0 mode managed

```

and here i got no error! why this?

----------

## Adrien

 *arsirc wrote:*   

> but i have tried for test with:
> 
> ```
> 
> xp2600 conf.d # ifconfig ath0 up
> ...

 

Cause the default ath0 iface created with wlanconfig only supports managed mode.

If you want your iface to support other modes (moniotr, ad-hoc) you'll need to create ath1 or ath2 ... with wlanconfig.

----------

## Ferdinando

 *arsirc wrote:*   

> 
> 
> ```
> 
> xp2600 conf.d # ifconfig ath0 up
> ...

 

try

```
athdebug +mode
```

and then repeat; alas I've never tried ad-hoc myself.

Bye

----------

## arsirc

have tried ...

but i got the same error

AND why i could start my wlan card

manually with "iwconfig ath0 mode managed"

and not via net.ath0 script with

mode managed?

----------

## Ferdinando

Have you tried

```
# wlanconfig ath1 create vlandev wlan0 vlandevmode adhoc

# /etc/init.d/net.ath1 start
```

like Adrien suggested?

The "Set Mode" error is due to the fact that ath0 only accepts "managed"; the "Failed to configure wireless for ath0" one probably is there because you don't have dhcp nor an IP address configured statically for that interface.

Bye

----------

## arsirc

have tried it:

```

xp2600 conf.d # wlanconfig ath1 create wlandev wifi0 wlanmode adhoc

wlanconfig: ioctl: Input/output error

xp2600 conf.d #

```

have set an ip for the device!

from /etc/conf.d/net.ath0

```

# For a static configuration, use something like this

# (They all do exactly the same thing btw)

config_ath0=( "192.168.0.1/24" )

config_ath0=( "192.168.0.1 netmask 255.255.255.0" )

```

!!!HELP!!!

please ...

----------

## arsirc

OK ...

so i have set the ip adress in /etc/conf.d/net

have switched to wpa_supplicant ... anything is alright now!

thx for help ... greetings andreas

----------

## Adrien

I've just read in madwifi-driver doc that ad-hoc mode is broken at the moment...

> /usr/share/doc/madwifi-driver-<version>/README

----------

