About 8 months ago I decided that Windows ME had to go. Since I don’t pirate software this left me with two options, buy an OS for my laptop or install something Open Source. At the time I had just started playing with a Redhat server at work, so CentOs (Redhat clone) seemed like a great option. Not to mention, how could I really call myself a computer geek if I didn’t yet know my way around linux? This was a great opportunity for me to learn something new. As a result I formatted my harddrive and started setting up CentOs.
CentOS’s made it really simple. In less than an hour I was looking at a lovely GUI interface much like my familiar Windows desktop. It had menus, it had buttons. It even had a cool little trash can. Best of all, it was NOT Windows ME. Right at the point were I was feeling all uncool and geek-like for my accomplishment, I realized my wireless card didn’t work. “Not a problem”, I said, “I’ll just go download a driver”, and proceeded to go to http://www.netgear.com .
Would you believe it? Netgear’s website didn’t have Linux listed as one of the OS options in their drop-down. “Not a problem”, I said, “I’ll just google it!”. Within a few minutes I had a whole bunch of postings a few years old stating difficulties people had getting the MA521 installed on their linux systems. Not concerned, I eventually ran into several websites talking about different ways to get this card to work. Apparently the MA521 uses the Realtek 8180L chipset. The websites listed three alternative drivers.
First I tried Realtek’s. It wouldn’t compile on my system. Then I tried NDISWrapper, it would randomly freeze, and I couldn’t get it to connect to my wireless. Frustrated I finalley ran into the rtl8180-sa2400 projects driver. I got it running and connected to my wireless, but it wouldn’t get an IP address. Frustrated I formatted the harddrive and reinstalled. Then life got busy and I put the project on hold.
Yesterday I picked up this project again and I have no idea why I originally had so much trouble. (This could have something to do with the fact I’ve dealt heavily with Linux servers in the last 8 months). I downloaded the driver from the rtl8180 project and had it compiled in under 2 minutes. For newbies, these are the steps I followed.
- Downloaded the driver.
- Right-clicked on the file and chose “Extract Here”
- Launched the CentOS menu->System Tools->Terminal Program - Super User Mode
- Navigated to the extraced folder (in my case “cd Desktop”, “cd rtl8180-0.21″)
- Typed “make”
That was it ;-), it did its thing and compiled the modules. I then ran “module_load” script (By typing “./module_load” (without the quotes) into the Terminal Window). Wallah, the wireless module was loaded. Now all I needed to do was connect it to the router. Following the directions in the INSTALL document, I did the following to connect to the wireless.
- sudo iwconfig wlan0 essid SID_NAME (Replace SID_NAME with your wireless name)
- sudo ifconfig wlan0 IP_Address (Replace IP_Address with an IP on your network)
- sudo route add default gw GATEWAY_IP dev wlan0 (Replace GATEWAY_IP w Router IP)
Theoretically, you should be able to use “dhcp” (without quotes) instead of specifying an IP address. If you do that the last entry shouldn’t be needed either. For some reason I haven’t gotten that to work yet. I then tested my setup in the Terminal Window.
- ping GATEWAY_IP
I got a response! It worked! I was online! However, “ping www.google.com” still didn’t work. I needed to fix my DNS. To do this, I went back to my Terminal Window.
- nano /etc/resolv.conf (Opens resolv.conf for editing. I had to add entries for dns)
- nameserver 208.67.222.222 (I used OpenDNS addresses, but you could use GATEWAY_IP)
- nameserver 208.67.220.220 (or look up the ones from your ISP, OpenDNS is faster
) - CTR+X (To Exit)
- Y (To Save)
I was successfully online. Now I could “ping google.com”, open up a web browser and go somewhere, etc. The only problem was that every time I wanted to go online, I had to open up a terminal window and run the module_load script. This was annoying, and I didn’t want to have to show my wife how to do this if she wanted to use the laptop. ;-), as a result, I started reading to learn how to make modules load on startup.
The answer is a script in /etc/rc.d/init.d . Before I made this, however, I wanted to move the compiled modules to another location besides on my desktop. I chose to put them in the drivers folder, underneath my kernel version. To do this I went back to my Terminal Window.
- cd /home/USERNAME/Desktop/rtl8180-0.21 (Replace USERNAME with your username)
- cp *.ko /lib/modules/2.6.9-34.EL/drivers/net/pcmcia (The middle will vary depending on kernel)
Once the files were copied, I went to create the file in init.d, and then create a symbolic link to that location so that it would run properly. I’ve never written an init.d script, so it took a few times, but I eventually got it right ;-). Here is the file I created (You will need to change some values, e.g. IP addresses, and module location). You can download and copy it to the /etc/rc.d/init.d folder. You then need to change the permissions, and create a symbolic link.
- (Navigate to where you saved the file)
- cp wlan /etc/rc.d/init.d/ (Copies the file)
- cd /etc/rc.d/init.d/ (Changes the directory)
- chmod 744 wlan (Changes the permissions so it can execute)
- cd ../rc5.d/ (Change to run level 5 directory)
- ln -s ../init.d/wlan S11wlan (Create a symbolic link, Start 11th in order)
I then rebooted my computer. Sure enough, the wireless loaded up, connected, and worked great. It was finalley setup. Hopefully someone will find this useful