Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1007898
  • 博文数量: 177
  • 博客积分: 3629
  • 博客等级: 中校
  • 技术积分: 1839
  • 用 户 组: 普通用户
  • 注册时间: 2005-02-23 21:21
文章分类

全部博文(177)

文章存档

2021年(1)

2020年(5)

2019年(4)

2018年(7)

2017年(1)

2016年(4)

2014年(1)

2013年(8)

2012年(10)

2011年(50)

2009年(12)

2008年(10)

2006年(56)

2005年(8)

分类: LINUX

2011-02-24 19:50:53

Rtl8187 wireless From ArchWiki
Jump to: ,

This page describes how to get the rtl8187 wifi-driver working

Note: The rtl8187 driver is in the kernel (thus the driver comes with the kernel26 package)


The rtl8187 chip is made for usb-cards/dongles

It supports 802.11(a)/b/g and the following encryptions: WEP, WPA and WPA2

The driver's source is released under the GPL

Contents []
Using and testing the driver/Troubleshooting

Make sure that you have loaded the rtl8187 module with

modprobe rtl8187

Then run

dmesg | grep rtl8187
You should see some output like this usbcore: registered new interface driver rtl8187

If you see that line everything should be OK

Using the driver

If everything is right, you should have two new interfaces: wlan0 and wmaster0 If you don't see wlan0 just run

ifconfig wlan0 up

To list all available wifi-networks just run

iwlist wlan0 scan

For more information about configuring your wifi-network see here:

What to do if your connection always times out? Method 1: Lowering the transfer rate manually

The solution can be found in this thread:

Just set the rate to 5.5

iwconfig wlan0 rate 5.5M auto

Actually this worked for a while but it would still start revving out, so making the last item "fixed" ensures it does not spin. Btw. If your wireless card has already gone into meltdown issuing this command will get it working again.

iwconfig wlan0 rate 5.5M fixed

I have also tried setting this in the IWOPTS, but it does not seem to be taking, so now what I do until I get this sorted out is:

netcfg2 -c
iwconfig wlan0 rate 5.5M fixed

And then it never times out (at least for me)

Found the $POST_UP option, so appending this to your profile config file, sets the rate correctly when using the netcfg tools.

POST_UP="iwconfig wlan0 rate 5.5M fixed"

Actually for my card setting the rate higher still works, so now this line looks like:

POST_UP="iwconfig wlan0 rate 12M fixed"

Now calling;

netfcg2 -c

or

netcfg-menu

and choosing your profile works without extra commands.

Method 2: Aircrack-ng patched driver

Another method that works for some users are the Aircrack-ng patches for the rtl8187 driver. This driver can be installed by the package from .

Method 3: Using Ndiswrapper

If everything else fails, then you are left with using Ndiswrapper. Ndiswrapper takes Windows RTL8187 drivers and uses them to enable your card.

Symptoms which suggest you may have better luck with Ndiswrapper:

  • "iwlist wlan0 scan" results are irregular and/or don't show some APs.
  • Everything seems to be working, except the DHCP request, which may just time out.

1. Install ndiswrapper:

pacman -S ndiswrapper

2. Download the Windows drivers:

wget

3. Extract the drivers:

gzip -dc ndisdrivers.tar.gz | tar xf -

4. If you have the rtl8187 module loaded, then do this:

rmmod rtl8187

It is suggested that you remove previous ndiswrapper drivers, if you have installed them.

ndiswrapper -l
ndiswrapper -r

Also add "ndiswrapper" and "!rtl8187" to /etc/rc.conf under MODULES - this will stop rtl8187 from loading on boot, and will enable ndiswrapper to load on boot.

5. Install the driver: If you have an older kernel(eg. older than 2.6.28.*), do:

cd ./ndisdrivers/Win98-krnl24/

If you have a newer kernel (eg. 2.6.28.*), do:

cd ./ndisdrivers/Win98seME-krnl28/

Proceed with:

ndiswrapper -i net8187b.inf
ndiswrapper -m



Part II: 无线网络管理

为了管理已经安装好的无线驱动,并且使无线能正常工作,需要安装一个无线连接管理工具。下面章节将帮助您确定一个最佳管理方法。

过程和需要使用的工具,将依赖于下面几个因素:

  • The easiness of configuration management, from a completely manual setup procedure that you’ll need to repeat at each boot to a software-managed, automatic, autostarting solution
  • The encryption type (or not) that protects the wireless network
  • 是否需要network profiles,比如,如果你需要经常切换不同网络(比如手提电脑)。
Encryption types WEP

The Wired Equivalent Privacy encryption scheme was introduced in 1997. But the discovery of weaknesses in the WEP algorithm in 2001 have made it a poor choice of wireless security protocol. Some tools, such as aircrack, can break the WEP protection in a couple of seconds. Despite this issue, WEP is still popular and the default encryption scheme in many commercial wireless routers.

WPA/WPA2

The Wi-Fi Protected Access security protocol was created in response to the WEP weaknesses. WPA and especially WPA2, which uses the AES encryption algorithm, are considered secure. Wi-Fi certified devices must now provide WPA2. Several modes of authentication are supported by WPA/WPA2: a PSK mode (Pre-Shared Key) designed for home and small office use, and an Enterprise (EAP) mode, which requires an authentication server. The following instructions will only cover the PSK method.

管理方法选择

This table shows the different methods that can be used to activate and manage a wireless network connection, depending on the encryption and management types, and the various tools that are required. 虽然还有其他办法,但这通常是最常使用的:

管理方法 No encryption/WEP WPA/WPA2 PSK
手动, 需要每次系统启动重做一次 ifconfig + iwconfig + dhcpcd/ifconfig ifconfig + iwconfig + wpa_supplicant + dhcpcd/ifconfig
自动管理, centralized without network profile support define interface in /etc/rc.conf not covered
自动管理, with network profiles support Netcfg, wicd, NetworkManager, etc…


无论选的那个方案,最好先尝试手动方法。这将有助于您了解不同步骤的意义,并在出问题时解决之。 Another tip: if possible (e.g. if you admin your wifi access point), try connecting with no encryption, to check everything works. Then try using encryption, either WEP (simpler to configure) or WPA.

手动方式

软件包 wireless_tools 提供的程序是建立一个无线连接的基础工具。如果你需要使用WPA/WPA2 encryption, 您还需要软件包wpa_supplicant。 These powerful userspace console tools work extremely well and allow complete, manual control from the shell.

These examples assume your wireless device is wlan0. Replace wlan0 with the appropriate device name.

Note: Depending on your hardware and encryption type, some of these steps may not be necessary. Some cards are known to require interface activation and/or access point scanning before being associated to an access point and being given an IP address. Some experimentation may be required. For instance, WPA/WPA2 users may directly try to activate their wireless network from step 3.

1. (可选,可能需要) 一些无线网卡在使用wireless_tools前需要激活kernel interface:

# ifconfig wlan0 up

2. (可选,可能需要) See what access points are available:

# iwlist wlan0 scan

We assume you want to use the essid named MyEssid.

3. Depending on the encryption, you need to associate your wireless device with the access point to use and pass the encryption key.

  • No encryption
# iwconfig wlan0 essid "MyEssid"
  • WEP

using an hexadecimal key:

# iwconfig wlan0 essid "MyEssid" key 1234567890

using an ascii key:

# iwconfig wlan0 essid "MyEssid" key s:asciikey
  • WPA/WPA2

You need to edit the /etc/wpa_supplicant.conf file as described in . Then, issue this command:

# wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf

This is assuming your device uses the wext driver. If this does not work, you may need to adjust these options. Check for more information and troubleshooting.

4. Finally, provide an IP address to the network interface. Simple examples are:

# dhcpcd wlan0

for DHCP, or

# ifconfig wlan0 192.168.0.2 # route add default gw 192.168.0.1

for static IP.

Note: Although the manual configuration method will help troubleshoot wireless problems, you will have to retype every command each time you reboot.
集中自动管理,但没有network profile支持
Note: This method and configuration examples are only valid for unencrypted or WEP-encrypted networks, which are particularly unsecure. To use WPA/WPA2, you'll need to use other solutions like using manually or network managers, such as or . Also, avoid mixing these methods as they may create a conflict and prevent the wireless card from functioning.
  • /etc/rc.conf文件中的网络部分是“网络脚本”的配置文件。因此,你可以利用/etc/rc.conf这个文件定义并配置一个简单的无线连接, wlan_=" essid " and INTERFACES=( ). 网络名称替换MyEssid。例如:

For example:

# /etc/rc.conf eth0="dhcp" wlan0="dhcp" wlan_wlan0="wlan0 essid MyEssid" # Unencrypted #wlan_wlan0="wlan0 essid MyEssid key 1234567890" # hex WEP key #wlan_wlan0="wlan0 essid MyEssid key s:asciikey" # ascii WEP key INTERFACES=(eth0 wlan0)

并不是所有的无线网卡都是wlan0. 你可以用ifconfig -a来查看你的网络接口。举个例子:如果你的无线网络接口是ath0的话,你就应该把wlan_wlan0 改成wlan_ath0:

wlan_ath0="ath0 essid MyEssid key 12345678"

把ath0加入INTERFACES= 行,替换wlan0.)

  • 当然,你也可以在/etc/conf.d/wireless中设置你的无线网络(这个文件也是“网络脚本”的配置文件), 举个例子:
# /etc/conf.d/wireless wlan_wlan0="wlan0 essid MyEssid"
Note: 这方法的局限:对经常变换网络的手提电脑来说,最好还是使用多个,这样能够很容易地切换网络。就是这种方式的一种。
自动管理,并使用网络管理工具 Netcfg2

provides a versatile, robust and fast solution to networking on Arch.

It uses a profile based setup and is capable of detection and connection to a wide range of network types. This is no harder than using graphical tools. Following the directions above, you can get a list of wireless networks. Then, as with graphical tools, you will need a password.

Occasionally, you have to properly at first, if you want to use an encrypted wireless connection (eg: wep, wpa, wpa2, etc.) in netcfg, because netcfg package depends on wpa_supplicant.

详细文档: 开发中版本的详细文档: Network Profiles development

下面还有一系列的替代方案:

wireless-tools

这些强大的控制台工具十分有效而且能够实现完全的、手工的控制。这些例子假设你的无线设备是wlan0。将wlan0换成你自己的设备名称。 很多网卡需要你的核心接口是打开的,这样你才能使用无线工具:

ifconfig wlan0 up

扫描可用接入口:

iwlist wlan0 scan

利用扫描结果,告诉你的无线设备去用哪一个接入口。例如:

iwconfig wlan0 essid linksys

然后像平时一样设置网络接口。简单的例子如下:

dhcpcd wlan0

或者

ifconfig wlan0 192.168.0.2 route add default gw 192.168.0.1 NetworkManager

除了能管理有限链接,NetworkManager还提供了一个易于使用的图形界面程序来选择你想要的的无线移动链接。

详情请见 。

Wicd

Wicd 是一个网络管理工具,能够同时管理无线和有线连接。程序是用Python 和 Gtk写的,比NetworkManager对依赖的要求 更少, 非常适合轻量级桌面用户。 Wicd 现在已经被放在extra里面,有适合 i686和x86_64的版本。

想了解更多,请阅读 的wiki.

Autowifi

Autowifi is a daemon that configures your wireless network automatically depending on the ESSID. Once configured, no user interaction is necessary and no GUI tools are required.

For more information, see the wiki.

Wifi Radar

WiFi Radar是一个Python/PyGTK2的管理无线配置的程序(只有无线的)。它能够扫描可用的网络、为你所选择的网络创建新的配置。

详情请见。

Wlassistant

Wlassistant是一个非常简单直观的图形界面无线网连接管理程序。 安装方法如下:

pacman -S wlassistant

Wlassistant必须以root权限运行:

sudo wlassistant

一种使用wlassistant管理/etc/rc.conf里面有的无线网卡的方法是指出你经常使用的链连接点。开机后你的网卡就会自动连接到这 个essid,但是如果其他的无线网络是需要的/可用的,wlassistant在那时会请求连入它们。通过在名称前加一个@来后台运行/etc /rc.conf中的network守护程序来减少开机等待时间。

其他资源
  • - NetworkManager官方网站
  • - WICD官方网站
  • Wifi Radar - Wifi Radar官方网站

modprobe ndiswrapper

Proceed to connect as you normally would.

阅读(2676) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~