顯示具有 ifconfig 標籤的文章。 顯示所有文章
顯示具有 ifconfig 標籤的文章。 顯示所有文章

2009年6月9日 星期二

Wireless USB Network Card WIFI-Link WL-USB-RSMA-27 on Arch Linux

when you plug the card into the usb slot, arch linux will modprobe rtl8187 module automatically. the driver is mac80211 based. then you can see interface wlan0 registered. it is pity it doesn't work with WIFI-Link WL-USB-RSMA-27 though aircrack-ng indicates 2.6.27 and newer kernel contain a fully-functional driver for rtl8187b and rtl8187l. so we got to compile the module by ourselves

some errors cause the newest driver rtl8187_linux_26.1025.0328.2007 cannot be compiled on arch linux and modern distributions. fortunately aircrack-ng has a patch for compiling the old driver rtl8187_linux_26.1010.0622.2006

1. unload rtl8187 module

rmmod rtl8187

wlan0 should be disappeared

2. download the old one

wget http://dl.aircrack-ng.org/drivers/rtl8187_linux_26.1010.zip

3. unzip

7z x rtl8187_linux_26.1010.zip

4. change to the extracted directory

cd rtl8187_linux_26.1010.0622.2006

5. download the patch

wget http://patches.aircrack-ng.org/rtl8187_2.6.27.patch

6. extract some components

tar xzf drv.tar.gz
tar xzf stack.tar.g

7. apply patch to source code

patch -Np1 -i rtl8187_2.6.27.patch

8. one more step to pass through compiling

vi beta-8187/r8187.h
--
change
#include <asm/semaphore.h>
to
#include <linux/semaphore.h>

9. compile and install

make && make install

i know the interface name would be wlan0 after new installed module r8187 loaded. so i write wlan0 directly in the following steps

10. if you need to load settings while booting, wlan_<interface>= in rc.conf isn't working. so i pick rc.local for use

vi /etc/rc.local
--

iwconfig wlan0 essid <ESSID> mode Ad-Hoc key 1234567890
ifconfig wlan0 up <IP> netmask <MASK>

remember to install wireless_tools package before iwconfig. and if you need sharing ppp connection with wlan interface, set mode to Ad-Hoc. although iwconfig supports Master, Repeater mode. only Ad-Hoc and Managed modes work on WL-USB-RSMA-27

11. block old rtl8187 and load new r8187 module when booting

vi /etc/rc.conf
--

..
MODULES=(r8187 !rtl8187)
..

12. reboot then done

2009年6月3日 星期三

WiFi / Wireless USB Network Card Edimax EW-7318UG on Arch Linux

1. identify the card

check /var/log/message when you plug your card into usb slot
you'll see

kernel: wmaster0 (rt73usb): not using net_device_ops yet
kernel: wlan0 (rt73usb): not using net_device_ops yet
kernel: Registered led device: rt73usb-phy0:radio
kernel: Registered led device: rt73usb-phy0:assoc
kernel: Registered led device: rt73usb-phy0:quality
kernel: usbcore: registered new interface driver rt73usb
kernel: usbcore: registered new interface driver rt2500usb

or lsusb command
or check your card if is linux supported
https://help.ubuntu.com/community/WifiDocs/WirelessCardsSupported

2. you can see the interface from iwconfig command

3. bring the interface up

ifconfig wlan0 up
--

SIOCSIFFLAGS: No such file or directory

that means you need a firmware file. below is the error log appearing in /var/log/message at the same time

kernel: rt73usb 1-4:1.0: firmware: requesting rt73.bin
firmware.sh[19027]: Cannot find firmware file 'rt73

4. install the corresponding firmware packages

pacman -S rt2x00-rt71w-fw ( or rt2x00-rt61-fw )

5. in order to install package from http://repo.arch-linux.pl/, add the following setting to /etc/pacman.conf

[archlinux.pl]
Server = ftp://repo.arch-linux.pl/i686

6. install the package, RaLink RT73 USB Enhanced Drivers

pacman -Sy rt73-k2wrlz
--

Drivers installed, but not loaded. To enable it: 'rmmod rt73usb && modprobe rt73

7. to avoid conflict between modules, block the modules which would be loaded automatically
these module was observed from lsmod command

vi /etc/modprobe.d/blacklist
--

blacklist rt2500usb
blacklist rt73usb
blacklist rt2x00usb
blacklist rt2x00lib

8. add rt73 to MODULES in /etc/rc.conf then reboot

9. iwconfig

rausb0 RT73 WLAN ESSID:""
Mode:Ad-Hoc Frequency=2.412 GHz Cell: XX:XX:XX:XX:XX:XX
Bit Rate=11 Mb/s
RTS thr:off Fragment thr:off
Link Quality=65/100 Signal level:-54 dBm Noise level:-143 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

10. ifconfig rausb0 up

11. scan for available access points for testing

iwlist rausb0 scan

12. usage of iwconfig

iwconfig rausb0 essid "SSID" key 1234567890

if your wep key is ascii, prefix with s:

iwconfig rausb0 essid "SSID" key s:asciikey

13. automatical setup while booting

vi /etc/rc.conf
--

..
wlan_rausb0="rausb0 essid SSID mode Ad-Hoc key 1234567890"
rausb0="rausb0 XXX.XXX.XXX.XXX netmask XXX.XXX.XXX.XXX"
INTERFACES=(eth0 rausb0)
..