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.

arch-linux-logoIssue background
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.

My environment
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.

Step 1:
Ensure that you have installed “wireless_tools” and “wpa_supplicant” packages during installation. By default they are installed.

Step 2:
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.

Step 3:
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.

Step 4:
Now edit the /etc/wpa_supplicant.conf and add the following settings as the first line of file.

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel

Now your /etc/wpa_supplicant.conf should look like this.

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
network={
ssid=”<SSID>”
#psk=”<your security password>”
psk=a45be9fd7e6c514fd7a11bbe4aacface1c6780d698bce4f2aaaf40656a6da44c
}

Note that “psk” value is based on your security password. It will differ from mine.

Step 5:
Create a file called /root/wireless_start.sh with executable permission.

#!/bin/sh
ifconfig eth1 up
iwconfig eth1 <SSID>
sleep 3
wpa_supplicant -B -Dwext -i eth1 -c /etc/wpa_supplicant.conf
sleep 10
dhcpcd eth1
ifconfig eth1
ping -c 2 www.google.com
exit

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.

Step 6:
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.





More posts in this category


No Comments on “Wireless configuration in Arch Linux from Command line”

You can track this conversation through its atom feed.

No one has commented on this entry yet.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

RSSSubscribe to Comments on this post



Educate Elevate!

Well said!

If you have to gain all these other "soft skills" or business skills in order to just be a regular software engineer, then why keep working for someone else? One of the main reasons for being an employee is because it's (supposed to be) both easier and safer than striking out on your own. Instead of long hours and having to wear many hats, you can just concentrate on your own skill, and leave the business stuff to the people who specialize in that. Anyone familiar with the idea of specialized labor should understand this. The downside is (supposed to be) your pay is lower than it could potentially be by owning and operating your own business. If today's corporations want their regular rank-and-file employees to wear many hats, be multi-talented, and have a lot of business skills, then they're simply not doing their own jobs correctly. - Grishnakh (Slashdot user)

Archives

Google Page Rank

Creative Commons License
Black God by KaruppuSwamy Thangaraj is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Based on a work at www.karuppuswamy.com.
Permissions beyond the scope of this license may be available here