Welcome to the new location of Alien's Wiki, sharing a single dokuwiki install with the SlackDocs Wiki.
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Previous revisionNext revision | |||
— | slackware:madwifi [2006/03/18 00:36] – alien | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== Installing Madwifi on Slackware ===== | ||
+ | |||
+ | Wireless support in Slackware has much improved in the last few releases. The madwifi driver for Atheros based chipsets works fine with both the 2.4.x and the 2.6.x series of kernels. If you want unencrypted or WEP-protected connections, | ||
+ | If you need WPA encryption, read the [[# | ||
+ | |||
+ | This Wiki page explains how to install an appropriate Madwifi package on your Slackware computer, and gives directions on how to build your own. The focus lies on using the new madwifi code, also known as " | ||
+ | |||
+ | The madwifi driver is capable of creating so-called //virtual access points// or VAPs. This is being done on a base device called //wifi0// which will show up in your listings of ifconfig and iwconfig, and is not linked to the wireless extensions. You should never have to use this //wifi0// network device. The //user station// (a VAP of type " | ||
+ | |||
+ | |||
+ | ==== Obtaining slackware packages for madwifi ==== | ||
+ | |||
+ | Binary Slackware packages for the madwifi driver can be found at [[http:// | ||
+ | |||
+ | The old driver, also referred to as " | ||
+ | |||
+ | |||
+ | ==== Building a slackware package for madwifi from source ==== | ||
+ | |||
+ | You can build your own package for any kernel version that you are running, too. If you want to know if any of the downloadable packages matches your running kernel, you can check the version of your running kernel with the command < | ||
+ | |||
+ | * Start with downloading all the source files [[http:// | ||
+ | lftp -c "open http:// | ||
+ | </ | ||
+ | chmod +x madwifi.SlackBuild | ||
+ | ./ | ||
+ | </ | ||
+ | |||
+ | * If you want to build a package for another kernel that youve already installed on your computer, and you don't want to reboot into that kernel for building the madwifi package, you can run the script like this (the example builds a package for Linux kernel 2.6.13): < | ||
+ | KVER=2.6.13 ./ | ||
+ | </ | ||
+ | KVER=2.6.13 KSRC=~/ | ||
+ | </ | ||
+ | VERSION=< | ||
+ | </ | ||
+ | |||
+ | * Install the madwifi package with < | ||
+ | installpkg madwifi-VERSION_KERNELVERSION-i486-BUILDNR.tgz | ||
+ | </ | ||
+ | upgradepkg madwifi-VERSION_KERNELVERSION-i486-BUILDNR.tgz | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== Loading the kernel modules automatically ==== | ||
+ | |||
+ | |||
+ | You can use hotplug to load the madwifi driver automatically. There is nothing to configure; hotplug takes care of everything. If you do not use hotplug, you can add a line like this to ''/ | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== Network configuration ==== | ||
+ | |||
+ | |||
+ | === rc.wireless.conf === | ||
+ | |||
+ | |||
+ | If you have a Wireless Access Point that is broadcasting its station ID (the //ESSID//), and is not configured for encrypted traffic, then youre ready to go with the default configuration as it comes with Slackware. This kind of open wireless network is typical when | ||
+ | |||
+ | - you just took your Wireless Access Point out of the box you were sold it in, and didnt have time yet to configure it; | ||
+ | - you are at an airport/ | ||
+ | |||
+ | If you need to configure specific parameters to make the wireless card talk to your Access Point - for instance, the ESSID (in case the Access Point is hiding its station ID), or the channel, or a WEP key, etc) then you will need to edit the file < | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | You will notice that the content of ''/ | ||
+ | MAC_Address) | ||
+ | INFO=" | ||
+ | PARAMETER1=" | ||
+ | PARAMETER2=" | ||
+ | [more parameters] ....... | ||
+ | ;; | ||
+ | </ | ||
+ | |||
+ | * After the module is loaded and your ath0 interface is available, run ifconfig ath0 and get the MAC address of ath0. | ||
+ | |||
+ | * Edit / | ||
+ | *) | ||
+ | INFO=" | ||
+ | ESSID=" | ||
+ | ;; | ||
+ | </ | ||
+ | # *) | ||
+ | # | ||
+ | # | ||
+ | # ;; | ||
+ | </ | ||
+ | |||
+ | * Somewhere further below the lines you just commented out (at the very bottom of the file for instance), add a few lines that will apply to your card, like these: < | ||
+ | 00: | ||
+ | INFO=" | ||
+ | ESSID=" | ||
+ | KEY=" | ||
+ | ;; | ||
+ | </ | ||
+ | |||
+ | |||
+ | === rc.inet1.conf === | ||
+ | |||
+ | Slackware 10.2 understands network interfaces whose names do not start with eth. A network card that shows up as **ath0** can not be setup with an IP address using the configuration files that are part of pre-Slackware 10.2 releases. We are going to assume here that you are running Slackware 10.2. For older releases, read [[# | ||
+ | |||
+ | * You will need to add or modify a few lines in / | ||
+ | # Config information for ath0 (using dhcp): | ||
+ | IFNAME[1]=" | ||
+ | IPADDR[1]="" | ||
+ | NETMASK[1]="" | ||
+ | USE_DHCP[1]=" | ||
+ | DHCP_HOSTNAME[1]=" | ||
+ | </ | ||
+ | # Config information for ath0 (using static IP address): | ||
+ | IFNAME[1]=" | ||
+ | IPADDR[1]=" | ||
+ | NETMASK[1]=" | ||
+ | USE_DHCP[1]="" | ||
+ | DHCP_HOSTNAME[1]="" | ||
+ | GATEWAY=" | ||
+ | </ | ||
+ | |||
+ | * NOTE\\ In the above example, where I used the index 1, like in: VARIABLENAME[**1**], | ||
+ | # Config information for ath0 (using static IP address): | ||
+ | IFNAME[0]=" | ||
+ | IPADDR[0]=" | ||
+ | NETMASK[0]=" | ||
+ | USE_DHCP[0]="" | ||
+ | DHCP_HOSTNAME[0]="" | ||
+ | GATEWAY=" | ||
+ | </ | ||
+ | |||
+ | * NOTE\\ Any setting that is available in // | ||
+ | < | ||
+ | WPA=" | ||
+ | WPADRIVER=" | ||
+ | </ | ||
+ | IFNAME[1]=" | ||
+ | ... | ||
+ | WLAN_WPA[1]=" | ||
+ | WLAN_WPADRIVER[1]=" | ||
+ | </ | ||
+ | |||
+ | |||
+ | === (Re) starting the network interface === | ||
+ | |||
+ | |||
+ | If youre using Slackware 10.2 or in case you run an older release but updated your network scripts, you can start your ath0 interface like this: | ||
+ | < | ||
+ | / | ||
+ | </ | ||
+ | or restart it like this (after making changes to the above configuration files for instance): | ||
+ | < | ||
+ | / | ||
+ | </ | ||
+ | Earlier versions of Slackware will (re-)start all configured interfaces at once, because all you can run is | ||
+ | < | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | |||
+ | === Updating the network scripts (Slackware 10.1 and older) === | ||
+ | |||
+ | |||
+ | The network scripts of Slackware 10.2 can be used in older releases of Slackware as well. You will need / | ||
+ | |||
+ | |||
+ | === Network configuration the manual way (Slackware 10.1 and older) === | ||
+ | |||
+ | |||
+ | These are the relatively easy ways to get slackware to bring up your interface: | ||
+ | |||
+ | - Run / | ||
+ | - Run dhcpcd ath0 which should be enough to get you up and running; | ||
+ | - It depends on your local network and your settings if you want ifconfig (instead of dhcpcd) and possibly additional iwconfig commands. | ||
+ | - Put a dhcpcd ath0 or ifconfig ath0 statement at the bottom of ''/ | ||
+ | - If youre using hotplug, you can have it automatically bring up the interface by editing ''/ | ||
+ | ath*) | ||
+ | | ||
+ | % or if you prefer to just hardcode your interface, put your ifconfig statement here. | ||
+ | % ifconfig $INTERFACE 192.168.1.1 netmask 255.255.255.0 ... | ||
+ | ;; | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== Using early madwifi-ng versions with Slackware 10.2 ==== | ||
+ | |||
+ | |||
+ | //NOTE//: \\ The text in this paragraph applies to early versions of the madwifi-ng driver. For any version of the madwifi driver released after 23-january-2006, | ||
+ | |||
+ | Madwifi-ng' | ||
+ | When the events for the //wifi0// device are received, '' | ||
+ | |||
+ | - Editing / | ||
+ | | ||
+ | exec / | ||
+ | ;; | ||
+ | </ | ||
+ | |||
+ | - Editing / | ||
+ | | ||
+ | exec / | ||
+ | ;; | ||
+ | </ | ||
+ | |||
+ | - Creating a new file, / | ||
+ | #!/bin/sh | ||
+ | # / | ||
+ | # This script is used to bring up an Atheros wireless interface | ||
+ | # Using the madwifi-ng code (http:// | ||
+ | # | ||
+ | # Version 1.0 | ||
+ | # For Slackware 10.2 - Joe Feise 2005-Dec-15 | ||
+ | |||
+ | # Find the path where wireless tools are installed | ||
+ | for IWPATH in / | ||
+ | if [ -x $IWPATH/ | ||
+ | done | ||
+ | WLANCONFIG=" | ||
+ | |||
+ | ########### | ||
+ | # LOGGING # | ||
+ | ########### | ||
+ | |||
+ | # If possible, log events in / | ||
+ | if [ -f / | ||
+ | LOGGER=/ | ||
+ | else # output to stdout/ | ||
+ | LOGGER=/ | ||
+ | fi | ||
+ | |||
+ | ####################### | ||
+ | # INTERFACE FUNCTIONS # | ||
+ | ####################### | ||
+ | |||
+ | # Function to bring up a wireless interface. | ||
+ | # already up or does not yet exist (perhaps because the kernel driver | ||
+ | # is not loaded yet), do nothing. | ||
+ | if_up() { | ||
+ | # If the interface isn't in the kernel yet (but there' | ||
+ | # modules.conf), | ||
+ | if ! grep `echo ${1}: | cut -f 1 -d :`: / | ||
+ | if / | ||
+ | echo "/ | ||
+ | / | ||
+ | fi | ||
+ | fi | ||
+ | if grep `echo ${1}: | cut -f 1 -d :`: / | ||
+ | if ! / | ||
+ | $WLANCONFIG create wlandev ${1} wlanmode sta | ||
+ | else | ||
+ | if [ " | ||
+ | echo "/ | ||
+ | fi | ||
+ | fi | ||
+ | else | ||
+ | if [ " | ||
+ | echo "/ | ||
+ | fi | ||
+ | fi | ||
+ | } | ||
+ | |||
+ | # Function to take down a wireless interface: | ||
+ | if_down() { | ||
+ | # Removing the modules | ||
+ | sleep 2 | ||
+ | / | ||
+ | } | ||
+ | |||
+ | |||
+ | # Function to start the network: | ||
+ | start() { | ||
+ | if_up wifi0 | ||
+ | } | ||
+ | |||
+ | # Function to stop the network: | ||
+ | stop() { | ||
+ | if_down wifi0 | ||
+ | } | ||
+ | |||
+ | |||
+ | ############ | ||
+ | ### MAIN ### | ||
+ | ############ | ||
+ | |||
+ | case " | ||
+ | ' | ||
+ | start | ||
+ | ;; | ||
+ | ' | ||
+ | stop | ||
+ | ;; | ||
+ | ' | ||
+ | stop | ||
+ | start | ||
+ | ;; | ||
+ | *_start) # Example: " | ||
+ | INTERFACE=`echo $1 | /bin/cut -d ' | ||
+ | if_up $INTERFACE | ||
+ | ;; | ||
+ | *_stop) # Example: " | ||
+ | INTERFACE=`echo $1 | /bin/cut -d ' | ||
+ | if_down $INTERFACE | ||
+ | ;; | ||
+ | *_restart) # Example: " | ||
+ | INTERFACE=`echo $1 | /bin/cut -d ' | ||
+ | if_down $INTERFACE | ||
+ | sleep 1 | ||
+ | if_up $INTERFACE | ||
+ | ;; | ||
+ | ' | ||
+ | start | ||
+ | ;; | ||
+ | ' | ||
+ | stop | ||
+ | ;; | ||
+ | *_up) # " | ||
+ | INTERFACE=`echo $1 | /bin/cut -d ' | ||
+ | if_up $INTERFACE | ||
+ | ;; | ||
+ | *_down) # " | ||
+ | INTERFACE=`echo $1 | /bin/cut -d ' | ||
+ | if_down $INTERFACE | ||
+ | ;; | ||
+ | *) # The default is to bring up all configured interfaces: | ||
+ | if_up wifi0 | ||
+ | esac | ||
+ | |||
+ | # End of / | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== Support for WPA encryption ==== | ||
+ | |||
+ | |||
+ | I am assuming that you already have your madwifi-powered card up and running. Do not try to add WPA support if you do not yet have a functional wireless network connection! Also, if you run Slackware older than 10.2 you will need the updated network scripts that are mentioned in the previous section [[# | ||
+ | |||
+ | The madwifi package obtained [[http:// | ||
+ | |||
+ | If you want to compile your own packages, you might find some useful information in the [[http:// | ||
+ | |||
+ | //Note//: Recent wpa_supplicant should have support for roaming open networks as well as for wpa-protected networks. This makes the [[http:// | ||
+ | |||
+ | //Note//: When you want to re-build wpa_supplicant, | ||
+ | |||
+ | * To enable WPA support for your madwifi driver, install the wpa_supplicant package (it is not depending on any kernel version) and then open the file ''/ | ||
+ | ctrl_interface=/ | ||
+ | ctrl_interface_group=0 | ||
+ | eapol_version=1 | ||
+ | ap_scan=1 | ||
+ | fast_reauth=1 | ||
+ | | ||
+ | network={ | ||
+ | scan_ssid=0 | ||
+ | ssid=" | ||
+ | proto=WPA | ||
+ | key_mgmt=WPA-PSK | ||
+ | pairwise=CCMP TKIP | ||
+ | group=CCMP TKIP WEP104 WEP40 | ||
+ | psk=your_64_hex_characters_long_key | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | * There is a way to generate the hexadecimal value for the PSK if you have an access point which uses a passphrase. As root, run: < | ||
+ | wpa_passphrase YOURSSID passphrase | ||
+ | </ | ||
+ | network={ | ||
+ | ssid=" | ||
+ | # | ||
+ | psk=04dffae0172e3a255e5bab6f28ab78cc23d845f3dd8d4a63ba64a37555e2a33b | ||
+ | } | ||
+ | </ | ||
+ | chmod 600 / | ||
+ | </ | ||
+ | |||
+ | * You will also need to apply the following patch to ''/ | ||
+ | --- net.agent.org | ||
+ | +++ net.agent | ||
+ | @@ -67,7 +67,7 @@ | ||
+ | # Interface already up? If so, skip. | ||
+ | if ! / | ||
+ | | ||
+ | - exec / | ||
+ | + exec / | ||
+ | fi | ||
+ | # RedHat and similar | ||
+ | </ | ||
+ | * Finally, youll need to upgrade your wireless-tools to at least wireless-tools-27 (which is in Slackware 10.2). There is a package for wireless-tools-28 [[http:// | ||
+ | |||
+ | * Now, if your network configuration in rc.inet1.conf looked like this: < | ||
+ | # Config information for ath0 (using dhcp): | ||
+ | IFNAME[1]=" | ||
+ | IPADDR[1]="" | ||
+ | NETMASK[1]="" | ||
+ | USE_DHCP[1]=" | ||
+ | DHCP_HOSTNAME[1]=" | ||
+ | </ | ||
+ | # Config information for ath0 (using dhcp): | ||
+ | IFNAME[1]=" | ||
+ | IPADDR[1]="" | ||
+ | NETMASK[1]="" | ||
+ | USE_DHCP[1]=" | ||
+ | DHCP_HOSTNAME[1]=" | ||
+ | WLAN_WPA[1]=" | ||
+ | WLAN_WPADRIVER[1]=" | ||
+ | </ | ||
+ | |||
+ | * You can restart your network card now, by running < | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | |||
+ | === WPA debugging === | ||
+ | |||
+ | |||
+ | * Was wpa_supplicant compiled with support for madwifi?\\ Run wpa_supplicant on the commandline, | ||
+ | |||
+ | * Debug the WPA authentication process.\\ Make sure the network interface is down (run < | ||
+ | / | ||
+ | </ | ||
+ | wpa_supplicant -dw -c/ | ||
+ | </ | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | * Get a run-time status overview of the supplicant: | ||
+ | wpa_cli status | ||
+ | </ | ||
+ | |||
+ | * Debug Slackwares network intitialization.\\ Add < | ||
+ | DEBUG_ETH_UP=" | ||
+ | </ | ||
+ | |||
+ | * The WPA association might take a long time.\\ Start the interface again after a little time, this may help if it takes wpa_supplicant a long time to associate (no restart, just another start): < | ||
+ | / | ||
+ | </ | ||
+ | WPAWAIT=10 | ||
+ | </ | ||
+ | WPAWAIT=20 | ||
+ | </ | ||
+ | |||
+ | * The Access Point is not broadcasting the SSID.\\ I have tried and failed in getting WPA to work when the Access Point has a //hidden SSID//. Check if your AP is broadcasting the SSID and if not, enable it. There is little point in hiding the SSID anyway, with WPA as a protection layer you should not fear break-ins (as long as you do not use easy-to-guess passphrases!!! WPA can be cracked with dictionary attacks and no I will not supply a link here). | ||
+ | |||
+ | |||
+ | ==== Author(s) and further pointers ==== | ||
+ | |||
+ | * The original information on this page was written by unknown author for the original DokuWiki based [[http:// | ||
+ | * This page was updated with Slackware 10.2 information and WPA configuration by Eric Hameleers <alien at slackware dot com>\\ For questions about this page, you can contact me at my email address, or visit the #madwifi IRC channel on Freenode. | ||
+ | * Updated with information about using madwifi-ng on Slackware 10.2 by Joe Feise <jfeise at feise dot com>. | ||
+ | * Updated with information about using madwifi-ng (builds later than 1407) and updated WPA information by Eric Hameleers <alien at slackware dot com>. | ||
+ | * Exported this page from the MadWiki and translated back to DokuWiki format, for my own Slackware Wiki. | ||