# Problem with wifi (resolved)

## zubb

Hi to all!

I have been using Gentoo on my laptop sine 1st July. All hardware, that need I configured. The single thing that I has not won jet is wifi. I had tried to setup it several times, however without positive result. The last one was today  :Smile:  one thing that I achieved is a warning of module:

```
ieee80211_crypt: registered algorithm 'NULL'

```

So I decided to ask for help to community. Can someone who is "wifi"-expert asist me via IM? If there is such one who can understand(stand) my "Ukrainian English"   :Rolling Eyes:  :Smile:  , please send me a PM

I am going to be online at 11:00 EET

----------

## thecooptoo

have you got ieee80211_crypt module installed ( or in your kernel)

----------

## zubb

 *thecooptoo wrote:*   

> have you got ieee80211_crypt module installed ( or in your kernel)

 

kernel:

```

crusader ~ # cat /usr/src/linux/.config | grep 80211

# CONFIG_CFG80211 is not set

# CONFIG_MAC80211 is not set

CONFIG_IEEE80211=m

# CONFIG_IEEE80211_DEBUG is not set

CONFIG_IEEE80211_CRYPT_WEP=m

CONFIG_IEEE80211_CRYPT_CCMP=m

CONFIG_IEEE80211_CRYPT_TKIP=m

CONFIG_IEEE80211_SOFTMAC=m

# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set

# CONFIG_WLAN_PRE80211 is not set

# CONFIG_WLAN_80211 is not set

```

package

```
crusader ~ # emerge -pv  net-wireless/ieee80211

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild  N    ] net-wireless/ieee80211-1.1.13-r1  USE="-debug" 0 kB 

Total: 1 package (1 new), Size of downloads: 0 kB

```

----------

## zubb

I think the most important things are in kernel. Below there is a part of my config (2.6.22-r9). Please correct me if I have checked something wrong

Networking  -> Networking support (NET [=y]) -> Wireless

```

 < > Improved wireless configuration API 

 --- Wireless extensions                          

 < > Generic IEEE 802.11 Networking Stack (mac80211)

 <M> Generic IEEE 802.11 Networking Stack

 [ ]   Enable full debugging output

 ---   IEEE 802.11 WEP encryption (802.1x)

 <M>   IEEE 802.11i CCMP support

 <M>   IEEE 802.11i TKIP encryption

 <M>   Software MAC add-on to the IEEE 802.11 networking stack           

 [ ]     Enable full debugging

```

In -> Device Drivers  -> Network device support -> Network device support (NETDEVICES [=y]) -> Wireless LAN there is nothing selected

and 

```

 ---> Cryptographic API                                                                                

 <M>   Cryptographic algorithm manager                                                                

 < >   HMAC support                                                                                   

 < >   XCBC support                                                                                   

 < >   Null algorithms                                                                                

 < >   MD4 digest algorithm                                                                           

 <*>   MD5 digest algorithm                                                                           

 <*>   SHA1 digest algorithm                                                                          

 < >   SHA256 digest algorithm                                                                        

 < >   SHA384 and SHA512 digest algorithms                                                            

 < >   Whirlpool digest algorithms                                                                    

 < >   Tiger digest algorithms                                                                        

 < >   GF(2^128) multiplication functions (EXPERIMENTAL)                                              

 <M>   ECB support                                                                                    

 <M>   CBC support                                                                                    

 <M>   PCBC support                                                                                   

 < >   LRW support (EXPERIMENTAL)                                                                     

 < >   Software async crypto daemon                                                                   

 <M>   DES and Triple DES EDE cipher algorithms                                                       

 < >   FCrypt cipher algorithm                                                                        

 <M>   Blowfish cipher algorithm                                                                      

 < >   Twofish cipher algorithm                                                                       

 < >   Twofish cipher algorithms (i586)                                                               

 < >   Serpent cipher algorithm                                                                       

 <M>   AES cipher algorithms                                                                          

 < >   AES cipher algorithms (i586)                                                                   

 < >   CAST5 (CAST-128) cipher algorithm                                                              

 < >   CAST6 (CAST-256) cipher algorithm                                                              

 < >   TEA, XTEA and XETA cipher algorithms                                                           

 <M>   ARC4 cipher algorithm                                                                          

 < >   Khazad cipher algorithm                                                                        

 < >   Anubis cipher algorithm                                                                        

 < >   Deflate compression algorithm                                                                

 <M>   Michael MIC keyed digest algorithm                                                           

 < >   CRC32c CRC algorithm                                                                         

 < >   Camellia cipher algorithms                                                                   

 < >   Testing module                  

```

Please advice what is superflous or is absent

----------

## MorpheuS.Ibis

what kind of wifi hardware do you use? intel? atheros? broadcom? lspci please  :Smile: 

----------

## d2_racing

Yeah, we need at least what kind of wifi card you have, because each one has a different configuration  :Smile: 

Also, can you post your emerge --info for the record.

----------

## zubb

```
03:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG Network Connection (rev 02)
```

----------

## zubb

Also I would like to know what following thing do:

ipw3945 - its a kind of driver, am I right? Should I use "ipw3945" or "iwlwifi"? What is better for me? What about "ipw3945u"? 

ipw3945d - its a daemon (in MS ="service"), am I right? What does it do?

"wpa_supplicant" or "wireless-tools". I know that its recommended for basic users to use it. Don't know which is better. Also what things they are provide?

----------

## d2_racing

You should read this : http://gentoo-wiki.com/HARDWARE_ipw3945

Also, use the installation of ipw3945 instead of the new iwlwifi.

Keep us informe.

----------

## Dagger

I'm using iwlwifi, and can't complain about this one, but it's kinda development driver, so you can't expect it to be uber stable.

----------

## zubb

 *d2_racing wrote:*   

> You should read this : http://gentoo-wiki.com/HARDWARE_ipw3945

 

Yes, I had read it dozens of times, however I cant get my wifi-card working. That is why I want to know answers for all my questions.

So would you mind if I ask one more time (as I didn't got the answer):

1. ipw3945d its a daemon. What does it do?

2. "wpa_supplicant" or "wireless-tools". I know that its recommended for basic users to use it. Don't know which is better. What is the main purpose of usage one of these tools?

Secondly, I have installed ipw3945d and ipw3945. However during boot I always get this message:

```
Cannot run ipw3945d untill sysinit completes

ipw3945d will be started in the boot runlevel
```

And a dozen seconds after that it starts without any warnings. I guess it happens due to lines in /etc/modprobe.conf

```
install ipw3945 /sbin/modprobe --ignore-install ipw3945; sleep 0.5; /etc/init.d/ipw3945d start

remove ipw3945 /etc/init.d/ipw3945d stop; /sbin/modprobe -r --ignore-remove ipw3945

```

Is there another way to fix it except enlarge delay from 0.5 to 2.5 (or smth like this), because that error message bothers me very much   :Evil or Very Mad: 

PS: ipw3945d is not a menber neither boot nor default runlevel

----------

## MorpheuS.Ibis

sorry, i dont know what is the iwl3945d for, i guess it handles the communication with the proprietary microcode...

the wireless-tools question is easy, you need both of them

wireless-tools are stuff like iwconfig, iwlist, iwpriv....used for stuff like scanning for ESSIDs, changing configuration of wireless cards etc.

wpa_supplicant is a little tool that handles WPA encryption and sets everything according to its config file (containing passwords and other stuff). wpa_supplicant doesn't need wireless-tools, it has the API calls implemented directly, but if you want to know the signal strength, available networks etc. you need the wireless-tools package

so again, you need wireless-tools for doing anything with wireless and wpa_supplicant for connecting to WPA protected networkd

----------

## Dagger

re1: generally ipw3945d is userspace daemon to control ipw3945 driver

are you using WEP or WPA?

re2: "wpa_supplicant" is mainly used for WPA networks and "wireless-tools" was designed to work with WEP.

You can use "wpa_supplicant" with WEP, but I'm not sure if you can use "wireless-tools" with WPA (probably you can). 

If you're using WPA and want to try intel's development driver (which I'm using since may with no real problems) then

enable

```

<M> Generic IEEE 802.11 Networking Stack (mac80211)

```

instead of

```

< > Generic IEEE 802.11 Networking Stack 

```

in your kernel config, and 

emerge iwlwifi net-wireless/iwl3945-ucode

----------

## d2_racing

hi, I use ipw3945 and I use it with a WEP key.

Here's my config :

```

Section Networking

(*) Wireless

(*) Generic IEEE 802.11 Networking Stack

(M) IEEE 802.11 WEP encryption (802.1x)

(M) IEEE 802.11i CCMP support

(M) IEEE 802.11i TKIP encryption

Section Cryptographic options

(*) Cryptographic algorithm manager

(M) SHA1 digest algorithm

(M) SHA256 digest algorithm

(M) ECB support

(M) CBC support

(M) PCBC support

(*) AES cipher algorithms

(*) AES cipher algorithms (i586)

(*) ARC4 cipher algorithm

(*) Michael MIC keyed digest algorithm

```

You need to install this :

```

# emerge -pv wireless-tools

# emerge -pDv net-wireless/ipw3945 net-wireless/ipw3945-ucode net-wireless/ipw3945d

```

After that you need to install your interface :

```

# cd /etc/init.d

# ln -s net.lo net.eth1

# modprobe ipw3945

# iwconfig

```

You will endup with something like this :

```

eth1 unassociated ESSID:off/any

Mode:Managed Frequency=nan kHz Access Point: Not-Associated

Bit Rate:0 kb/s Tx-Power:16 dBm

Retry limit:15 RTS thr:off Fragment thr:off

Encryption key:off

Power Management:off

Link Quality:0 Signal level:0 Noise level:0

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

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

```

After that, you need to run this :

```

iwlist eth1 scan

eth1 Scan completed :

Cell 01 - Address: 00:1A:70:62:40:88

ESSID:"gentoonet"

Protocol:IEEE 802.11bg

Mode:Master

Channel:6

Encryption key:on

Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s

11 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s

48 Mb/s; 54 Mb/s

Quality=90/100 Signal level=-41 dBm Noise level=-41 dBm

Extra: Last beacon: 128ms ago

108

```

Now I can see my wifi routeur.

If you want to test your wifi, you can install this package :

```

# echo "net-wireless/wlassistant ~x86" >> /etc/portage/package.keywords

# emerge -pv net-wireless/wlassistant

# wlassistant

```

For my concern, this is my /etc/conf.d/net

```

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_eth0="dhcp"

dhcpcd_eth0="-N"

#RC_NEED_wlan="ipw3945d"

config_gentoonet=( "dhcp" )

key_gentoonet="307b09e7e3979a1f4988afdb83 enc open"

preferred_aps=( "gentoonet" )

```

Also, to prevend udev to start ipw3945, I use this hack :

```

nano -w /etc/modprobe.d/blacklist

blacklist ipw3945

```

And, here my script to lunch my wifi interface :

```

#!/bin/bash

if [ "$(/etc/init.d/net.eth1 status | grep started)" ]; then

echo "Arr^et de l’interface eth1"

/etc/init.d/net.eth1 stop

echo "Arr^et du d´emon ipw3945d"

sleep 1

/etc/init.d/ipw3945d stop

echo "D´echargement du module wifi"

sleep 1

rmmod ipw3945

echo "Le wifi est totalement d´esactiv´e"

else

echo "Chargement du module wifi"

modprobe ipw3945

echo "Lancement du d´emon ipw3945d"

sleep 2

/etc/init.d/ipw3945d start

echo "D´emarrage de l’interface eth1"

sleep 2

/etc/init.d/net.eth1 start

echo "Wifi activ´e"

fi

```

```

chmod +744 wifi.sh

```

----------

## zubb

quick: Wow!! Guys I impressed!! You all want to help me.  :Smile:  A big thanks in advance! I am at home now, so cant experiment with settings that you suggested to me (I can connect via wifi only in the office). I will try to use your advices tomorrow. Results will be posted too

----------

## Dagger

 *zubb wrote:*   

> quick: Wow!! Guys I impressed!! You all want to help me. 

 

Welcome to Gentoo forums  :Very Happy: 

----------

## d2_racing

I had so much help in the past here...so it's time to give it back  :Smile: 

----------

## zubb

Hi to all! First of all I tried to setup a wifi without usage of wpa_supplican.

I followed the advice of d2_racing. Below there are results and new questions  :Smile: 

ifconfig:

```

eth1      Link encap:Ethernet  HWaddr 00:18:DE:B5:4D:70  

          inet addr:169.254.150.119  Bcast:169.254.255.255  Mask:255.255.0.0

          inet6 addr: fe80::218:deff:feb5:4d70/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:54 errors:54 dropped:55 overruns:0 frame:0

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

          collisions:0 txqueuelen:1000 

          RX bytes:5269 (5.1 Kb)  TX bytes:59567 (58.1 Kb)

          Interrupt:16 Base address:0x2000 Memory:d0100000-d0100fff 

```

I know that our office network is 192.168.0.0, also I know that AP gives address in this set 192.168.0.200-220.

Question #1: "who is guilty? And what I should do?" 

Guess: dhcp daemon has bad/insufficient settings.. A question related to dhcp daemon:

Is there some default dhcp daemon that goes with gentoo (without doing "emerge")? If yes, does it have enough features?

If no then what is the best solution?

/etc/conf.d/net:

```
crusader ~ # 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.0.34 netmask 255.255.255.0 broadcast 192.168.0.255" )

routes_eth0=( "default via 192.168.0.254" )

essid_eth1="zapatec"

#dns_domain_lo="sg.net" 

dns_servers_zapatec=( "192.168.0.254" )

config_zapatec="dhcp" 

dhcpcd_zapatec="-t 10" 

config_zapatec=( "dhcp" ) 

key_zapatec="s:xxxxxxxxxxx enc open" 

mode_zapatec="master"

preferred_aps=( "zapatec" )

```

If interface is being restarted, it will not work, and throws a lot of errors/warnings

```
crusader ~ # /etc/init.d/net.eth1 restart

 * Caching service dependencies ...                                                                                                  [ ok ]

 * Stopping dhcdbd ...                                                                                                               [ ok ]

 * Unmounting network filesystems ...                                                                                                [ ok ]

 * Stopping sshd ...                                                                                                                 [ ok ]

 * Stopping eth1

 *   Bringing down eth1

 *     Stopping dhcpcd on eth1 ...                                                                                                   [ ok ]

 *     Shutting down eth1 ...                                                                                                        [ ok ]

 * Starting eth1

 *   Configuring wireless network for eth1

eth1      no wireless extensions.

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

    SET failed on device eth1 ; Resource temporarily unavailable.

 *   eth1 does not support setting the mode to "managed"

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

    SET failed on device eth1 ; Resource temporarily unavailable.

 *   eth1 does not support setting the mode to "managed"

Error for wireless request "Set Encode" (8B2A) :

    SET failed on device eth1 ; Resource temporarily unavailable.

 *   eth1 does not support setting keys

 *   or the parameter "mac_key_zapatec" or "key_zapatec" is incorrect

 *   Failed to configure wireless for eth1                                                                                           [ !! ]

```

Can I somehow avoid this?

----------

## d2_racing

First, your /etc/conf.d/net need to be tune :

Look at my config for my wifi :

```

config_gentoonet=( "dhcp" ) 

key_gentoonet="307b09e7e3979a1f4988afdb83 enc open" 

preferred_aps=( "gentoonet" ) 

```

Your eth0 is a dhcp or a static ip ?

you need this :

```

config_zapatec=("dhcp") 

key_zapatec="xxxxxxxxxxx enc open" 

preferred_aps=( "zapatec" ) 

```

Also, your key should be in hexa...because maybe your router with not accept your s: key.Last edited by d2_racing on Wed Dec 12, 2007 3:35 am; edited 1 time in total

----------

## d2_racing

Also, have you blacklisted the ipw3945 module with this ?

```

nano -w /etc/modprobe.d/blacklist 

blacklist ipw3945 

```

If so, can you reboot your box and we will take one step a the time and we will find what's wrong with your installation.

----------

## d2_racing

Also, can you just run this and post the result

```

# cd /etc/init.d 

# ln -s net.lo net.eth1 

# modprobe ipw3945 

# iwconfig 

```

What is the status of ipw3945 and what is the result of iwconfig ?

----------

## zubb

Hi! Our ISP done a bad joke yesterday, so cant post results. So they are:

Its working!!!!!!!!!!!!!!!!!!!!!!!!!  :Razz:   :Razz:   :Razz:  A really big thanks to d2_racing!

I guess the main problem was in  *Quote:*   

> 
> 
> ```
> key_zapatec="s:xxxxxxxxxxx enc open"
> ```
> ...

 . It should be without "s:"

Howere still exist a few problems there:

* eth1 stops to working after /etc/init.d/net.eth1 restart. Guess: somehow config for wifi is being overwritten "virtually"

```
* Starting eth1

 *   Configuring wireless network for eth1

eth1      no wireless extensions.

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

    SET failed on device eth1 ; Resource temporarily unavailable.

 *   eth1 does not support setting the mode to "managed"

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

    SET failed on device eth1 ; Resource temporarily unavailable.

 *   eth1 does not support setting the mode to "managed"

Error for wireless request "Set Encode" (8B2A) :

    SET failed on device eth1 ; Resource temporarily unavailable.

 *   eth1 does not support setting keys

 *   or the parameter "mac_key_zapatec" or "key_zapatec" is incorrect

 *   Failed to configure wireless for eth1                                                                                           [ !! ]

```

* eth0 still starts at boot level even if it is disabled.

daemons:

```
crusader ~ # rc-status boot

Runlevel: boot

 alsasound                                                                                                                     [ started  ]

 bootmisc                                                                                                                      [ started  ]

 checkfs                                                                                                                       [ started  ]

 checkroot                                                                                                                     [ started  ]

 clock                                                                                                                         [ started  ]

 consolefont                                                                                                                   [ started  ]

 cpufrequtils                                                                                                                  [ started  ]

 hostname                                                                                                                      [ started  ]

 ipw3945d                                                                                                                      [ started  ]

 keymaps                                                                                                                       [ started  ]

 localmount                                                                                                                    [ started  ]

 modules                                                                                                                       [ started  ]

 net.lo                                                                                                                        [ started  ]

 rmnologin                                                                                                                     [ started  ]

 urandom                                                                                                                       [ started  ]

crusader ~ # rc-status default

Runlevel: default

 acpid                                                                                                                         [ started  ]

 apache2                                                                                                                       [ started  ]

 dhcdbd                                                                                                                        [ started  ]

 hdparm                                                                                                                        [ started  ]

 local                                                                                                                         [ started  ]

 net.eth1                                                                                                                      [ started  ]

 netmount                                                                                                                      [ started  ]

 ntp-client                                                                                                                    [ started  ]

 sshd                                                                                                                          [ started  ]

 syslog-ng                                                                                                                     [ started  ]

 vixie-cron                                                                                                                    [ started  ]

 vmware                                                                                                                        [ started  ]

 xdm                                                                                                                           [ started  ]

```

net daemons:

```
crusader ~ # ls -l /etc/init.d/*net*

lrwxrwxrwx 1 root root     6 Jun 26 01:22 /etc/init.d/net.eth0 -> net.lo

lrwxrwxrwx 1 root root    18 Oct  1 19:06 /etc/init.d/net.eth1 -> /etc/init.d/net.lo

-rwxr-xr-x 1 root root 30522 Jun 26 01:22 /etc/init.d/net.lo

-rwxr-xr-x 1 root root  3046 Jun 26 01:22 /etc/init.d/netmount

```

statuses: 

```
crusader ~ # /etc/init.d/net.lo status

 * status:  started

crusader ~ # /etc/init.d/net.eth0 status

 * status:  started

crusader ~ # /etc/init.d/net.eth1 status

 * status:  started

```

Any ideas? Thanks in advance.

edit: added error log for eth1

----------

## d2_racing

 *zubb wrote:*   

> 
> 
> * eth0 still starts at boot level even if it is disabled.
> 
> daemons:
> ...

 

I know what is your problem.

Udev starts your network by himself.

So to stop this, you need to edit this file :

```

# nano /etc/conf.d/rc

```

And you need to find this variable

```

RC_PLUG_SERVICES="!net.*"

```

The "!net.*" will tell to udev to leave your network alone and it will use your rc-update service that you have set.

Now, your net.eth1 or net.eth0 will not start again  :Smile: 

----------

## zubb

A great thanks to guru d2_racing!!

----------

## d2_racing

So everything is working now  :Smile: 

----------

## zubb

Actually all, except vmware-player   :Evil or Very Mad:   :Evil or Very Mad:   :Evil or Very Mad: 

All day of googling and a result: https://forums.gentoo.org/viewtopic-p-4209075.html#4209075

And I found that sys-apps/dbus is required by net-misc/dhcdbd, a dhcp daemon/client (not sure wich one).

So I want to back to my question: 

Is there some default dhcp daemon that goes with gentoo (without doing "emerge")? If yes, does it have enough features? 

If no then what is the best solution? Is it possible to use some dhcp daemon that does not require [edit]was dhcp, should dbus[/edit] daemon?

----------

## Wormo

There is no dhcp client included in base gentoo install... I use dhcpcd for a dhcp client. It has no extra dependencies.

----------

## d2_racing

I use that too  :Smile: 

----------

## zubb

approvement #1

/etc/init.d/dhcdbd:

```
#!/sbin/runscript

# Copyright 2006 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

depend() {

   need net dbus

}

start() {

   ebegin "Starting ${SVCNAME}"

   start-stop-daemon --start --exec /sbin/dhcdbd \

        --pidfile /var/run/dhcdbd.pid \

        -- ${DHCDBD_ARGS}

   eend $?

}

stop() {

   ebegin "Stopping ${SVCNAME}"

   start-stop-daemon --stop --exec /sbin/dhcdbd \

        --pidfile /var/run/dhcdbd.pid

   eend $?

}

```

approvement #2:

```
crusader conf.d # emerge -pevt dhcdbd

These are the packages that would be merged, in reverse order:

Calculating dependencies... done!

[nomerge      ] net-misc/dhcdbd-3.0 [2.8-r1] USE="-debug%" 

[nomerge      ]  sys-apps/dbus-1.0.2-r2  USE="X -debug -doc (-selinux)" 

...

```

----------

## zubb

Hi guys!

I hope you didnt forget about my little question  :Wink: . Sorry for bothering you so much. Also please excuse me that this thread was dedicated to wifi but gradually switch to dbus & dhcdbd. I believe I will receive an advice/answer for my question. 

Also I would like to add one thing: maybe dhcdbd requires dbus because my USE variable in make.conf contains "dbus". Is this have some sense?

----------

## MorpheuS.Ibis

 *zubb wrote:*   

> maybe dhcdbd requires dbus because my USE variable in make.conf contains "dbus"

 

this could be right but it would depend on dbus even if you didn't have in in USE, as it doesn't have dbus USE flag (seen on emerge -av)

maybe try other dhcp clients if you don't want dbus on your system (and also remove dbus from USE)

----------

## zubb

Thank all of you who replied.

----------

