Saturday, July 29, 2006

Waseem comes to the Linux/Wireless rescue

Waseem just helped me configure my wireless on my Compaq laptop (that is now running Ubuntu Dapper Drake). Any network that is publicly accessible will be viewable (if, of course the wireless card/network is enabled) in the drop-down box in Network Setting --> wireless --> Properties. It will not automatically connect to any network it senses. Here is some command line wizardry to help configure wireless settings:
  1. Need to know name of network interface -- type in iwconfig to find that out (usually its name is eth1 or the like)
  2. Then you want to scan the nearby places to see what networks you can use -- iwlist < network > scan returns a list of potentially usable networks... it also tells you if you need an encyption key (password) to access the network
  3. To tell your network card that you want to use a certain network -- iwconfig <network> essid <name>
  4. Now to tell it the password (if neccesssary) -- iwconfig <network> key <password> (Waseem isn't sure if this is the same accross networks... some require hex keys, some require ASCII keys, etc.)
  5. Now you need to tell Linux "I want to start using this connection" -- ifconfig <network> up (of course, to turn it off, the same command with down instead of up)
  6. To get an IP address using DHCP -- dhclient < network >
  7. If you're not using DHCP, you need to tell ifconfig about the IP address request (Waseem isn't sure how to do this)
Command summary:
  • iwconfig -- configure a wireless network interface
  • ifconfig -- configure a network interface
  • iwlist -- get more detailed information from a wireless interface
Edit: As I've gotten to school, I've noticed a problem: for some reason my comp gets confused when there's multiple wireless networks with the same name; or, rather, one wireless network with multiple routers broadcasting the same network. I need to specify the router's MAC address if I want to connect. Here are the commands:
  1. Tell your interface that you want to roam on a network: iwconfig <network> mode Managed
  2. Specify the connection point: iwconfig <network> ap <MAC address>
  3. From here it's the same as any wireless connection: ifconfig <network> up
  4. Request an IP address: dhclient <network>

No comments: