Wireless/Configuration

This is a step-by-step of wireless networking (aka WiFi or WLAN).

Networking section
Networking section can be configured straightforwardly:

Driver
You often encounter problems on drivers. For the status of your chip, see Linux wireless which is very useful, the main source of Linux wireless documentation. See also Category:Wireless.

Drivers are classifed into 4 by their origin:
 * 1) Kernel itself
 * 2) Chip manufacturer
 * 3) Open source package
 * 4) Window's driver + ndiswrapper

Furthermore, you may need a firmware. All will be explained.

First, even if your driver is not in kernel, turn on the following flag:

Some drivers can simply be emerged. For example, is for WiFi adapters based on Atheros chips.

If you need to use Windows' driver, use the translator ndiswrapper.

If a firmware is necessary, do. contains many firmwares.

Drivers from kernel
WiFi development is very active, so if you have troubles, try the latest kernel. Or, you can install "compat-wireless" driver; it's in fact the kernel drivers, but distributed seperately so that you don't have to upgrade the kernel each time. Its ebuilds are available at "pentoo" overlay.

Compat-wireless installation requires a bit work, so read the README (and emerge log) carefully.

It's also good to know that your device may be supported by staging drivers in the kernel, which should be considered "experimental". They become available by enabling a kernel configuration option found at the end of "drivers" section. Compat-wireless contains staging drivers, too.

Cryptography
The following should be on automatically by dependencies, but if not, turn it on:

Checking if the driver loaded
If your driver is configured correctly and supports your device, it'll appear as. Or if your driver is 3rd-party, it may be called otherwise, e.g.  or  :

root /usr/src/linux $ ifconfig -a dummy0   Link encap:Ethernet  HWaddr 2a:5b:e3:fc:28:79 ... lo       Link encap:Local Loopback ... wlan0    Link encap:Ethernet  HWaddr 01:23:45:ab:cd:ef BROADCAST MULTICAST MTU:1500  Metric:1 RX packets:2725 errors:0 dropped:0 overruns:0 frame:0 TX packets:2302 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:2579360 (2.4 MiB) TX bytes:304309 (297.1 KiB)

Or, if is installed, you can use :

iwconfig sample output

Now make the symlink in : $ cd /etc/init.d $ ln -s net.lo net.wlan0 Or in general $ ln -s net.lo net.INTERFACE

Gentoo configuration
Gentoo network configuration is done in. It's documented in the Gentoo handbook "Gentoo network configuration" part and the example file,.

It may help to set in, and

See also.

Softwares
Before you edit, you have to install some packages for wireless. You can use Wicd or NetworkManager for easy configuration of your networks, including wireless. In this section, more low-level configuration is explained.

You need a dedicated software for WiFi. We recommend. Older alternative is, which does not support WPA nor WPA2. If unsure, use. (They're wireless part backends of wicd and NetworkManager.) If you want a GUI, build with  USE flag.

Probably you also need dhcp client e.g. dhcpcd. Candidates are listed in the Gentoo handbook Part 4, Chap 3 and (see above).

Required information
To configure your WLAN device, you need to know the following information about your access point:


 * ESSID: The wireless access point's ID. You can get the list of ESSID by commands as explained below.


 * Encryption: None, WEP, WPA or others.
 * Password (also known as "key" or "passphrase"): If using any encryption.

WPA supplicant
In this section, we describe configuration with wpa_supplicant.

Basics of wpa_supplicant
Most of configuration is done in the file. An exhaustive example file is found at. Basic instruction is well documented in Handbook's Wireless chapter. Here we merely add some tips.

First let's see.

Checking tools
Now you can run wpa_supplicant by. You can check if your is correctly configured with running wpa_supplicant at hand.

Almost all you have to do is: Scan and list the access points $ wpa_cli scan $ wpa_cli scan_results How's your network? $ wpa_cli list_networks Selected interface 'wlan0' network id / ssid / bssid / flags 0     any   [CURRENT] [CURRENT] means your adapter is connected to that access point. $ wpa_cli status Selected interface 'wlan0' bssid= ssid= id=0 mode=station pairwise_cipher=CCMP group_cipher=CCMP key_mgmt=WPA2-PSK wpa_state=4WAY_HANDSHAKE This means password authentication is wrong. If it's correct, the last line will be wpa_state=COMPLETE If there's trouble, edit config, and restart $ /etc/init.d/net.wlan0 restart

wpa_supplicant.conf
The wpa_supplicant configuration file is a bit tricky. Double quotes are not optional but meaningful, so be sure to follow the examples.

Shortest example:

To use, the gui supplied by wpa_supplicant, you need:

Configuring /etc/conf.d/net
It's possible to run completely different network settings per ESSID connected to - check the file for details on how to achieve this. Also for more details look at the Gentoo Linux Networking Handbook.

A sample configuration file would look like this:

Some cards (or drivers) may need some time to complete the association with the access point:

Check the wireless section in for examples.

WEP Encryption
Up to 4 WEP keys can be specified for wireless networks. If your WEP key is in ASCII precede the key with 's:'.

If you WEP key is hexadecimal (containing only the digits 0-9 and letters A-F), leave out the 's:'.

If you do not want to use the script, you can create a bash file which executes all commands manually. Note that this will only work with unencrypted or WEP protected access points. For WPA encryption, you need to use wpa_supplicant.

Then make it executable:

Many people put this in local.start to have it initiated at boot.

Manual connection
To do all manually:

When you're done
To start the wireless connection at boot, do

Wireless + Ethernet connections
Some computers (mostly laptops) have both ethernet and wireless connectors. Double network connection is generally not needed. Bringing up the wireless network interface can be prevented by the preup function in (change wlan0 and eth0 as appropriate):

Wireless + Ethernet (ifplugd)
If the wired ethernet device is controlled via ifplugd we are able to use to fire up the wireless device as soon as the ethernet cord is removed and bring it down if the cord is plugged in again. Add the lines marked new below in :

Connection times out every time
According to ArchLinux Wiki, if the connection always times out, you should set the rate of the card to 5.5M:

In Gentoo, this can be automated at startup by adding the following line to your :

If this does not work for you, you could also try out 11M instead of 5.5M (see this link). You can also try to change from pid to simple rate control algorithm by replacing this line config.mk:

with:

Failed to initialize WEP
If your card cannot be initialized due to an -12 error and you have error lines saying something like this:

dmesg

Be sure you compiled Generic IEEE 802.11 Networking Stack into kernel (and not as a module!)

Net services like Apache don't start if both wlan0 and eth0 aren't started
If RC strict is set to "yes", then it will require that all net devices are started before any of the net services are started, you need to set this to "no":


 * for baselayout-1: open and change RC_NET_STRICT_CHECKING to "NO"
 * for baselayout-2: open and change rc_depend_strict to "NO"

SIOCSIFADDR: No such device
It's a kernel or driver problem. Chances are you're using NDISwrapper and it's not configured correctly.

In addition one could be missing the proper microcode. For the Intel 3945ABG this situation can be resolved with:

Prism based card behaving unreliably
Possibly cause by old buggy firmware. See here for a possible fix.

"Failed to initialize EAPOL state machines" error upon starting wpa_supplicant
Comment out the openssl lines in the wpa_supplicant config file (source: Gentoo forum):

Wireless extensions missing even though the device is a wireless adapter
Wireless-Extensions must be enabled in the kernel. must be reinstalled for the new kernel.