netoops blog

How to Set up a Wireless Network in Linux

A walkthrough of wireless (IEEE 802.11 also known as WiFi) home networking with Linux.
Steps:
Most wireless adapters are not designed for use in Linux and depend on non-free proprietary drivers and firmware which inevitably leads to problems. There has been a significant effort by the Linux community and some manufacturers to improve this situation and most recently released Linux distributions will support a significant number of wireless cards.
The Ubuntu Wifi Documentation is a good, and frequently updated, guide to what cards are supported on recent Ubuntu versions (recent versions of other distributions should have similar levels of support). It also lists cards which have Free Software drivers - for users who have a philosophical (or other) objection to closed-source drivers in their kernel.

Set up your new router

  1. Plug your router into your internet socket if you want to share your internet.
  2. Plug your router into your PC with an ethernet cable.
  3. Go to your browser and type in the address "192.168.0.1" or whichever address the router's web server is listening.
  4. Enter your username and password from your router (often "admin" and "admin") then your internet service provider.
  5. Enable wireless and set your encryption (WEP or WPA) and type a memorable passkey.

Detecting your wireless adapter

  1. Your wireless adapter should be detected automatically by your distribution and should be available in your distribution's network config tools (as of early 2012 most distributions use NetworkManager). Only if the card is *not* detected, go through the following troubleshooting steps:
  2. Type iwconfig into the terminal to see what wireless network interfaces have been detected.
  3. Type sudo lshw (or lspci or lsusb) to list hardware and get details on the chipset that your card uses. Try searching the Internet or posting in the help forums for your Linux distribution to see if there's support for the chipset your card uses.
  4. If you're using Linux Mint, try MintWifi.
  5. You may need to use ndiswrapper and your Windows driver, look up the ndiswrapper documentation or ask for help in the forums/mailing lists for your distribution.

Connecting to a network

  1. If your distribution is using NetworkManager there should be an icon near the clock which you can click on.
  2. Choose your "Encryption" (WEP or WPA) and enter your passkey.
  3. If your distribution is not using NetworkManager you may need to look up its documentation or ask for help in it its forums.

Wireless Network in Linux Via the Command Line

A walkthrough of wireless (IEEE 802.11 also known as WiFi) home networking with Linux.

Steps

Note if buying a router - all routers are compatible with Linux. It is wireless adapters that have varying levels of Linux compatibility. If your router isn't new, then turn it on and skip to "Detecting your wireless adapter" (below).
  1. Set up your new router
    1. Plug your router into your internet socket if you want to share your internet
    2. Plug your router into your PC with an Ethernet cable
    3. Go to your browser and type in the address "192.168.0.1"
    4. Enter your username and password from your router (often "admin" and "admin") then your internet service provider
    5. Enable wireless and set your encryption (WEP or WPA) and type a memorable passkey
  2. Detecting your wireless adapter
Your wireless adapter should be detected automatically by your distribution.
  1. Type ifconfig into the terminal to determine whether it's been detected.
      • lshw -C network
lshw -C network
  1. Use ndiswrapper, if needed, and your Windows driver.
  2. Connect to a network
    • sudo ifconfig down
    • sudo dhclient -r
    • sudo ifconfig up
    • sudo iwconfig essid "ESSID_IN_QUOTES"
    • sudo iwconfig mode Managed
    • sudo dhclient
  3. Connecting to a network on boot  
    1. Add those commands to /etc/rc.local
      • Make /etc/rc.local executable with chmod

0 Comments:

Followers