Lusticky

Blog

Wireless network Wi-Fi and Linux

,

Translated article about WLAN on Linux. If you're not using Archlinux, you can skip step number 1. (which automatizes the connecting to network) and continue from 1.1.
Původní česká verze: Bezdrátová síť Wi-Fi a Archlinuxu

You'll need a package wireless_tools (repository core) and a driver for a chipset on your wi-fi card.

For my Edimax card 7128g with the chip Ralink 2500 I used a driver in the package rt2500 - see article Wireless_Setup on the wiki.

sudo pacman -S wireless_tools

1. Setting up network with WEP security:

sudo nano /etc/rc.conf

wlan0="dhcp"
wlan_wlan0="wlan0 essid myssid key S54SA08S8746EW"
INTERFACES=(wlan0)


For using automatic rate:
sudo iwconfig wlan0 rate auto


Archlinux has a bug.
To resolve this uncomment the following lines in /etc/rc.d/network

#BSSID = `iwgetid $ 1-ra` 
# if [[$ BSSID "=" 00:00:00:00:00:00 "]]; then 
# Printhl "Could not associate $ 1 - try increasing WIRELESS_TIMEOUT and check network is WEP or has no security" 
# Return 1 
# fi 
If you do not use WPA security in your network, you can restart the network by the following command:
sudo /etc/rc.d/network restart 



1.1 Alternative - manual connection:
sudo ifconfig wlan0 up 
sudo iwlist wlan0 scan 
sudo iwconfig wlan0 essid myssid 
WEP: sudo iwconfig eth1 key AC487AC48AC486 
sudo dhcpcd wlan0
For using automatic rate:
sudo iwconfig wlan0 rate auto
For setting custom MAC adress use this:
ifconfig wlan0 hw ether 00:00:00:AA:AA:AA
(interface must be turned off using ifconfig wlan0 down)


2. Setting WPA or WPA2 secured network
Install wpa_supplicant:
sudo pacman-S wpa_supplicant


2.1 Using Wicd network manager:
  1. Install wicd:
    sudo pacman -S wicd
  2. Editing /etc/rc.conf:
    Comment every network thing except HOSTNAME. (Comment ROUTES, gateway, INTERFACES, eth0, wlan0, etc.)
    Add wicd to daemons array:
    DAEMONS=(... !network ... @wicd ...)
  3. Reboot, launch wicd-client if it's not already in your tray and connect to your wi-fi network.


2.2 Manual way without any network manager:
Note: wpa_supplicant uses the following terms:
  • RSN = WPA2/IEEE 802.11i (WPA2 also can be used as an alias)
  • WPA-PSK = WPA pre-shared key (this requires' psk 'field)
  • WPA-EAP = WPA authentication using EAP (known as WPA-Profesional, or WPA-Enterprise)
  • CCMP = AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0]
  • TKIP = Temporal Key Integrity Protocol [IEEE 802.11i/D7.0]


Eiting wpa_supplicant.conf
Example configuration for WPA2, pre-shared key (PSK) encryption AES (CCMP) and Temporal Key Integrity Protocol (TKIP).

Use wpa_passphrase to generate your psk for wpa_supplicant config
wpa_passphrase myssid myWPApassword
sudo nano /etc/wpa_supplicant.conf
#ctrl_interface=/var/run/wpa_supplicant
#ctrl_interface_group=wheel
network={
        ssid="mojessid"
        bssid=00:11:22:33:44:55
        proto=WPA2
        key_mgmt=WPA-PSK
        pairwise=CCMP TKIP
        group=CCMP TKIP
        psk=a1d1ad65a6d54asd68aas4a65sad4 #This is what you got from wpa_passphrase command above
        psk="myWPApassword" #Or you can it directly in a quotes
}



Now you can run wpa_supplicant to provide you WPA security (& at the end means in background):
sudo wpa_supplicant -Dwext -i wlan0 -c/etc/wpa_supplicant.conf &

If you want to start wpa_supplicant automaticaly, you can set up Autowifi daemon, or you can add previous command to /etc/rc.local file.

Then you can restart the network using:
sudo /etc/rc.d/network restart

Bezdrátová síť Wi-Fi a LinuxWelcome | Vítejte

Comments

Unregistered user Monday, February 28, 2011 6:22:52 PM

privedko writes: unbelievable

Write a comment

New comments have been disabled for this post.