Tuesday, April 21, 2009

Configure wireless network for CentOS 5

ตั้งค่าใช้ Wireless network สำหรับ CentOS 5

Installing the NDISwrapper module

The ndiswrapper module is not included with CentOS/RHEL so we will need to use a 3rd party repository. Here we will be using the ATrpms repository.

1. Load up a terminal window if you are in the graphic interface.

2. Switch to the root user by entering the command “su -” (without the quotes) and typing in your root password

3. Edit the file /etc/yum.conf. Using nano we type the command:

nano -w /etc/yum.conf

4. If you have already configured yum to use the ATrpms repository then append “*ndiswrapper*” to the end of the “includepkgs” line and skip the next setup. Otherwise continue on.

5. Add the following to the bottom of this file:

[atrpms]
name=EL $releasever - $basearch - ATrpms
baseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/stable
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
gpgcheck=1
enabled=1
exclude=*kmdl*i586*
includepkgs=*ndiswrapper*

6. Save the file. In nano you press Ctrl-X, answer yes to the “Save modified buffer” question and then press enter on the file name to write.

7. If you have not previously setup ATrpms execute the following command:

rpm --import http://ATrpms.net/RPM-GPG-KEY.atrpms

8. Now execute the following command:

yum install ndiswrapper ndiswrapper-kmdl-`uname -r`

The ndiswrapper module is now installed.

Configuring NDISwrapper

First find out which wireless controller you have in your system. This website should provide you with details on which card you have in your laptop. Alternatively you can use our Linux Wireless Chipset Detector utility which will determine which controller you have.

Download the Windows XP driver which is appropriate for your wireless controller. This website should recommend a driver to use based on the laptop you are using. If not then the driver from your manufacturer should work fine. You can also find a list of drivers from the NDISwrapper site.

Extract the contents of your driver. If you have an .exe file you will need to use either cabextract or unshield to extract its contents. If you have a zip file just use unzip.

Now execute the following two commands as root:

ndiswrapper -i /.inf
ndiswrapper -l

Change the above from to your driver's directory and change to match the name of the .inf file in the driver's directory. For example a Broadcom controller is sometimes called bcmwl5.inf and is in the bcmwl folder. You would type in:

ndiswrapper -i bcmwl/bcmwl5.inf
ndiswrapper -l


The last line should print out a list of the installed drivers. You should also see “hardware present” printed next to your driver. If you do not see “hardware present” it is likely that you installed the wrong Windows XP driver.

Now type in:

modprobe ndiswrapper

And the wireless controller should be active. You can try to see if the controller is working by typing:

iwlist scan


This should print out a list of access points in your area.

Finally we need to tell CentOS/RHEL to load this driver each time we start the computer. Type in the following:

echo "modprobe ndiswrapper" >> /etc/rc.modules
chmod 755 /etc/rc.modules


You should now have a working wireless controller.


Enabling NetworkManager



Starting the NetworkManager service

First we are going to configure your CentOS system to automatically start the NetworkManager on startup. You can do this by running:

chkconfig NetworkManager on

Then we are going to start it so we can use it right away without needing to reboot:

service NetworkManager start

If you have done that in your graphical environment (Gnome), your Notification Area (usually in the Gnome panel on the top-right) will show a new icon. If you left-click on this icon, you will see a list of possible Wireless networks to connect to.

You may want to disable the start of your network at boot time, since you won't need it anymore. For this, simply do:

chkconfig network off

There is nothing more to it !

Useful hint: The request for the keyring password when using NetworkManager can be suppressed by using the pam_keyring package as has been described in [2]. The pam_keyring package can be obtained from the RPMForge repository.

[1] http://www.redhat.com/magazine/003jan05/features/networkmanager/

[2] http://fedoraproject.org/wiki/Tools/NetworkManager (some gnome- and kde-specific info)

Note:

Related:

Reference:

No comments:

Post a Comment