Wireless configuration in Arch Linux from Command line
WARNING: Please refer the Arch Wiki for more information on wireless configuration using netcfg tool which makes your life more easier than this. This HOWTO may help you in understanding the behind the hood stuff.
Last week I installed Arch Linux in my Toshiba Satellite A80 laptop. You know that Standard Arch Linux installation does not provide complete desktop packages. Once installation done, we use to end up in well structured basic OS with configuration tools.
So we have to depend on internet to download rest of the packages. In this scenario, When I first booted my Arch Linux system, found that it detected my wired network card as “eth0″ and wireless card as “eth1″ interface. Unfortunately I did not have either ethernet port or cable in my environment. But I had secured wireless environment. So “eth0″ was useless then. But wireless “eth1″ was in need of some configurations (to get into the secured wireless network in my environment). In this scenario I rebooted my laptop in Ubuntu (Dual boot) and collected tips from Arch Linux wiki to configure wireless network. This HOWTO just briefs about the steps I followed to make the setup up. Fine, thanks for your patience, let us go to work.
Wireless device on laptop: 06:02.0 Network controller: Intel Corporation PRO/Wireless 2200BG [Calexico2] Network Connection (rev 05)
Wireless network: Wireless G network with “Infrastructure” mode and security method as “WPA and WPA2 Personal”.
The following steps are based on above configuration, since this is most standard configuration. You may hack the script to adjust to your configuration. You have to replace the phrases marked as <..> with your data.
Ensure that you have installed “wireless_tools” and “wpa_supplicant” packages during installation. By default they are installed.
Ensure that wireless device is visible when you issue “ifconfig -a” command. In my case it was “eth1″ which is called “network interface”. It may be “eth0″ or “wlan0″ or anything like that in your case. Note it down. Your wireless network SSID and secure password should be kept ready.
Backup the /etc/wpa_supplicant.conf file as /etc/wpa_supplicant.conf.org. Now run the following command to create a new Now create /etc/wpa_supplicant.conf
wpa_passphrase <SSID> <your security password> > /etc/wpa_supplicant.conf
Note that your SSID and secure password should be without any quotes or any other symbols.
Now edit the /etc/wpa_supplicant.conf and add the following settings as the first line of file.
Now your /etc/wpa_supplicant.conf should look like this.
#psk=”<your security password>”
Note that “psk” value is based on your security password. It will differ from mine.
Create a file called /root/wireless_start.sh with executable permission.
ifconfig eth1 up
iwconfig eth1 <SSID>
wpa_supplicant -B -Dwext -i eth1 -c /etc/wpa_supplicant.conf
ping -c 2 www.google.com
In the above script replace eth1 and <SSID> with your network interface and SSID. This script will connect with wireless network and get IP address assigned.
Run the above script. If the script pings www.google.com successfully twice, voila! your wireless network is up! Enjoy! If not, just run the commands in the script in terminal one by one and debug.