From  CertCities.com
Column
Inside the Kernal
Going Wireless, Part Two
In part one, we looked at the encryption technology used with wireless networking. In this part, we'll look at the actual configuration on the Linux machine.

by Emmett Dulaney

7/14/2010 -- In part one, we looked at the encryption technology used with wireless networking. In this part, we'll look at the actual configuration on the Linux machine.

The system on your Linux laptop should recognize the wireless network card and load the appropriate driver for the card. Linux treats the wireless network card like another Ethernet device and assigns it a device name such as eth0 or eth1. If you already have an Ethernet card in the laptop, that card gets the eth0 device name and the wireless PC Card becomes the eth1 device.

You do have to configure certain parameters to enable the wireless network card to communicate with the wireless access point. For example, you have to specify the wireless network name assigned to the access point, and the encryption settings must match those on the access point. You can usually configure everything using a graphical network configuration tool that's available for your Linux distribution -- just select the Wireless Network option and fill in the requested information.

For example, in Fedora, choose System, then Preferences, and finally Network Connections from the GNOME desktop. Then select the Wireless tab and click Add to add a new wireless device (see Figure One). You can then select the wireless device and get to a window where you can configure the wireless connection. In particular, set the Mode to Infrastructure, specify the name of the wireless network (the one you want to connect to), and set the encryption key, if any. You can set the option for getting the IP address to DHCP (the protocol for obtaining network configuration parameters, including IP addresses from a server on the network). When you're finished and return to the Network Configuration tool's main window, select the new wireless device and click the Activate button. If all goes well, the wireless network will be up and running after a few moments.

Tunnel
[Click on image for larger view.]
Figure 1.Configure a new wireless connection in Fedora.

NOTE: In Fedora, the Network Configuration tool saves your wireless network settings in a text file. The name of the text file depends on the wireless network device name. If the wireless network device name is eth0, the configuration is stored in the text file /etc/sysconfig/network-scripts/ifcfg-eth0. If the wireless device name is eth1, the file is /etc/sysconfig/network-scripts/ifcfg-eth1. This configuration file contains various settings for the wireless network card. The table explains the meaning of the settings. Here is a slightly edited version of the /etc/sysconfig/network-scripts/ifcfg-eth1 file from my laptop PC running Fedora:


IPV6INIT=no
USERCTL=no
PEERDNS=yes
TYPE=Wireless
DEVICE=eth1
HWADDR=00:02:2d:8c:f9:c4
BOOTPROTO=dhcp
ONBOOT=no
DHCP_HOSTNAME=
NAME=
ESSID='HOME'
CHANNEL=6
MODE=Managed
RATE=auto

Table: Settings in Configuration File for a Wireless Ethernet Network Interface in Fedora


This Parameter

Means the Following

BOOTPROTO

The name of the protocol to use to get the IP address for the interface. The protocol used is either dhcp or bootp for an Ethernet interface.

CHANNEL

Channel number (between 1 and 14 in United States and Canada). Must be the same as that set for the wireless access point. In managed mode, you don't need to specify the channel.

DEVICE

The device name for the wireless Ethernet network interface (eth0 for the first interface, eth1 for the second, and so on).

ESSID

Extended Service Set (ESS) Identifier (ID), also known as the wireless network name. It is case-sensitive and must be the same as the name specified for the wireless access point. Provide the name within single quotes (for example, ‘HOME').

HWADDR

The hardware address (also called the MAC address) of the wireless network card (six pairs of colon-separated hexadecimal numbers; for example, 00:02:2d:8c:f9:c4). The wireless card's device driver automatically detects this address.

IPV6INIT

When set to yes, this parameter initializes IPv6 configuration for the wireless interface. Set it to no if you're not using IPv6.

MODE

The mode of operation of the wireless network card. Set to Managed for a typical network that connects through a wireless access point.

NAME

A nickname for your wireless network. If you don't specify it, the host name is used as the nickname.

ONBOOT

Set to yes to activate the wireless interface at boot time; otherwise, set to no.

PEERDNS

Set to yes to enable the interface to modify your system's /etc/resolv.conf file to use the DNS servers obtained from the DHCP server (the same server that provides the IP address for the interface). If you set this parameter to no, the /etc/resolv.conf file is left unchanged.

RATE

Bit rate for the wireless connection (set to one of the following options: 1M, 2M, 5.5M, 11M, or auto). Set to auto to use the maximum possible transmission rate.

TYPE

Set to Wireless for wireless network interface.

USERCTL

When set to yes, a user who isn't logged in as root can control the device. Set it to no so that only root can control the device.

In Fedora, the encryption key is stored separately. For a wireless Ethernet card whose device name is eth1, the encryption key is stored in the /etc/sysconfig/network-scripts/keys-eth1 file. For example, here is what this file contains for my example:

KEY=1fdf3fdefe
NOTE: The key has 10 hexadecimal digits for a 40-bit key (for example, 1fdf-3fde-fe) or 26 hexadecimal digits for a 104-bit key. The keys are 64-bit and 128-bit, respectively, but the encryption algorithm automatically generates 24 bits of the key, so you need to specify only the remaining bits. The longer the key, the more secure the encryption.

If you ever manually edit the parameters in the wireless Ethernet configuration file in Fedora, type the following command to reactivate the wireless network interface after editing the configuration file:


/etc/init.d/network rest
In SUSE Linux, use YaST to configure the wireless network. SUSE stores the wireless configuration parameters in a file whose name begins with ifcfg-wlan, followed by a number such as 0 or 1, depending on the sequence number of the wireless network interface. The configuration file is stored in the /etc/sysconfig/network directory. Here's a typical list of wireless configuration parameters from a configuration file in SUSE Linux:


WIRELESS_MODE='Managed'
WIRELESS_ESSID='HOME'
WIRELESS_NICK=''
WIRELESS_RATE='auto'
WIRELESS_AUTH_MODE='open'
WIRELESS_KEY_0='0123-4567-8
TIP: To check the status of the wireless network interface, type the following command:

iwconfig
Here's a typical output from a Fedora laptop with a wireless Ethernet PC card. (The output should be similar in other Linux distributions.)


lo no wireless extensions.
eth0 no wireless extensions.
sit0 no wireless extensions.
eth1 IEEE 802.11b ESSID:”HOME” Nickname:”localhost.localdomain”
Mode:Managed Frequency:2.437 GHz Access Point: 00:30:AB:06:E2:5D
Bit Rate=11 Mb/s Sensitivity:1/3
Retry limit:4 RTS thr:off Fragment thr:off
Encryption key:1FDF-3FDE-FE Security mode:open
Power Management:off
Link Quality=51/92 Signal level=-40 dBm Noise level=-91 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:27
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
Here, the eth1 interface refers to the wireless network card. I edited the encryption key and some other parameters to hide those details, but the sample output shows you what you'd typically see when the wireless link is working.


Emmett Dulaney is the author of several books on Linux, Unix and certification. He can be reached at .

 

 

top

Copyright 2000-2009, 101communications LLC. See our Privacy Policy.
For more information, e-mail .