# [solved] Installing rtl8187.ko wireless drivers

## percy_vere_uk

Hi

I am trying to get a 'Netgear DG834G Router Modem' to work wirelessly on a rtl8187 based card, in gentoo.I have found that the drivers supplied with the kernel do not work. This modem  works fine in ubuntu on the same box so I taken a copy of the drivers (rtl8187.ko) from ubuntu. I assume that these should also work in gentoo. Can someone who has  these drivers working advise me on the best way to install them.

Thank you

percyLast edited by percy_vere_uk on Mon Sep 20, 2010 7:35 pm; edited 1 time in total

----------

## ConvexConepiece

I have been using the rtl8187usb (netgear WG111v2) with many kernels for a long time with no problems at all. I am pretty sure however there is a rtl8187pci driver aswell? might pay to clear up which you have first. Always build it as a module, not built into the kernel.

As for copying the .ko from ubuntu, not the best of practices (although i'm sure your desperate) and most very likely will not work - the kernel usually rejects anything not built specifically against it afaik.

Can we ask what kernel you use? is this a custom kernel or a default?

----------

## ConvexConepiece

Oh yea, and the actual error you get would help a lot.

----------

## percy_vere_uk

Hi

I am curently using 2.6.34-gentoo-r1 kernel with the configuration as below and the pci and usb rtl8187 options  set.as modules. After much searching for an answer to this problem I have been led to believe that these kernel modules do not work.

Linux Kernel Configuration: Wireless configuration

   [*] Networking support

        Wireless  --->

     <*> Improved wireless configuration API

The following is only used by very old drivers:

     --- Wireless extensions

The selection between the following two depends on the driver being used.

   <*> Generic IEEE 802.11 Networking Stack (mac80211)

   < > Generic IEEE 802.11 Networking Stack (DEPRECATED)

Turn on the following even if not using any of the drivers in the kernel:

 Device Drivers  --->

   Network device support  --->

     Wireless LAN  --->

       [*] Wireless LAN (IEEE 802.11)

       ... Select driver as needed if it's in the kernel source ...

The following should be on automatically by dependencies, but if not, turn it on:

 Cryptographic options  --->

   [*] Cryptographic API

..........................................................................................................................................................

using wicd I am getting ---no wireless networks found

----------

## ConvexConepiece

From the gentoo wiki

```
General setup  --->

  [*] Prompt for development and/or incomplete code/drivers

Networking --->

  [*] Networking support

  Wireless --->

    <*> Generic IEEE 802.11 Networking Stack (mac80211)

Device Drivers --->

  [*] Misc Devices --->

    <M> EEPROM 93CX6 support

  Network device support --->

    Wireless LAN --->

      [*] Wireless LAN (IEEE 802.11)

      <M> Realtek 8187 and 8187B USB support

Cryptographic options --->

  [*]Cryptographic API

    <*>ARC4 cipher algorithm

Library routines

  ---CRC32 functions
```

Make sure that the eeprom is also in there as you didn't mention it (I build the eeprom as * not module personally though)

Is your problem in the actual modprobe of the driver, or does the driver get loaded yet you are unable to find the interface in ifconfig? perhaps silly but you did try 

```
ifconfig wlan0 up
```

 after modprobing right?

----------

## NeddySeagoon

percy_vere_uk,

Sight of the following would be good:-

dmesg output

lspci output (if its a PCI card)

lsusb output (if its a USB card)

both of the above if you don't know

your kernel .config file

Output of

```
 uname -a
```

output of 

```
readlink /usr/src/linux
```

Thats too much to post on the forums so make friends with wgetpaste. emerge wgetpaste to start.

<some_command> | wgetpaste

wgetpaste /path/to/file

Post the URLs you get back

----------

## ConvexConepiece

Oh btw, it working on ubuntu is a clear sign that the kernel drivers for it DO work - as both distro's use the same in-kernel drivers. It's most likely something silly like the eeprom  :Smile: 

----------

## percy_vere_uk

ConvexConepiece

   <M> EEPROM 93CX6 support  is built into kernel

   I do not have [*] Wireless LAN (IEEE 802.11)

   but do have    < >   IEEE 802.11 for Host AP (Prism2/2.5/3 and WEP/TKIP/CCMP) which is currently not set.

----------

## percy_vere_uk

NeddySeagoon

Well I have done what you suggested and this is all that I get!

# uname -a

Linux tuxville 2.6.34-gentoo-r1 #9 SMP Fri Sep 3 14:59:31 BST 2010 i686 AMD Turion(tm) 64 X2 Mobile Technology TL-58 AuthenticAMD GNU/Linux

# readlink /usr/src/linux

linux-2.6.34-gentoo-r1

The rest to follow

----------

## ConvexConepiece

 *ConvexConepiece wrote:*   

> 
> 
> Is your problem in the actual modprobe of the driver, or does the driver get loaded yet you are unable to find the interface in ifconfig?

 

 *percy_vere_uk wrote:*   

> ConvexConepiece
> 
>    <M> EEPROM 93CX6 support  is built into kernel
> 
>    I do not have [*] Wireless LAN (IEEE 802.11)
> ...

 

The prism one is not required for this card, as for Wireless LAN perhaps it has changed name in the kernel recently but not been updated on the wiki (seems to happen a lil too often :/) - perhaps Neddy knows better as I am unable to access my linux box for a while to check the changes myself.

----------

## percy_vere_uk

NeddySeagoon

http://paste.pocoo.org/show/258451/

----------

## NeddySeagoon

percy_vere_uk,

That looks good but we need the wgetpaste outputs too. wgetpaste puts things on the web for you.

For example 

```
$ dmesg | wgetpaste

Your paste can be seen here: http://paste.pocoo.org/show/258453/
```

that link is my dmesg

and 

```
$ wgetpaste /usr/src/linux/.config

Your paste can be seen here: http://paste.pocoo.org/show/258454/
```

is my kernel configuration

----------

## percy_vere_uk

NeddySeagoon

I might have got it right this time!!!

http://paste.pocoo.org/show/258458/

http://paste.pocoo.org/show/258464/

http://paste.pocoo.org/show/258465/

----------

## percy_vere_uk

Got to go offline now folks thanks for your help so far

percy

----------

## NeddySeagoon

percy_vere_uk,

This is the interesting bit from dmesg

```
[    3.640561] rtl8187 1-6:1.0: usb_probe_interface

[    3.640566] rtl8187 1-6:1.0: usb_probe_interface - got id

[    3.950889] phy0: Selected rate control algorithm 'minstrel'

[    3.951616] phy0: hwaddr 00:16:44:70:0d:9e, RTL8187BvE V0 + rtl8225z2, rfkill mask 2

[    3.973263] rtl8187: Customer ID is 0x04

[    3.973299] Registered led device: rtl8187-phy0::radio

[    3.973320] Registered led device: rtl8187-phy0::tx

[    3.973337] Registered led device: rtl8187-phy0::rx

[    3.974117] rtl8187: wireless switch is on

[    3.974152] usbcore: registered new interface driver rtl8187
```

The rest of dmesg is interesting for the absence of wireless related errors.

This tells that your kernel is probably ok and the device firmware was loaded.

As its a USB device, your lspci is not needed but the content of /proc/bus/usb/devices will be interesting.

What file do you have in /lib/firmware ?

This page shows the modules you need are in the mainline kernel.

If you did not make wireless support modular - you should, as it makes debug so much easier. As you did not post your kernel .config, I can't check.

----------

## ConvexConepiece

He confirmed in one of his posts that indeed he is building it as a module Neddy.

What i'd like to know however is what i've already asked twice but had no answer for - 

 *ConvexConepiece wrote:*   

> 
> 
> Is your problem in the actual modprobe of the driver, or does the driver get loaded yet you are unable to find the interface in ifconfig? perhaps silly but you did try 
> 
> ```
> ...

 

So yes your dmesg and lsusb show that it should be ready to use - provided the kernel config is ok. So again, what happens when you 

```
modprobe rtl8187 && ifconfig wlan0 up
```

???

----------

## percy_vere_uk

Sorry folks for missing the requested information:

# modprobe rt18187 && ifconfig wlan0 up

FATAL: Module rt18187 not found.

.....................................

my .config                      http://paste.pocoo.org/show/258750/

.....................................

/proc/bus/usb/devices     http://paste.pocoo.org/show/258751/

.....................................

I do not have a file or folder in /lib/  called firmware

Neddy you say this is a usb device but the card is internal on the laptop.

I have just noticed this in dmesg:

  381.153637] ADDRCONF(NETDEV_UP): wlan0: link is not ready

percy

----------

## NeddySeagoon

percy_vere_uk,

```
modprobe rt18187
```

close but no cigar.

Your post says rt1 (numeral one) you need rtl (letter lowercase l) 

```
modprobe rtl8187
```

Can you see the difference in the two code blocks ?

The page I referenced in my previous post says they are USB devices.  Its getting quite common for laptops to contain built in USB devices, jus as they contain built in PCI devices. Laptop manufacters sabe some money on connectors, thats all.   Indeed it shows up in your /proc/bus/usb/devices. 

```
emerge usbview
```

 and look for yourself.  Thats a GUI viewer for /proc/bus/usb/devices.

Unlike many USB wifi adaptors, you have no need of firmware.

----------

## percy_vere_uk

Neddy

Sorry it was a case of trying to do too many things at the same time, good job I am not being tested on this!

................................................

# modprobe rtl8187 && ifconfig wlan0 up

# 

This just gives  a root prompt and nothing else.

................................................

usbview    done that see what you mean

Do you still want me to "if you did not make wireless support modular - you should, as it makes debug so much easier"

If so how?

percy

----------

## ConvexConepiece

 *percy_vere_uk wrote:*   

> Neddy
> 
> This just gives  a root prompt and nothing else.
> 
> 

 

That's good news, no error means it should be loaded. Check with 

```
# lsmod | grep rtl8187
```

 it should be there.

So is the adapter still not ready to use with your fav network manager eg. wicd?

If not i'm curious what 

```
# ifconfig
```

 says after the modprobe & ifconfig wlan0 up?

----------

## percy_vere_uk

ConvexConepiece

----------------------------------------------------------

# lsmod | grep rtl8187

rtl8187                26681  0 

# 

----------------------------------------------------------

wicd  automatically  finds and connects to the wired network which works fine but shows scanning "no wireless networks found"

If I then left click on wicd  and select the network option then "find a hidden network" then enter the ESSID (which I set to the same as SSID in the router wireless settings). Then click on connect and this gives "no wireless networks found"

----------------------------------------------------------

# modprobe rtl8187 && ifconfig wlan0 up

# ifconfig

eth1      Link encap:Ethernet  HWaddr 00:a0:d1:89:d5:ae  

          inet addr:192.168.0.2  Bcast:192.168.0.255  Mask:255.255.255.0

          inet6 addr: fe80::2a0:d1ff:fe89:d5ae/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

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

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

          collisions:0 txqueuelen:1000 

          RX bytes:399944 (390.5 KiB)  TX bytes:207373 (202.5 KiB)

          Interrupt:27 Base address:0xa000 

lo        Link encap:Local Loopback  

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

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

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

          collisions:0 txqueuelen:0 

          RX bytes:2340 (2.2 KiB)  TX bytes:2340 (2.2 KiB)

wlan0     Link encap:Ethernet  HWaddr 00:16:44:70:0d:9e  

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

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

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

          collisions:0 txqueuelen:1000 

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

# 

-------------------------------------------------------------------

percy

----------

## ConvexConepiece

Looks good.

With wicd, you need to open the settings and change the "wireless interface" to wlan0 as a one off, and rescan.

----------

## percy_vere_uk

ConvexConepiece

I now get the network selection box and looking at these.

wireless network shows connected at 100%

wired network properties box shows hostname 'my_hostname' this is not ticked. but this works fine.

wireless network properties box shows hostname 'my_hostname' greyed out ticking this brings it up to full contrast.

when wireless network is connected and I go into the browser and enter 'forums.gentoo.org' I eventualy get: 

........................

Unable to load page

Problem occurred while loading the URL https://forums.gentoo.org/

Cannot resolve hostname

.........................

I get the same result with this box ticked or not.

percy

----------

## NeddySeagoon

percy_vere_uk,

Get back to the error condition you described above and post the output of /sbin/route  and the content of /etc/resolv.conf

----------

## percy_vere_uk

Neddy

Sorry about the formatting on this.

# /sbin/route

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.168.0.0           *            255.255.255.0     U     0      0        0 wlan0

loopback               *            255.0.0.0            U     0      0        0 lo

default          192.168.0.1     0.0.0.0              UG    0      0        0 wlan0

#

------------------------------------------------------------------------

"the content of /etc/resolv.conf"

# Generated by dhcpcd from wlan0

# /etc/resolv.conf.head can replace this line

nameserver 192.168.0.1

# /etc/resolv.conf.tail can replace this line 

------------------------------------------------------------------------

percy

----------

## NeddySeagoon

percy_vere_uk,

Providing you have a nameserver at 192.168.0.1, which is your next hop towards the internet, that all looks good.

Try 

```
ping goolge.com

ping 173.194.36.104
```

Both should give the same result.

How does your wireless get its IP address - do you have a static setup or do you use dhcpcd? 

Can you test with wired networking to ensure that works ?

----------

## percy_vere_uk

NeddySeagoon

$ ping goo1ge.com            ???

ping: unknown host goo1ge.com

 $ 

.........................................................

 $ ping google.com

ping: unknown host google.com

 $ 

..........................................................

 $ ping 173.194.36.104

PING 173.194.36.104 (173.194.36.104) 56(84) bytes of data.

..........................................................

The wired network works fine it just worked as soon as I installed wicd I have not changed anything in the properties box for the wired or the wireless networks. 

As  Posted previously : Wed Sep 08, 2010 7:06 am

"wireless network shows connected at 100% 

wired network properties box shows hostname 'my_hostname' this is not ticked. but this works fine. 

wireless network properties box shows hostname 'my_hostname' greyed out ticking this brings it up to full contrast. 

when wireless network is connected and I go into the browser and enter 'forums.gentoo.org' I eventualy get: 

........................ 

Unable to load page 

Problem occurred while loading the URL https://forums.gentoo.org/

Cannot resolve hostname 

......................... 

I get the same result with this box ticked or not. "

..........................................................

These are the technical settings as provided by my ISP:

Primary DNS Server: 212.87.64.7

Secondary DNS Server: 212.87.64.10

Gateway IP: 192.168.1.1

Subnet Mask: 255.255.255.0

PC Settings:

First Usable IP: 192.168.1.2

Last Usable IP: 192.168.1.253

Subnet Mask: 255.255.255.0

.........................................................

percy

----------

## NeddySeagoon

percy_vere_uk,

 *percy_vere_uk wrote:*   

> These are the technical settings as provided by my ISP:
> 
> Primary DNS Server: 212.87.64.7
> 
> Secondary DNS Server: 212.87.64.10
> ...

 

This means you are in the 192.168.1.0/24 subnet but your wireless says route output says  *Quote:*   

> 192.168.0.0 * 255.255.255.0 U 0 0 0 wlan0 

 

Thats the 192.168.0.0/24. Those subnets are mutually exclusive.

It may be that your wireless is on a different subnet to your wired intentionally but thats not normal with a domestic router.

So where does the wireless get its IP and nameserver from?

What is in /etc/conf.d/net ?

IF you really do have wireless and wired in different subnets, they may well have separate firewall arrangements.

What router do you have ?

----------

## percy_vere_uk

NeddySeagoon

My router is a: 'Netgear DG834G Router Modem'

................................................................................................

Contents of /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 :]!).

modules=( "iwconfig" )

iwconfig_wlan0="mode managed"

wpa_timeout_wlan0=15

................................................................................................

percy

----------

## NeddySeagoon

percy_vere_uk

I've had a read of router manual and it appears to contain only a single dhcp server, which is what I expected. Its own IP address is 192.168.0.1, which ties in with what you post about your wired connection.

As you only have a single DHCP server, your wireles IP should be in the same range ... starting 192.168.0...

You posted above that your wireless IP address was 196.168.1 .... which makes me think you connected to some other AP, not your own.

Start your wlan0 interface.

What does 

```
iwconfig wlan0 
```

show ?

Is the ESSID your own?

Post the full output.

Do

```
iwlist wlan0 scanning
```

It will take a few seconds and will return a list of Access Points in range.

----------

## percy_vere_uk

NeddySeagoon

......................................................

iwconfig wlan0

wlan0     IEEE 802.11bg  ESSID:"wobafgkmrns"  

          Mode:Managed  Frequency:2.447 GHz  Access Point: 00:1F:33:73:52:28   

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

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

          Encryption key:off

          Power Management:off

          Link Quality=70/70  Signal level=-24 dBm  

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

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

#

....................................................... 

iwlist wlan0 scanning

wlan0     Scan completed :

          Cell 01 - Address: 00:1F:33:73:52:28

                    Channel:8

                    Frequency:2.447 GHz (Channel  :Cool: 

                    Quality=70/70  Signal level=-17 dBm  

                    Encryption key:off

                    ESSID:"as_per_my_router_ssid"

                    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

                    Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s

                    Mode:Master

                    Extra:tsf=000000005567ad81

                    Extra: Last beacon: 218ms ago

                    IE: Unknown: 000B776F626166676B6D726E73

                    IE: Unknown: 010882848B0C12961824

                    IE: Unknown: 030108

                    IE: Unknown: 2A0100

                    IE: Unknown: 32043048606C

                    IE: Unknown: DD180050F2020101040003A4000027A4000042435E0062322F00

                    IE: Unknown: DD0900037F01010024FF7F

#

........................................................ 

percy

----------

## NeddySeagoon

percy_vere_uk,

Well, that works and you are the owner of the only AP in range.

What is the IP address on wlan0 ?

----------

## percy_vere_uk

Neddy

when I connect to wlan0 it gives IP 192.168.0.3

percy

----------

## NeddySeagoon

percy_vere_uk,

Thats ok too.  Your router is 192,168.0.1

Your wired interface is 192.168.0.2, which your DHCP server remembers for some time by its MAC ID.

When you connect wlan0, you get 192.168.0.3 which is the next IP address from the the dhcp pool.

It seems as if everything is working.  You are associated, you have an IP.

As your wireless is in the same subnet as your wired interface, you cannot test wireless just by unplugging the wired interface.

You must do things in the right order.

```
/etc/init.d/net.eth0 stop

/etc/init.d/net.wlan0 stop

/etc/init.d/net.wlan0 start
```

This will prevent the routing table being in a mess and  ensure that /etc/resolv.conf is correctly populated.

That should work.

----------

## percy_vere_uk

NeddySeagoon

This operating system is from time to time moved between computers. 

On this laptop the wired interface is eth1.

...............................

# /etc/init.d/net.eth1 stop

* WARNING:  net.eth1 has not yet been started.

# /etc/init.d/net.wlan0 stop

bash: /etc/init.d/net.wlan0: No such file or directory

# /etc/init.d/net.wlan0 start

bash: /etc/init.d/net.wlan0: No such file or directory

# 

...............................

eth1 was up and working at the start and at the finish of this

connection properties shows eth1 up and working and I have posted this message 

with it!

...............................

Just to be sure I did:

# /etc/init.d/net.eth0 stop

* WARNING:  net.eth0 has not yet been started.

..............................

percy

----------

## NeddySeagoon

percy_vere_uk,

Adapt what I said to suit your interfaces. You didn't stop your wired interface.

No matter yet as the script to control your wireless does not exist, so it can't start.

```
# /etc/init.d/net.wlan0 stop

bash: /etc/init.d/net.wlan0: No such file or directory 
```

First make the script.

```
cd /etc/init.d

ln -s net.lo net.wlan0
```

you only do this once.

Now stop your eth1 as thats your wired interface

```
/etc/init.d/net.eth1 stop
```

and start wireless

```
/etc/init.d/net.wlan0 start
```

----------

## percy_vere_uk

NeddySeagoon

Starting off with eth1 up and working.

...................................................................................................

# cd /etc/init.d

# ln -s net.lo net.wlan0

init.d # /etc/init.d/net.eth1 stop

 * Caching service dependencies ...

 *  Cannot add provide 'portmap', as a service with the same name exists!                                                               [ ok ]

 * WARNING:  net.eth1 has not yet been started.

 ...............................

init.d # /etc/init.d/net.wlan0 start

 * Starting wlan0

 *   Configuring wireless network for wlan0

 *     wlan0 connected to ESSID "wobafgkmrns" at 00:1F:33:73:52:28

 *     in managed mode on channel 8 (WEP disabled)

 *   Configuration not set for wlan0 - assuming DHCP

 *   Bringing up wlan0

 *     dhcp

 *       Running dhcpcd ...

wlan0: dhcpcd 4.0.15 starting

wlan0: broadcasting for a lease

wlan0: offered 192.168.0.3 from 192.168.0.1

wlan0: acknowledged 192.168.0.3 from 192.168.0.1

wlan0: checking 192.168.0.3 is available on attached networks

wlan0: leased 192.168.0.3 for 259200 seconds                                                                                            [ ok ]

 *       wlan0 received address 192.168.0.3/24

init.d # 

................................

This brings up wlan0. When I go into a browser and enter:

https://forums.gentoo.org/  I get usual message as below:

........................

Unable to load page

Problem occurred while loading the URL https://forums.gentoo.org/

Cannot resolve hostname

........................

percy

----------

## NeddySeagoon

percy_vere_uk,

This makes me wonder how eth1 got started as you appear to have no /etc/init.d/net.eth1 script.

Make your eth1 script, just as you did for wlan0 ... just put eth1 in place of wlan0 in the same commands.

You will also need to edit /etc/conf.d/rc find this bit  

```
# Do we allow any started service in the runlevel to satisfy the depedency

# or do we want all of them regardless of state? For example, if net.eth0

# and net.eth1 are in the default runlevel then with rc_depend_strict="NO"

# both will be started, but services that depend on 'net' will work if either

# one comes up. With rc_depend_strict="YES" we would require them both to

# come up.

#rc_depend_strict="YES"
```

an add a line 

```
rc_depend_strict="NO"
```

Since you do not want to force eth1 and wlan0 to be up at the same time.

Now stop both eth1 and wlan0, then start wlan0.

Other than eth1 not stopping, it all looked good.

----------

## percy_vere_uk

NeddySeagoon

/etc/init.d  has links for net.eth0   net.eth1   net.wlan0  

I have looked in /etc/conf.d/rc and there is no  rc_depend_strict=" "       section

I have tried adding the line  rc_depend_strict="NO"  and re booting 

Then:

# /etc/init.d/net.eth1 stop

 * WARNING:  net.eth1 has not yet been started.

# /etc/init.d/net.wlan0 stop

 * Unmounting network filesystems ...                                                                                                   [ ok ]

 * Stopping wlan0

 *   Bringing down wlan0

 *     Shutting down wlan0 ...                                                                                                          [ ok ]

# /etc/init.d/net.wlan0 start

 * Starting wlan0

RTNETLINK answers: Unknown error 132

RTNETLINK answers: Unknown error 132

RTNETLINK answers: Unknown error 132

 *   Configuring wireless network for wlan0

 *   wlan0 does not support scanning

 *   You either need to set a preferred_aps list in /etc/conf.d/wireless

 *      preferred_aps=( "ESSID1" "ESSID2" )

 *      and set associate_order_wlan0="forcepreferred"

 *      or set associate_order_wlan0="forcepreferredonly"

 *   or hardcode the ESSID to "any" and let the driver find an Access Point

 *      essid_wlan0="any"

 *   or configure defaulting to Ad-Hoc when Managed fails

 *      adhoc_essid_wlan0="WLAN"

 *   or hardcode the ESSID against the interface (not recommended)

 *      essid_wlan0="ESSID"

 *   Failed to configure wireless for wlan0                                                                                             [ !! ]

# 

 ...............................................................

percy

----------

## NeddySeagoon

percy_vere_uk,

Before 

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

do

```
ifconfig wlan0 up
```

and see its its any better.

The important point to note is that in the output of the route cammand, at any time, should only have one interface listed beside lo and only a single default route as the last line of the output.  If you have two (or more) default routes, its unlikely to work ... and if it does, its working for the wrong reasons.

If you want to talk to me on IRC, I'll be on freenode shortly.  You can ping me in #gentoo or in ##NeddySeagoon

----------

## percy_vere_uk

NeddySeagoon

# ifconfig wlan0 up

SIOCSIFFLAGS: Unknown error 132

# /etc/init.d/net.wlan0 start

 * Starting wlan0

RTNETLINK answers: Unknown error 132

RTNETLINK answers: Unknown error 132

RTNETLINK answers: Unknown error 132

 *   Configuring wireless network for wlan0

 *   wlan0 does not support scanning

 *   You either need to set a preferred_aps list in /etc/conf.d/wireless

 *      preferred_aps=( "ESSID1" "ESSID2" )

 *      and set associate_order_wlan0="forcepreferred"

 *      or set associate_order_wlan0="forcepreferredonly"

 *   or hardcode the ESSID to "any" and let the driver find an Access Point

 *      essid_wlan0="any"

 *   or configure defaulting to Ad-Hoc when Managed fails

 *      adhoc_essid_wlan0="WLAN"

 *   or hardcode the ESSID against the interface (not recommended)

 *      essid_wlan0="ESSID"

 *   Failed to configure wireless for wlan0                                                                                             [ !! ]

# 

...........................................

Going off line now. Thanks for all your help so far.

percy

----------

## NeddySeagoon

percy_vere_uk,

Do you have a physical rfkill swaitch, that you need to operate to turn on wireless?

These switches are aimed at power saving. The default state at boot will be wireless off.

----------

## percy_vere_uk

NeddySeagoon

The rfkill switch I assume is the switch on the laptop, which I have left turned on and shows the on indicator. The wireless is working fine in Ubuntu on the same laptop.

.......................................................

From the output (above) # ifconfig wlan0 up  the line  "* You either need to set a preferred_aps list in /etc/conf.d/wireless"

I do not have the file ' /etc/conf.d/wireless'

......................................................

Here is part of my wicd log which might help:

2010/09/13 14:41:25 :: wlan0: waiting for carrier

2010/09/13 14:41:25 :: 

2010/09/13 14:41:26 :: wlan0: carrier acquired

2010/09/13 14:41:26 :: 

2010/09/13 14:41:26 :: wlan0: broadcasting for a lease

2010/09/13 14:41:26 :: 

2010/09/13 14:41:26 :: wlan0: offered 192.168.0.3 from 192.168.0.1

2010/09/13 14:41:26 :: 

2010/09/13 14:41:26 :: wlan0: acknowledged 192.168.0.3 from 192.168.0.1

2010/09/13 14:41:26 :: 

2010/09/13 14:41:26 :: wlan0: checking 192.168.0.3 is available on attached networks

2010/09/13 14:41:26 :: 

2010/09/13 14:41:31 :: wlan0: leased 192.168.0.3 for 259200 seconds

2010/09/13 14:41:31 :: 

2010/09/13 14:41:31 :: 

2010/09/13 14:41:31 :: DHCP connection successful

2010/09/13 14:41:31 :: not verifying     ????????????????????

2010/09/13 14:41:31 :: Connecting thread exiting.

2010/09/13 14:41:31 :: ifconfig wlan0

2010/09/13 14:41:31 :: IP Address is: 192.168.0.3

2010/09/13 14:41:35 :: Sending connection attempt result Success

2010/09/13 14:41:35 :: ifconfig eth1

....................................................

Do you think that it might be an idea to try different drivers as my original comment "I have found that the drivers supplied with the kernel do not work." came about by comments by others in various forums having come to this conclusion.

If you think this is not going to be resolved then I have found 'rtl8187L_linux_26.1039.0104.2010.release.tar.gz'

on the realtek website. But would need some guidance in installing these.

If you do think there is still 'hope' then please carry on! 

percy

----------

## NeddySeagoon

percy_vere_uk,

You post above indicates that you got a wireless connection as far as your router at least.

If nothing else seems to work, its missing nameservers in /etc/resolv.config or routes for eth1 still in your routing table

The kernel driver is certainly OK.

The file /etc/conf.d/wireless has long been depreciated. You can put all of the wireless settings in /etc/conf.d/net.

That you get that message prompts me to ask you to post the output of 

```
emerge --info
```

so that we can see versions of your key packages.

Get back to 

```
2010/09/13 14:41:31 :: ifconfig wlan0

2010/09/13 14:41:31 :: IP Address is: 192.168.0.3

2010/09/13 14:41:35 :: Sending connection attempt result Success 
```

thenpost your /etc/resolv.conf and route output.

If route mentions wlan0 at all, and not eth0, then 

```
ping 192.168.0.1
```

 should work. Thats a ping to your router.

Try 

```
ping 173.194.36.104
```

which will work if your route contains the default route

and 

```
ping google.com 
```

needs both the default route and nameserver

----------

## percy_vere_uk

NeddySeagoon

# emerge --info

Portage 2.1.8.3 (default/linux/x86/10.0/desktop/gnome, gcc-4.4.3, glibc-2.11.2-r0, 2.6.34-gentoo-r1 i686)

=================================================================

System uname: Linux-2.6.34-gentoo-r1-i686-AMD_Turion-tm-_64_X2_Mobile_Technology_TL-58-with-gentoo-1.12.11.1

Timestamp of tree: Sat, 14 Aug 2010 11:45:01 +0000

ccache version 2.4 [disabled]

app-shells/bash:     4.0_p37

dev-java/java-config: 2.1.11

dev-lang/python:     2.5.4-r3, 2.6.4-r1, 3.1.2-r4

dev-util/ccache:     2.4-r7

dev-util/cmake:      2.8.1-r2

sys-apps/baselayout: 1.12.11.1

sys-apps/sandbox:    1.6-r2

sys-devel/autoconf:  2.13, 2.65

sys-devel/automake:  1.9.6-r2, 1.10.2, 1.11.1

sys-devel/binutils:  2.20.1-r1

sys-devel/gcc:       4.1.2, 4.3.4, 4.4.3-r2

sys-devel/gcc-config: 1.4.1

sys-devel/libtool:   2.2.6b

virtual/os-headers:  2.6.30-r1

ACCEPT_KEYWORDS="x86"

ACCEPT_LICENSE="* -@EULA"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-O2 -march=i686 -pipe"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/share/X11/xkb"

CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"

CXXFLAGS="-O2 -march=i686 -pipe"

DISTDIR="/usr/portage/distfiles"

FEATURES="CCACHE SANDBOX assume-digests distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"

GENTOO_MIRRORS="http://mirror.bytemark.co.uk/gentoo/"

LANG="en_GB.UTF-8"

LDFLAGS="-Wl,-O1 -Wl,--as-needed"

LINGUAS="en"

MAKEOPTS="-j3"

PKGDIR="/usr/portage/packages"

PORTAGE_CONFIGROOT="/"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

SYNC="rsync://rsync.us.gentoo.org/gentoo-portage"

USE="... X a52 aac acl acpi alsa avahi berkdb bluetooth branding bzip2 cairo cdr cli consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr eds emboss encode evo exif fam firefox flac fluxbox fortran gdbm gdu gif gnome gnome-keyring gpm gstreamer gtk hal iconv ipv6 jpeg lcms ldap libnotify lm_sensors mad mdnsresponder-compat mikmod mng modules mp3 mp4 mpeg mudflap nautilus ncurses nls nptl nptlonly ogg opengl openmp pam pango pcre pda pdf perl png policykit ppds pppd python qt3 qt3support qt4 readline reflection sdl session spell spl ssl startup-notification svg symlink sysfs syslog tcpd tiff tk truetype unicode usb vorbis x x264 x86 xcb xlrunner xml xorg xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="vesa evdev fbdev" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

# 

..............................................

"Get back to"

2010/09/14 10:37:55 :: ifconfig wlan0

2010/09/14 10:37:55 :: IP Address is: 192.168.0.3

2010/09/14 10:37:55 :: Sending connection attempt result Success

...........................

Contents of /etc/resolv.conf

# Generated by dhcpcd from wlan0

# /etc/resolv.conf.head can replace this line

nameserver 192.168.0.1

# /etc/resolv.conf.tail can replace this line

............................

"route output"

# route -n

Kernel IP routing table

Destination_____Gateway____Genmask___Flags_ Metric_ Ref___Use Iface

192.168.0.0____0.0.0.0____ 255.255.255.0__U____0____0_____0 eth1

127.0.0.0______0.0.0.0____ 255.0.0.0______U____0____0_____0 lo

0.0.0.0______192.168.0.1_____0.0.0.0_____UG___0____0_____0 eth1

#  

........................................................................................

percy

----------

## NeddySeagoon

percy_vere_uk,

There must be an ordering of commands problem. Your emerge --sync is fine.

Your /etc/resolv.conf is good - it should be the same whichever interface you use.

Your route output shows no signs of wlan0 which is completely wrong.

I was half expecting to see the eth1 lines repeated for wlan0 ... then it depends on the order of the entries in the routing table what works and what doesn't.

A correct routing table will have eth1 replaced with wlan0 in both places and eth1 missing.

Lets be a little more direct.

Unplug the ethernet wire and reboot. If wlan0 does not attempt to start, run 

```
/etc/init.d/net.wlan0
```

after you log in.

Ignore the errors about eth1 - they are fine, its because its not connected.

What is in /etc/resolv.conf and in the output of route now ?

If its as I described - it will work.

----------

## percy_vere_uk

NeddySeagoon

Re boot with wired ethernet unplugged. wicd selects wlan0  eth1 not detected

......................

# /etc/init.d/net.wlan0 start

 * Starting wlan0

 *   Configuring wireless network for wlan0

 *     wlan0 connected to ESSID "wobafgkmrns" at 00:1F:33:73:52:28

 *     in managed mode on channel 8 (WEP disabled)

 *   Configuration not set for wlan0 - assuming DHCP

 *   Bringing up wlan0

 *     dhcp

 *       Running dhcpcd ...

wlan0: dhcpcd 4.0.15 starting

wlan0: broadcasting for a lease

wlan0: offered 192.168.0.3 from 192.168.0.1

wlan0: acknowledged 192.168.0.3 from 192.168.0.1

wlan0: checking 192.168.0.3 is available on attached networks

wlan0: leased 192.168.0.3 for 259200 seconds                                                                                            [ ok ]

 *       wlan0 received address 192.168.0.3/24

# 

......................

contents of  /etc/resolv.conf

# Generated by dhcpcd from wlan0

# /etc/resolv.conf.head can replace this line

nameserver 192.168.0.1

# /etc/resolv.conf.tail can replace this line

......................

route output

# route -n

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.168.0.0___0.0.0.0______255.255.255.0_U____0_____0____0 wlan0

127.0.0.0_____0.0.0.0______255.0.0.0_____U____0_____0____0 lo

0.0.0.0_______192.168.0.1____0.0.0.0_____UG___0_____0____0 wlan0

# 

......................

Then in browser I clicked on link to gentoo forums and the usual error message appears:

'Unable to load page

Problem occurred while loading the URL https://forums.gentoo.org/

Cannot resolve hostname'

......................

Re-connect wired ethernet scan in wicd and eth1 comes up. 

................................................................................................

Perhaps nothing to do with the problem but I have just done a:

emerge -pv --update --deep --newuse  world

With a view to updating the system once I have this wireless working 

and I did notice this conflict involving wicd.

  ('installed', '/', 'sys-power/pm-utils-1.4.1', 'nomerge') pulled in by

    >=sys-power/pm-utils-1.1.1 required by ('installed', '/', 'net-misc/wicd-1.7.0', 'nomerge')

.................................................................................................

percy

----------

## NeddySeagoon

percy_vere_uk,

That all looks good - apart from the error message.

The wireless worked - it broadcast for and received an IP address.

```
Cannot resolve hostname'
```

means that either  nameserver 192.168.0.1 is wrong and there is no nameserver at that IP, which is unlikely, as the same entry works for wired, or the wireless link is down.

Try the pings I gave earlier. If ping <IP> works but ping <name> fails, its a nameserver issue.

If both fail, save the output of dmesg with 

```
dmesg > wifi_dmesg.txt
```

and post wifi_dmesg.txt when you get back to wired networking.

dmesg may have some useful error messages at the end.

Hint:  if you paste things like route -n output between code tags, the white space is preserved and the text is presented in a fixed width font.

Like this

```
$ /sbin/route -n

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.168.100.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0

192.168.10.0    192.168.100.1   255.255.255.0   UG    3      0        0 eth0

127.0.0.0       127.0.0.1       255.0.0.0       UG    0      0        0 lo

0.0.0.0         192.168.100.1   0.0.0.0         UG    3      0        0 eth0
```

It looks ugly in your outgoing message - try preview before you send.

----------

## percy_vere_uk

NeddySeagoon

Using wlan0

```
# ping 192.168.0.1

PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
```

```
# ping 173.194.36.104

PING 173.194.36.104 (173.194.36.104) 56(84) bytes of data.
```

```
# ping google.com

ping: unknown host google.com

#
```

```
wifi_dmesg.txt     http://paste.pocoo.org/show/263194/
```

Thanks for the hint on the formatting, I always use preview but had not found how to preserve white space.

percy

----------

## NeddySeagoon

percy_vere_uk,

From your pastebin,

```
[  670.671413] wlan0: authenticate with 00:1f:33:73:52:28 (try 1)

[  670.673409] wlan0: authenticated

[  670.725417] wlan0: associate with 00:1f:33:73:52:28 (try 1)

[  670.778679] wlan0: RX AssocResp from 00:1f:33:73:52:28 (capab=0x421 status=0 aid=1)

[  670.778683] wlan0: associated

[  670.784369] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

[  674.707027] eth1: no IPv6 routers present

[  681.594022] wlan0: no IPv6 routers present

[  740.711645] wlan0: deauthenticating from 00:1f:33:73:52:28 by local choice (reason=3)
```

We can seen that wlan0 works, then the system drops the link.

There are lots of posts on the forums about that, put  

```
wlan0 deauthenticating from by local choice reason 3 site:forums.gentoo.org
```

into google.

It looks to be a configuration issue. Possibly power management as the link is good for 70 seconds.

----------

## percy_vere_uk

NeddySeagoon

I have changed  /etc/conf.d/net  to:

```
# Prefer iwconfig over wpa_supplicant

modules=( "iwconfig" )

# Configure WEP keys for Access Points called ESSID1 and ESSID2

# You may configure up to 4 WEP keys, but only 1 can be active at

# any time so we supply a default index of [1] to set key [1] and then

# again afterwards to change the active key to [1]

# We do this incase you define other ESSID's to use WEP keys other than 1

#

# Prefixing the key with s: means it's an ASCII key, otherwise a HEX key

#

# enc open specified open security (most secure)

# enc restricted specified restricted security (least secure)

key_ESSID1="[1] s:yourkeyhere key [1] enc open"

key_ESSID2="[1] aaaa-bbbb-cccc-dd key [1] enc restricted"

# The below only work when we scan for available Access Points

# Sometimes more than one Access Point is visible so we need to

# define a preferred order to connect in

preferred_aps=( "ESSID1" "ESSID2" )
```

Now it is working fine. Many thanks to you and ConvexConepiece for sorting this out for me.

percy

----------

