|
December 2006 Wi-Fi |
Copyright (C) 2006 by Steve Litt. All rights reserved. Materials from guest authors copyrighted by them and licensed for perpetual use to Linux Productivity Magazine. All rights reserved to the copyright holder, except for items specifically marked otherwise (certain free software source code, GNU/GPL, etc.). All material herein provided "As-Is". User assumes all risk and responsibility for any outcome.
|
and Rapid Learning: Secret Weapon of the Successful Technologist by Steve Litt |
[ Troubleshooters.Com
| Back Issues |Troubleshooting Professional Magazine
]
|
|
CONTENTS
| Term | Definition | Example sentence |
| Wi-Fi | A system for implementing a Local Area Network (LAN) without wires, using either infrared or radio waves, adhering to the 802.11 specification. Wi-Fi has never been commercially implemented using infrared, but the radio wave version is available as a commodity at your local discount store (Walmart, Target, Costco and the like), as well as computer stores. Wi-Fi is also known, perhaps more accurately, as Wireless Lan. Some say the term Wi-Fi originated as Wireless Fidelity, but I've seen others dispute that assertion. | I set up wifi in my house, so now we can all take our laptops anywhere in the house or the back yard and surf the net. |
| LAN | Local Area Network. This is the kind of network you have in your house or one-office business, so that all your computers can talk to each other and share the same Internet connection. | My doctor's office just got a LAN so everyone can access patient records from every room. |
| 802.11 | This is a specification of transmission of IP packets (TCP/IP) over radio waves (or over infrared, but this was never commercially implemented), using modulation techniques. The 802.11 specification has been modified and augmented several times, including subspecs 802.11b, 802.11a, 802.11g, 802.11n, | All my Wi-Fi hardware is 802.11 compliant. |
| Modulation | The act of sending information over a radio wave, where the radio wave is a more or less steady state "carrier wave" and the information is "modulated" on top of it. The simplest type of modulation is AM (Ampletude Modulation), where the carrier wave's amplitude increases and decreases with the transmitted information. The AM band (540-1620Khz) on your radio is an example. Another early type of modulation is FM (Frequency modulation), where the frequency of the carrier wave is varied according to the transmitted information. The FM band (88Mhz-108Mhz) on your radio is an example. There are many, many modulation techniques, each with its own strengths and weaknesses. Modulation techniques used in Wi-Fi includeCarrier Sense Multiple Access with Collision Avoidance (CSMA/CA), orthogonal frequency-division multiplexing (OFDM), Complementary code keying (CCK), | The 54Mbit/s 802.11g standard uses the orthogonal frequency-division multiplexing (OFDM) modulation technique. |
| 802.11b | The first practical extension of the 802.11 standard, this protocol had a 11Mbit/s maximum data rate and a 150 foot range. | I have one of those old 11Mbit/s 802.11b access points. You want it for five bucks? |
| 802.11a | This "improvement" on 802.11b had a 54Mbit/s maximum data rate, it operated on the 5Ghz range, a band with less traffic for less interference. It also introduced OFDM modulation, which was later used in 802.11g. However, 802.11a has only a 100 foot range, and is incompatible with 802.11b. As a result, 802.11a never really caught on. | I've never seen an 802.11a access point. |
| 802.11g | Another improvement, popular as a sub $100.00 commodity in 2006, 802.11g had a 54Mbit maximum data rate and a 100 foot range. It uses OFDM modulation, and it's ubiquitous at computer stores, electronics stores, and even discount stores such as Walmart and Target. | My entire wireless network is 802.11g compliant. |
| 802.11n | As of 2006, this is a proposed modification to the specification. 802.11n is expected to yield extreme gains, with a 540Mbit/s maximum data rate and a 160 foot range. In 2006 there is some "pre-n equipment" for sale, based upon the expected standard. | As soon as 802.11n becomes commodity, I'm replacing my 802.11g with 802.11n! |
| 802.11i | This 2004 subspecification addresses increased security, and introduces the WPA concept. | In our business we've implemented 802.11i in the form of WPA2 with a radius server, but when we travel, we take the security we can get. |
| Term | Definition | Example sentence | ||||||||||
| NIC | Stands for Network Interface Card, also called a Network Card, an Ethernet Card. This is a circuit board attached to your computer's PCI slot or USB slot or some other slot. The NIC accommodates an Ethernet RJ45 connector such that it can be plugged into a LAN's cabling, thereby joining its computer to the LAN. | I buy cheapo 8039 based network cards for eight bucks apiece,and they work just fine in my Linux boxes. | ||||||||||
| Wireless NIC | The wireless equivalent of a NIC. This device joins the computer to the local area network not by connecting to cabling, but by receiving and transmitting modulated radio waves. Some plug into the computer's PCI slots, some the USB connectors. Some of the USB wireless NICs have a cable such that the wireless NIC can be positioned for optimal radio reception. Some laptops come with internal wireless NICs. | I use Linksys WUSB54G wireless NICs. They connect to my computer's USB port via a cable, so I can move them to get the best signal. | ||||||||||
| Wireless NIC device name | The device name, used in commands like ifup, ifdown, ifconfig, iwlist, and iwconfig, associated with the wireless NIC. Here are several examples:
|
|||||||||||
| Ad-Hoc mode | Ad-hoc mode is a wireless mode of operation where all
wireless NICs communicate with all other wireless NICs within range.
It's peer to peer networking, that looks like this:![]() As you can see, Al and Bill's computers communicate directly, as do Bill's and Carl's. Al and Carl might communicate directly, or might go through Bill depending on distances. Bill and Dan communicate through Carl (assuming Bill and Dan are too far to communicate directly). To put a network card in ad-hoc mode, the following line must be added to /etc/sysconfig/network-scripts/ifcfg-ath0: Mode=Ad-Hoc
Ad-Hoc mode is the easiest way to connect two computers with wireless network cards, but as the number of devices increases, you'll want to use Managed Mode. |
At MacDonalds, Jeff and I wanted to transfer files between our notebooks, but there was no wireless LAN there, so we both set our wireless network cards in ad-hoc mode, and did the transfers. | ||||||||||
| Managed mode | Managed mode is not peer to peer -- it's client-server. Each
wireless NIC is a client, and the server is a device called the Access
Point. Here's a diagram illustrating the structure of a managed mode network: ![]() To put a network card into managed mode, include the following in /etc/sysconfig/network-scripts/ifcfg-ath0: Mode=Managed Because managed mode is much more practical in a wider variety of situations, the rest of this document will focus exclusively on managed mode. |
In my opinion, managed mode is the way to go if you have more than a few devices on the wireless network. | ||||||||||
| Access point | In a managed wireless network, the Access Point is the
server part of the client server relationship. It's probably called an
Access Point because it's the point of access for each
wireless NIC. Here's a picture of my Linksys WRT54GL access point:![]() Most access points also have RJ45 connections in order to hook it up to a wired network. Many access points contain other functionalities such as built in firewalls and built in cable modems or DSL modems. Most access points come with a Windows CD for "easy setup". However, many, including the Linksys WRT54GL, which is still widely available new in late 2006, also have web interfaces, so you can configure them using a computer with any reasonable excuse for a web browser. Unfortunately, the docs supplied with the WRT54GL don't mention the web interface, which by default is available at 192.168.1.1. If you're a Linux guy, be sure to get an access point with a web interface. Each access point has a unique ESSID. |
In a managed mode wireless network, every device must be in range of the access point. | ||||||||||
| ESSID | Extended Service Set IDentifier.( I've also seen it called
Enhanced Service Set IDentifier). This identifies a wireless network, and must be used by any device
communicating over that network. It's a case sensitive string with a
maximum of 32 characters. To avoid conflicts, it must be unique within
radio range, meaning you really should change it from the factory
default. By default, most access points broadcast the ESSID so that clients can list all wireless access points by ESSID, and the user can pick the appropriate one. Many access points can be configured NOT to broadcast the ESSID, so that nobody knows it's there without prior knowledge or sophisticated hacking tools. A client can attach to a non-broadcast ESSID by specifically naming it. Although not broadcasting the ESSID is more secure, it's security by obscurity and should not be relied upon. In fact, with good WPA encryption, the security benefit of not broadcasting the ESSID might be outweighed by the inconvenience. The terms ESSID and SSID are often used interchangeably, and in most contexts there is no practical difference. |
When I configured my access point, I changed the ESSID to AdamsFamily and set it up not to broadcast the ESSID. | ||||||||||
| Cable modem | A device whose input is cable (like cable TV) and whose output is Ethernet. The proper address translation is performed. | If the cable company charges me too much for a cable modem, I'll buy one from Target. | ||||||||||
| DSL modem | A device whose input is DSL (via the phone line) and whose output is ethernet. The proper address translation is performed. | If the phone company charges me too much for a DSL modem, I'll buy one from Target. |
| Term | Definition | Example Sentence |
| Computer | For the purposes of this discussion, hardware., the hunk of metal and semiconductors inside the computer's case. | I bought a computer with an Athlon XP 2600, 2GB of RAM, and a 400 GB hard disk. Now I have to load Linux on it. |
| Operating system | The software (computer program) that allows the computer to
receive keyboard and mouse input from the user, send video and audio
information to the user (monitor and speakers), operate a high level
network, facilitate communications between parts of the computer such
as disks, memory and the CPU, and run computer programs. Examples of operating systems include Linux, BSD, Mac OS-10, Unix, Windows. Old but historically important operating systems include VMS, RT-11, RSDOS, MS-DOS, and CPM. |
My favorite operating system is Linux. |
| Driver | A small piece of software to link a piece of hardware to the
operating system. The following diagram illustrates a driver for a
wireless NIC:![]() The preceding diagram illustrates that because the driver interfaces between the piece of hardware (let's call it a device) and the operating system, each combination of device and operating system requires its own driver. Therefore, you cannot use the Windows driver for a wireless NIC if you run Linux, unless you use a clever piece of software called ndiswrapper (more on that later). Likewise, you cannot use a driver meant for a different device (unless the different device has the same chipset and other similarities, making it effectively the same design). Because the driver interfaces to the device, the driver must have intimate knowledge of the device, or at least a substantial and complete API (Application Programming Interface) to the device. When the hardware manufacturer refuses to release a substantial and complete API of the device, it's very difficult for programmers to create a driver for the mysterious device. This is why it takes so long for new devices to acquire Linux drivers, and why those Linux drivers often implement only a small subset of the device's capabilities. The Linux programmers must guess, reverse engineer, and test, over and over. Windows drivers appear as soon as the device hits the shelves, because the manufacturer, whose programmers have full knowledge of the device's hardware and API, have a (relatively) easy time coding it, without the necessity of reverse engineering. What this means is that drivers for many wireless NICs are either buggy, incomplete, or nonexistent. Luckily, some very clever programmers made the ndiswrapper software, which interfaces a Windows driver to the Linux operating system, providing a workaround until the appearance of a high quality Linux native driver. |
I've had trouble finding and configuring a driver for my wireless NIC. |
| NDIS | Network Driver Interface Specification.
This is a simplification, perhaps an oversimplification, but NDIS is
the Microsoft Windows interface between Windows and the wireless NIC's
Windows driver. It's a specification to which most wireless NIC
hardware conforms, because it's how Windows does things. See the
following diagram:![]() Once again, NDIS is an interface between Windows and an NDIS compliant Windows driver for an NDIS compliant wireless NIC. Although NDIS is used mostly in Windows, it is a known specification, which means anyone can implement it, at least to a degree. That's how ndiswrapper was created... |
Windows computers interface with wireless network cards via NDIS. |
| ndiswrapper | This software is an adapter -- the software equivalent of a
PS/2 to Serial adapter or a USB to PS/2 keyboard adapter. It enables
the Linux operating system to talk with an NDIS compliant Windows
driver. Since NDIS is how Windows does wireless, that means most
commodity wireless NICs. The following is an oversimplified diagram of how ndiswrapper works:![]() The preceding is all you really need to know, but for the curious amongst you, my research indicates that ndiswrapper combines the NDIS API, a Windows Kernel API, and a Linux module to interface the Windows Kernel API with Linux: ![]() In the preceding, the thick rounded rectangle is ndiswrapper. ndiswrapper isn't perfect. It doesn't reveal/interface to many cards' individual properties or configuration. It doesn't support permiscuous mode, nor the modes Master, Repeater, or Monitor. It supports only modes Ad-Hoc and Managed. Not all settings on all cards will work. Some devices require the extraction of device firmware from the Windows drivers, presenting an extra step and extra software to procure. If there's an excellent native Linux driver for your wireless NIC, that's preferable. If not, ndiswrapper lets you do most of what you need wireless for. ALWAYS back up your wireless NIC's Windows driver CD to a directory where that directory itself will be backed up, so if years from now you need to reinstall the Windows driver with ndiswrapper, you can find it. In my opinion, while learning and experimenting with wireless LAN, in other words, while you're a newbie, it's probably best to use ndiswrapper unless your distribution detects your wireless NIC and automatically installs the native driver. Once you're an expert, you can install the Linux native driver. If one doesn't exist, it probably will in a year. Ndiswrapper is more than a concept, it's an actual Linux command once its package is loaded. Here are some examples, all best done as root: #### Install Windows driver file mywirelessNIC.inf in your Linux system CAUTION: If your distribution has a native driver that doesn't work well, ndiswrapper is your escape route. HOWEVER, in order to deploy an ndiswrapper implementation, you need to completely prevent the native driver from loading. This is typically done by putting this string, assuming the driver to be blocked is the rt2570 driver: blacklist rt2570That string goes into the tree searched for drivers to load. In Mandriva Linux it's often put in a file called /etc/modprobe.d/blacklist. Your Linux friends might advise you not to use ndiswrapper. There's a lot of Linux chauvinism invested in the use of Linux native drivers. But my experience tells me that ndiswrapper works and it doesn't take a guru to install. |
Not finding a decent native Linux driver for my wireless NIC, I used ndiswrapper plus the Windows driver off the wireless NIC's installation CD. |
iwlist wlan0 scanningIf there's one or more access points in range, and if your driver is installed correctly, you'll get a list of access points, complete with their essid and other information. Here's an example, obviously performed while writing in a MacDonalds with a Wi-Fi access point:
iwconfig wlan0 scanning |
| Associate | The act of connecting the wireless nic of your computer with
an access point. A nic can associate with only one access point at a
time. With unencrypted access points, association often happens
automatically. If it doesn't, you can usually force association to an
unencrypted access point with the following series of commands
(assuming the wireless NIC's device name is wlan0):iwconfig wlan0 essid anyIn the preceding, any is a reserved word meaning any essid. This is very useful in selecting a non-encrypted access point. Occasionally you'll actually have to name a specific Essid, like the following: iwconfig wlan0 essid <access point's essid>The iwconfig command will tell you whether you're associated or not. If you're associated, and if there are no oddball problems, and if your networking is correct (IP address, netmask, gateway and DNS server, whether hardcoded or served up by DHCP), then you'll probably be able to browse the Internet. |
| Encryption | Data that's been changed so that a third party intercepting the data can't decipher it. In the case of wireless, it's changing the data sent via the radio waves. | I wouldn't be caught dead not having encryption on my business wireless LAN. | ||||||||||||||||||||||||||
| WEP | Wired Equivalent Privacy,
the oldest of commonly used Wi-Fi encryption methods. WEP keeps the kid
next door out of your network, but the blackhat parked outside your
house can easily crack it, either in its 64 bit or 128 bit
personalities. WEP is better than nothing, but you can do better than
WEP. WEP works by creating four hexidecimal keys, each of which is created from a text password. A user gains access by sending in one of those keys, and the key number (1 through 4) of that key. If it's right, the user gets in. On the Access Point end, you implement WEP by choosing it in the access point's configuration webapp, choosing a password which is then converted to four hexidecimal keys. On the wireless NIC end, theoretically you can implement it by inputting the text password. I have not successfully done that. Theoretically you can also put one or more keys in the device's "up" script, but in my experience that works intermittently at best. My best success came from creating a script using iwconfig commands:
|
Yes, WEP can keep out the kid next door, but anyone really wanting in could defeat WEP. | ||||||||||||||||||||||||||
| WPA | Wi-Fi Protected Access.
After WEP's insecurities became apparent, WPA was specified. WPA is a
framework in which other security measures, such as TKIP, EAP, AES,
Radius, and many more. WPA comes in two versions: WPA and WPA2. My Linksys WRT54GL access point gives the following choices:
On Linux clients, connection to WPA access points is handled by the wpa_supplicant application, which is configured from /etc/wpa_supplicant.conf. |
After learning of the security problems of WEP, I switched my business to WPA wireless security. | ||||||||||||||||||||||||||
| TKIP | Temporal Key Integrity Protocol. Accroding to my research, this is the most commonly used WPA algorithm for those without RADIUS servers. According to the Linux WPA/WPA2/IEEE 802.1X Supplicant website (http://hostap.epitest.fi/wpa_supplicant/), this is a replacement for WEP, I guess it can be included within the WPA framework. My research suggests that TKIP is much more secure than WEP. | I've configured my WPA to use the TKIP algorithm. | ||||||||||||||||||||||||||
| AES | Advanced Encryption Standard. Another WPA algorithm and replacement for WEP. My research indicates that AES isn't as widely implemented, thus making TKIP a safer choice, at least in 2006. My research suggests that AES is much more secure than WEP. | Because I have all modern equipment compatible with AES, I've managed to convert my WPA protected network to the AES WPA algorithm. | ||||||||||||||||||||||||||
| RADIUS | Remote Authentication Dial In User Service.
It's used for many purposes, not just wireless. It authenticates users,
and is more secure than WPA plus TKIP or AES. However, it requires a
RADIUS server be available 24/7/365, or the wireless network will be
unavilable. Linux, or at least Mandriva 2006, comes with FreeRADIUS, a GPL'd RADIUS server, so you can deploy RADIUS on Linux. |
Now that our business has grown, I'm looking into deploying a RADIUS server and switching to WPA2 Enterprise. | ||||||||||||||||||||||||||
| wpa_supplicant | This is how Linux does WPA. The 802.1X protocols define a supplicant
as a computer seeking authentication from another computer on the LAN
(this is an oversimplification, but it's good enough for this article).
Linux has the wpa_supplicant project, which compiles to a service (wpa_supplicant), a GUI front end (wpa_gui), and a text front end (wpa_cli). It also contains a utility to convert an ESSID and text passphrase to a hex string suitable as a key. wpa_supplicant is configured with file /etc/wpa_supplicant.conf. This file contains passphrases and hex keys, so its permissions must be set to 600 (read and write by user, no access by group or other). The following is the code I put at the bottom of the default wpa_supplicant.conf to enable WPA (not WPA2) with TKIP:
In the preceding, I created the psk by putting the ssid (essid) and passphrase into wpa_passpharse. Obviously, I changed it before putting it on the net. The wpa_supplicant command must be run a certain way to successfully attach to a WPA encrypted access point. Here's the script I used:
Here's the meaning of the various arguments:
The preceding worked for me -- your mileage may vary. |
iwlist wlan0 scanningThe preceding command assumes the wireless device name is wlan0. If it's ath0 or rausb0 or something else, just substitute. When the preceding command lists nearby access points, you know the driver is installed, and you can begin trying to associate.
|
CAUTION
On wireless NICS where you must take the additional step of installing firmware (Broadcom BCM4311, for instance), you can sometimes get an access point listing even though the firmware isn't installed. However, the driver installation is incomplete, and association will be either impossible or highly intermittent under those circumstances. If you can get a list but association and networking are absent or rarely happen, make sure you didn't forget the firmware step. |
| DEVICE=wlan0 BOOTPROTO=dhcp ONBOOT=yes |
ping troubleshooters.comIf the DNS resolves and the pings occur, that's it -- all three layers are fine. If not, I try to associate.
iwconfig wlan0 mode ManagedThe ifup command will try to get a DHCP connection (because of the BOOTPROTO=dhcp line in the config file). If it succeeds, you're all done. If not, you might be associated but have network problems (wrong IP address or whatever -- basically bad DHCP if you're using DHCP).
iwconfig wlan0 essid any
ifdown wlan0
ifup wlan0
[slitt@mylap 200612]$ /sbin/iwconfig wlan0 |
[slitt@mylap 200612]$ /sbin/iwconfig wlan0 |
![]() |
| Linksys WTR54G Personal Router |
| dhcp-client | Tools for obtaining an IP address, subnet mask, gateway and DNS server address from a DHCP server. |
| wireless-tools | iwconfig and several other programs to query and modify the state of a wireless device. |
| ndiswrapper | An adapter program to adapt your wireless NIC's windows driver to Linux, thus being able to use your Windows driver in cases where the native Linux driver is defective or nonexistent. |
| wpa_supplicant | A program for authenticating against access points with wpa encryption, together with tools like wpa_cli, wpa_gui and wpa_passphrase, to help you configure and diagnose. |
ifdown wlan0To restart your wired ethernet (eth0), do this:
ifup wlan0
ifdown eth0
ifup eth0
DEVICE=wlan0 |
Name the device |
#!/bin/bash |
|
/usr/share/doc/wireless-tools-28Of all the documents there, one's especially a must-read: HOTPLUG.txt. This document explains lots of the conundrums you encounter when using wireless.
| DEVICE= | eth0, eth1, wlan0, ath0, bcm0, rausb0 etc. | The name of the device. This should be the first line in the config file (ifcfg-whatever). If it's not the first, there's a chance that the ifdown or ifup commands could error out. |
| BOOTPROTO= | static, dhcp or none | static means you'll be defining the device's IP address, netmask, gateway and DNS server. dhcp means those elements will be gotten from a dhcp server. none means disable the device. |
| IPADDR= | 192.168.100.44 (for instance) | Defines the IP address of the device. If BOOTPROTO=dhcp, this config line is ignored. That's a good thing, because if you set up your ifcfg files right, you can switch from hard to dhcp by changing nothing but the BOOTPROTO= line. Be aware that many distros' network config tools blow this line off if BOOTPROTO=dhcp. |
| NETMASK= | 255.255.255.0 (for instance) | The netmask. You should have already learned this, if not look for other documentation. |
| BROADCAST= | 192.168.100.255 (for instance) | This defines the subnet's broadcast address -- an address at
which every NIC on the subnet will receive the data packets. Remember,
the subnet is the IP address ANDed with the netmask. For instance192.168.100.44 10.4.8.200 Once you know the subnet, the typical broadcast address is obtained by substituting 255's for the trailing zeros. |
| GATEWAY= | 192.168.100.88 | This line defines the "escape route" from your subnet -- how
you get out to the Internet, or to another network. In a home or small
office environment, this is typically the IP address of the Internet
router, cablemodem, or IPCop box. If you encounter a symptom where you can ping other machines on your subnet (local area network), but can't ping anything on the Internet, check that you can ping your "escape route", and if you can, check that this line exists and is correct. |
| ONBOOT= | no or yes | If yes, the interface will be up on boot. If no, it will be down on boot, and you'll need to manually put it up with ifup or by restarting the whole network. |
| USERCTL= | no or yes | On a desktop, I keep this as "yes" so I can use ifdown and ifup on the interface without needing to become root. On a server with lots of users, obviously you don't want individual users messing with the network connection. |
| PEERDNS= | no or yes | If yes, the DNS server for this computer serves out DNS for the computers on its LAN. Let's say you have a wired LAN in your office, and another wired LAN for your kids, but those two LANs (which are all on the same subnet) communicate over wireless because you don't want to string cat 5 across your living room ceiling. You can have one of the kids' computers get its DNS via DHCP, and then serve that DNS out to the rest. I'm not sure I know why you'd want to do that, but... |
| PEERYP= | no or yes | Same concept, but for YP (NIS). Given the security problems of NIS, I think no, which is the default, would be an excellent answer. |
| PEERNTPD= | no or yes | Same concept, but for a time server. |
| HWADDR= | 00:0f:b0:48:10:1f (for instance) | The mac address of the device. I'm not sure why this is necessary or desireable -- networking works without it, but here it is. Maybe it's a security thang. |
| METRIC= | 10 (for instance) | |
| DHCP_CLIENT= | dhclient, | |
| NEEDHOSTNAME= | no or yes | Things can get ugly fast if you say yes. On Mandrake, this can prevent you from bringing up the interface. What it's supposed to do is enable your computer to get its hostname from the DHCP server, instead of having it hard coded. Why in the world would you want an everchanging hostname? I hear some ISPs require it, but, oh, it can get ugly. |
| MII_NOT_SUPPORTED= | no or yes | |
bcm43xx-fwcutter -w /lib/firmware mydevice.sysYour distro might include a bcm43xx-fwcutter package. I'd advise getting the latest source and compiling. The bcm43xx-fwcutter that came with my Mandriva package did not work with a modern and crucial driver, but the newest version, downloaded and compiled, did.
|
INFORMATION
With most wireless devices, you won't need to extract firmware, Broadcom 43xx hardware being one of the exceptions. Often you also won't need cabextract, because your driver set is not packaged in a .exe archive. |
su - |
You must be root to do most of this stuff |
cd <directory with drivers> |
Makes the rest of the commands easier |
cabextract mydriver.exe |
Takes an .exe archive and extracts its contents, thereby making driver files available. Necessary only if your drivers are packaged in a .exe file. If cabextract reports no cabinets, try the unzip program. |
bcm43xx-fwcutter -w /lib/firmware mydriver.sys |
Extracts firmware files from mydriver.sys and places them in /lib/firmware. This is necesary only on drivers requiring firmware extraction. For most drivers, you can skip this step. |
ndiswrapper -i drivername.inf |
Places a copy of several driver files in the /etc/ndiswrapper tree. |
ndiswrapper -l |
Should list the windows driver associated with drivername.inf. Should say that both the driver and the hardware are installed. If not, there's a problem. |
ndiswrapper -m |
Places a line in either /etc/modprobe.conf or
/etc/modprobe.d/ndiswrapper or both in order to restart the driver at
boot time. The line should look something like this:alias wlan0 ndiswrapper |
depmod -a |
This regroups all modules so that all dependencies are accurate. This is necessary before installing a new module. |
tail -fn0 /var/log/messages |
This realtime log prints all new log messages. Do it in a different terminal so you can see the results of the next command. |
modprobe ndiswrapper |
This installs the driver. If all goes well, you should see
something to that effect in the realtime log. The realtime log might
complain about not finding a link. That's OK, it simply means you
haven't associated with an access point, which of course is to be
expected. Any other errors should be investigated, as should a lack of
messages saying what encryption modes wlan0 supports. One insideous problem crops up often -- an installed native Linux driver stomping on your ndiswrapper driver. This can have intermittent symptoms or reproducible symptoms, and can be very mysterious. If you can get the name of the native Linux driver you can disable it with a blacklist command (see troubleshooting section) |
iwlist wlan0 scanningIf the driver's installed correctly and there's at least one nearby functional access point, the preceding command will list access points. If it cannot list access points and you know there's a functional one nearby, your driver isn't installed correctly. If the command does list access points, your driver is probably installed properly, although I saw one case where it could list but the driver was installed wrong, specifically the Broadcom firmware was not installed.
ping troubleshooters.comIf the preceding command resolves troubleshooters.com to an IP address and successfully pings it, you've associated and all network parameters are correct, and you're done. In most cases you won't get that lucky right after installation.
iwconfig wlan0 mode ManagedYou can verify that you got an IP address with this command:
iwconfig wlan0 essid any
ifdown wlan0
ifup wlan0
ifconfig wlan0Notice the preceding command is ifconfig, not iwconfig.
iwconfig wlan0 mode ManagedIf the preceding didn't work, try rebooting and waiting a few minutes. Remember, you go through all this hassle only after driver installation. Once you've associated with an unencrypted access point, your computer should be able to automatically associate with any properly configured unencrypted access point.
iwconfig wlan0 essid <essid of access point as listed by iwlist>
ifdown wlan0
ifup wlan0
ping troubleshooters.comIf the preceding resolves troubleshooters.com to an IP address and pings that IP address successfully, you're done. Otherwise, you need to see where you're falling down on the job.
ifconfig wlan0
ping 192.168.1.255or
ping -b 192.168.1.255If you get any addresses other than yours, you're connecting to the access point's LAN, which is a good thing.
BOOTPROTO=staticAnother thing to look for is that the LAN encompassing the access point might have multiple DHCP servers, which is usually not a good idea. For instance, the LAN might have already had a DHCP server, and then the access point was added, and the access point's DHCP server was enabled.
IPADDR=192.168.1.15
GATEWAY=192.168.1.200
| stopem.sh | showem.sh | |||
#### KILL ALL EMAIL SERVERS |
ps ax | grep fetchmail | cut -b -76 |
You could shut them off with the S?? files in the proper boot level, or on some distros with the chkconfig
program. That is the safest way to do it, assuming you do it correctly.
The trouble is, there may come times when you want to alternate between
having them active and having them shut down. So what I did was list
the services that I felt were dangerous, making a stopem.sh script to shut them down. I then made showem.sh to verify that they were really shut down. You might choose to make these scripts very differently. You could make a perl script to read a list of files in /etc/init.d/ with arguments like "stop", "start" and "list". Such a script would be much easier to add and subtract services, keep them in sync, etc. Me, I just did something quick and dirty. |
#### SLITT: STOP SERVERS FOR SECURITY |
tail -n0 -f /var/log/messagesI look for changes after every command I perform. If relevent stuff scroll