wiki:WirelessTools

Wireless Tools

Wireless Tools is a set of programs that interface with /proc/net/wireless and /sys to manage wireless cards. The programs are relatively generic, but some hardware does not have complete functionality, especially with regard to security standards.

There are two types of wireless security: encryption and authentication. The original wireless security mechanism was known as WEP (see http://en.wikipedia.org/wiki/Wired_Equivalent_Privacy). This mechanism has some security flaws, but is better than no encryption. The most recent wireless security standard is IEEE 802.11i or WPA (see http://en.wikipedia.org/wiki/Wi-Fi_Protected_Access).

Drivers

Madwifi

This software contains a Linux kernel driver for Atheros-based Wireless LAN devices. The driver supports station, AP, adhoc, and monitor modes of operation. The Atheros driver depends on a device-independent implementation of the 802.11 protocols that originated in the BSD community (NetBSD in particular).

Before starting to build this driver, ensure you have the following kernel configuration enabled:

  • Wireless Extensions enabled (Device Drivers -> Network device support -> Wireless LAN (non-hamradio) -> Wireless LAN drivers (non-hamradio) & Wireless Extensions
  • Cryptographic options -> Cryptographic API

Build the driver with the following commands, substituting the location for your kernel sources in the KERNELPATH parameter:

make KERNELPATH=/usr/src/linux/linux-2.6.16

Now as the root user:

make install

You can check the proper installation with modprobe ath_pci. The driver creates two devices: wifi0 and ath0. This driver uses wifi%d only as a placeholder for the phyical device, and will create one wifi device for each wireless NIC in the system. These wifi devices will reject ifconfig and iwconfig commands. The wifi interface indicates the existance of a physical Madwifi device, but is not of any functional interest other than as a target for VAP (Virtual Access Point) creation via wlanconfig.

Use ifconfig -a to see all network devices. Use iwconfig ath0 to see the wireless configuration of the first Atheros-based wireless device.

You can now proceed to use Wireless Tools to configure the interface and then use ifconfig, ip, or dhcpcd to complete the configuration. For instance, use iwlist ath0 scan to see what networks are available.

Tools

wpa_supplicant

wpa_supplicant allows the use of the 802.11i wireless encription standard. This standard is commonly known as WPA. wpa_supplicant is a generic application that works with multiple drivers.

To build this application, a .config file must be created manually to specify configuration options. A commented example is included in the package as defconfig. This file specifies a lot of EAP (Extended Authentication Protocol http://en.wikipedia.org/wiki/Extensible_Authentication_Protocol) options that are usually not necessary in most small implementations. An example of a simple .config file is:

cat > .config << "EOF"
CONFIG_DRIVER_MADWIFI=y
CFLAGS += -I/usr/src/madwifi/madwifi-ng-r1486-20060329/
CONFIG_DRIVER_WEXT=y
CONFIG_CTRL_IFACE=y
CONFIG_BACKEND=file
EOF

Now compile the programs:

make

Finally, install the programs as the root user:

install -m 755 wpa_cli wpa_supplicant wpa_passphrase /sbin
install -m 644 doc/docbook/*8 /usr/man/man8
install -m 644 doc/docbook/wpa_supplicant.conf.5 /usr/man/man5

Configuration

wpa_supplicant runs as a daemon. An example configuration file would be:

cat > /etc/wpa_supplicant.conf << "EOF"
ctrl_interface=/var/run/wpa_supplicant

network={
  ssid="BLFS"
  scan_ssid=1
  key_mgmt=WPA-PSK
  psk="secret-key"
}
EOF

The wireless link, encrypted by WPA can now be established with:

wpa_supplicant -Bw -c/etc/wpa_supplicant.conf -iwlan0

kwifimanager

This application is built in the kdenetwork package (http://www.linuxfromscratch.org/blfs/view/cvs/kde/kdenetwork.html).

Use

Startup Script

Install this service:

install -m754 wireless /etc/sysconfig/network-devices/services &&
install -d -m755 /etc/sysconfig/network-devices/ssid

Example Device Configuration:

install -d -m755 /etc/sysconfig/network-devices/ifconfig.ath0 &&
cat > /etc/sysconfig/network-devices/ifconfig.ath0/01-wireless << "EOF"
ONBOOT=yes
SERVICE=wireless
ESSID=scan
TYPE=wep
EOF

After that file is created, create 02-ipv4 containing the IP configuration information. The numbers allow the scripts to be run in the correct order.

Example WEP SSID Configuration:

cat > /etc/sysconfig/network-devices/ssid/[ssid] << "EOF"
MODE=Managed
KEY1=""
KEY2=""
KEY3=""
KEY4=""
EOF

If your network is setup so that the ssid is not broadcast, create the file using the address of your access point as the filename. eg. "00:00:00:00:00:00" If you did this you must also add ESSID=[ssid] to the configuration.

Udev Rules

Up
Top

Last modified 14 years ago Last modified on 12/22/2008 02:42:56 AM
Note: See TracWiki for help on using the wiki.