# wireless makes me mad

## fratzlow

Hi guys,

I try not to complain tha a task that took me 10 min on my windows box now consumes  the 3rd day to achieve the same result ....

Basically a simple setup:

1.)

PC with Netgear WG311T

#lspci | grep Ath

0000:02:03.0 Ethernet controller: Atheros Communications, Inc. AR5212 802.11abg NIC (rev 01)

2.) 

emerged wpa_supplicant

emerged wireless-tools

downloaded "Open-Source wireless driver for TI ACX1xx chipsets" from sourceforge

I compiled it within the kernel and according to 

# modprobe ath_pci

# lsmod

Module                  Size  Used by

ath_pci                71140  -

ath_rate_sample        14384  -

wlan                  132828  -

ath_hal               146256  -

there is "something" going on.

Okay, I don't have these madwifi stuff emerged since it is masked.

Very simple questions:

What are the next steps to:

a) create a device ? 

b) to setup the card to work with my router WEP encrypted and with a static IP (192.168.1.10/24)

c) howto startup the card together with my PC at boot time (yes, I know some people mentioned selfwritten scripts, but is there any sort of standard script?)

d) order of the aforementioned steps (and how to verify the success of the actions)

I would be very very grateful if anyone could explain it with normal end user words. No admin crypt slang since I only want to use my box for development purpose and I'm in no way excited in computer installation games.

TIA

Frank

P.S. do you know this video with a man beating up his monitor on his desk with his keyboard? --> exactly matches my mood :o|

----------

## pgchimera

Ok, first of all you only need either wpa_supplicant or wireless-tools not both. I tended to find wireless-tools was easier to use. Seing as though you compiled your network driver into the kernel, you should have the device created already for you. You can check this using:

ifconfig

If it lists your network card probably as wlan0, great. If not you need to the driver out of the kernel, recompile as a module  and modprobe it. If that doesn't work try a driver such as ndiswrapper, the add the driver to /etc/modules.autoload.d/kernel-<your_kernel_version>

Ok assuming you want to use wireless-tools, you then need to scan for access points using iwlist <eth_card> scan and with luck it should tell you all the acess points they are. Next associate the card with the acess point using iwconfig wlan0 essid <your-ap> key <your-key> then check using iwconfig <eth-card>. If it shows up correctly in particular looking at signal strength. If it shows as 0/100 or 100/100 you better recheck the ap is in range. 

Finally run ifconfig <eth-card> address <ip-address>

and check using ping -c 3 -s 8 www.google.co.uk

Once you got that far look at /etc/net.example and /etc/wireless.example and write your setting in /etc/net. with the line 

modules=("iwconfig") at the top

finally to start it at boot run rc-update add net.<eth-card> default.

I hope this helps

----------

## fratzlow

Hi,

ifconfig shows up only loopback and my normal NIC

```
# ifconfig

eth0      Link encap:Ethernet  HWaddr 00:90:27:A2:54:B9

          inet addr:192.168.1.5  Bcast:192.168.1.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:170 errors:0 dropped:0 overruns:0 frame:0

          TX packets:149 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:203376 (198.6 Kb)  TX bytes:13969 (13.6 Kb)

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:6 errors:0 dropped:0 overruns:0 frame:0

          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:300 (300.0 b)  TX bytes:300 (300.0 b)

```

after doing a 

```

# modprobe ath_pci

# lsmod

Module                  Size  Used by

ath_pci                71140  -

ath_rate_sample        14384  -

wlan                  132828  -

ath_hal               146256  -

# iwconfig

eth0      no wireless extensions.

lo        no wireless extensions.

Warning: Driver for device ath0 has been compiled with version 18

of Wireless Extension, while this program supports up to version 17.

Some things may be broken...

ath0      IEEE 802.11  ESSID:""

          Mode:Managed  Frequency:2.412 GHz  Access Point: 00:00:00:00:00:00

          Bit Rate:0 kb/s   Tx-Power:20 dBm   Sensitivity=0/3

          Retry:off   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality=0/94  Signal level=-95 dBm  Noise level=-95 dBm

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

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

```

I suppose I loaded the driver. 

BTW: can I conclude from the lsmod the syntax of modules I have to write into/etc/modules.autoload.d/kernel-<your_kernel_version> to automatically load the driver at startup?

I did a 

```

# iwlist ath0 scanning

Warning: Driver for device ath0 has been compiled with version 18

of Wireless Extension, while this program supports up to version 17.

Some things may be broken...

ath0      Interface doesn't support scanning : Network is down

```

that leads me to the question how to start this interface? So to keep on moving I should solve this prob first, right? Next step would be to configure it with an IP address, subnetmask, gateway, dns etc. Do I have to create a eth.ath0 script on my own or is there some template? Do I have to worry because of the version complaints?

thanx

Frank

----------

## Adrien

You have to bring up your interface before scanning!

```
# ifconfig ath0 up
```

----------

## pgchimera

yes you need to add ath_pci to /etc/modules.autoload.d/kernel-<your_kernel_version> . Bring the connection up. The warning i believe is nothing to worry about. make sure you have baselayout installed as well or it wont be able to connect at boot time. If you don't have it. emerge --sync, then emerge --deep world should get it for you but dont forget to etc-update after doing this

----------

## Adrien

 *pgchimera wrote:*   

> yes you need to add ath_pci to /etc/modules.autoload.d/kernel-<your_kernel_version>

 

+1 Just add all the madwifi-driver modules and you won't be annoyed.

----------

## fratzlow

... okay, okay. Some major improvements. What I did:

```
#  ifconfig ath0 up

#  iwconfig ath0 essid oracle10g key <MyWEPKey>

#  ifconfig ath0 192.168.1.10 netmask 255.255.255.0
```

the result was, that I could ping my router. :o) Shall I worry about any of the values from

```
# iwconfig ath0

ath0      IEEE 802.11g  ESSID:"oracle10g"

          Mode:Managed  Frequency:2.437 GHz  Access Point: 00:0F:3D:9E:ED:24

          Bit Rate:48 Mb/s   Tx-Power:18 dBm   Sensitivity=0/3

          Retry:off   RTS thr:off   Fragment thr:off

          Encryption key:<MyWEPKey>   Security mode:restricted

          Power Management:off

          Link Quality=39/94  Signal level=-56 dBm  Noise level=-95 dBm

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

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

```

? Can I see the connection speed? (I expect something around 54MB/s)

Another thing that confuses me is the fact that a 

```
# iwlist ath0 scanning

ath0      Scan completed :

          Cell 01 - Address: 00:09:5B:FF:D1:A2

                    ESSID:"Croma"

                    Mode:Master

                    Frequency:2.462 GHz (Channel 11)

                    Quality=4/94  Signal level=-91 dBm  Noise level=-95 dBm

                    Encryption key:on

                    Bit Rate:1 Mb/s

                    Bit Rate:2 Mb/s

                    Bit Rate:5 Mb/s

                    Bit Rate:6 Mb/s

                    Bit Rate:9 Mb/s

                    Bit Rate:11 Mb/s

                    Bit Rate:12 Mb/s

                    Bit Rate:18 Mb/s

                    Bit Rate:24 Mb/s

                    Bit Rate:36 Mb/s

                    Bit Rate:48 Mb/s

                    Bit Rate:54 Mb/s

                    Extra:bcn_int=100

          Cell 02 - Address: 00:0F:3D:9E:ED:24

                    ESSID:"oracle10g"

                    Mode:Master

                    Frequency:2.437 GHz (Channel 6)

                    Quality=42/94  Signal level=-53 dBm  Noise level=-95 dBm

                    Encryption key:on

                    Bit Rate:1 Mb/s

                    Bit Rate:2 Mb/s

                    Bit Rate:5 Mb/s

                    Bit Rate:6 Mb/s

                    Bit Rate:9 Mb/s

                    Bit Rate:11 Mb/s

                    Bit Rate:12 Mb/s

                    Bit Rate:18 Mb/s

                    Bit Rate:22 Mb/s

                    Bit Rate:24 Mb/s

                    Bit Rate:36 Mb/s

                    Bit Rate:48 Mb/s

                    Bit Rate:54 Mb/s

                    Extra:bcn_int=200
```

doesn't show the mac address of my AP (MAC 00:0f:3d:9e:ed:24) but I can connect to it?! Strange...

Okay now the big moment: how can I automatically startup the wlan stuff with interface enabled, IP+netmask+gw+DNS assigned, + SSID a WEP encryption enabled?? I guess I still neet something similar to /etc/init.d/net.eth0 for my wlan card, right? Is there a way to verify that my connection is indeed encrypted?

BTW: thanx a lot for your support! You guys rock!

Frank

----------

## pgchimera

Okay it looks like everything is working okay. Though your link quality looks to be slightly low. It could be your distance from the router. If not  make sure that nothing is intefering with your card like walls. Don't worry about iwlist wlan0 scan not displaying MAC addresses it doesn't display it and they can change in any case.

So now you know your settings look at /etc/net.example for basic ethernet settings and /etc/wireless.example for wireless settings then edit /etc/net with the settings you got using the previous 2 for the format. remebering to put modules=("iwconfig") before your settings.

Next you can add ath0 to load at startup or any service for that matter by doing rc-update add net.ath0 default. If it complains that /etc/init.d/net.ath0 does not exist create a link between the loopback adapter and your wireless by

ln -s /etc/init.d/net.lo /etc/net.ath0

Now you can reboot and check that it loads up at startup. If it complains that wireless-tools or baselayout is not available. Load up your connection and run

emerge --sync

update --deep  world

etc-update

okay that should load up the adapter using the settings you specified. As for it being propely encrytped. Im on a open network so i can't tell you but if your worried about that you could try wpa_supplicant.  Though i believe it doesn't work with some cards

----------

## fratzlow

Hialo,

i,

configured as adviced. Means, I created the symlink to ath0 and added in /etc/conf.d/net

```

modules=( "iwconfig" )

ifconfig_ath0=( "192.168.1.10 netmask 255.255.255.0" )

routes_ath0=( "default gw 192.168.1.1" )

```

In /etc/conf.d/wireless I put the lines

```

essid_ath0="oracle10g"

mode_ath0="master"

key_oracle10g="<MyWEPKeyAsHexValue> enc open"

```

The interface is started properly

```

# ifconfig -a

ath0      Link encap:Ethernet  HWaddr 00:0F:B5:63:C7:DF

          inet addr:192.168.1.10  Bcast:192.168.1.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:2560 dropped:0 overruns:0 frame:2560

          TX packets:114 errors:1 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:200

          RX bytes:0 (0.0 b)  TX bytes:4788 (4.6 Kb)

          Interrupt:19 Memory:f89e0000-f89f0000

eth0      Link encap:Ethernet  HWaddr 00:90:27:A2:54:B9

          inet addr:192.168.1.5  Bcast:192.168.1.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:302 errors:0 dropped:0 overruns:0 frame:0

          TX packets:23 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:19568 (19.1 Kb)  TX bytes:1708 (1.6 Kb)

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:51 errors:0 dropped:0 overruns:0 frame:0

          TX packets:51 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:4858 (4.7 Kb)  TX bytes:4858 (4.7 Kb)

# iwconfig ath0

ath0      IEEE 802.11b  ESSID:"oracle10g"  Nickname:"oracle10g"

          Mode:Master  Frequency:2.422 GHz  Access Point: 00:0F:B5:63:C7:DF

          Bit Rate:0 kb/s   Tx-Power:18 dBm   Sensitivity=0/3

          Retry:off   RTS thr:off   Fragment thr:off

          Encryption key:<MyWEPKeyAsHexValue> Security mode:open

          Power Management:off

          Link Quality=45/94  Signal level=-50 dBm  Noise level=-95 dBm

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

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

# wlist ath0 scanning

ath0      Interface doesn't support scanning : Invalid argument

```

Nevertheless I cannot ping my router/AP via ath0. I can do ping my router with the normal IF eth0. I also checked /var/log/messages but there is no warning that something would be misconfigured.

The ath0 interface doesn't seem to work at all. Did I miss to specify anything else?

I bet that's only a very little switch but I have no clue what it is or how to narrow down the reason ...

Any idea

Frank

----------

## pgchimera

Curious, although the result of 

 *Quote:*   

> 
> 
> # wlist ath0 scanning
> 
> ath0      Interface doesn't support scanning : Invalid argument 
> ...

 

might be the cause as in my experience it only says that when the driver is not propely loaded.

Also i would put all your settings in etc/conf.d/net.

You might have to put the wireless in ad-hoc mode or delay its connection to make sure the driver is propely loaded

----------

## NeddySeagoon

fratzlow,

You can't have this :-

```
# ifconfig -a

ath0      Link encap:Ethernet  HWaddr 00:0F:B5:63:C7:DF

          inet addr:192.168.1.10  Bcast:192.168.1.255  Mask:255.255.255.0 

eth0      Link encap:Ethernet  HWaddr 00:90:27:A2:54:B9

          inet addr:192.168.1.5  Bcast:192.168.1.255  Mask:255.255.255.0 
```

Both eth0 and ath0 are in the same subnet, so only one will be used.

Look in your routing table to see the problem.

Each entry is applied to outgoing packets in turn. I suspect you have two default routes, one via eth0 and another lowing down via ath0. Only the eth0 entry can be used.

If you stop eth0 and fix your routing table, then ath0 will work. 

I'm not convinced you are connected via your own AP though. Is iwconfig ath0 correct for your own AP ?

The Bit Rate:0 kb/s is a concern.

----------

## fratzlow

Hi guys,

the missing stuff was some configuration crap I played around with the last 7!!!!!!!! hours and now it is properly working.

I wouldn't have gotten to this point without your help. Be happy that you are far away from me - otherwise I would certainly give you a kiss :-)

Life is beautiful!

cheers

Frank

----------

