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/17 23:10] – 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 ==== | ||
+ | |||
+ | |||
+ | ==== Loading the kernel modules automatically ==== | ||
+ | |||
+ | |||
+ | ==== Network configuration ==== | ||
+ | |||
+ | === rc.wireless.conf === | ||
+ | |||
+ | === rc.inet1.conf === | ||
+ | |||
+ | === (Re) starting the network interface === | ||
+ | |||
+ | === Updating the network scripts (Slackware 10.1 and older) === | ||
+ | |||
+ | === Network configuration the manual way (Slackware 10.1 and older) === | ||
+ | |||
+ | |||
+ | ==== Using early madwifi-ng versions with Slackware 10.2 ==== | ||
+ | |||
+ | |||
+ | ==== Support for WPA encryption ==== | ||
+ | |||
+ | === WPA debugging === | ||
+ | |||
+ | |||
+ | ==== 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. | ||
+ | |||
+ | --------------------------------------------- | ||
+ | **TODO** transform Trac syntax into DokuWiki: | ||
+ | |||
+ | %% | ||
+ | == 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 | ||
+ | {{{ | ||
+ | uname -r | ||
+ | }}} | ||
+ | |||
+ | * Start with downloading all the source files [http:// | ||
+ | {{{ | ||
+ | chmod +x madwifi.SlackBuild | ||
+ | ./ | ||
+ | }}} | ||
+ | The binary package will be created in directory /tmp and have a name of madwifi-${VERSION}_${KERNELVERSION}-i486-1.tgz. Here, ${VERSION} is the version of the madwifi source package, and ${KERNELVERSION} is the version of your running kernel. | ||
+ | |||
+ | * If you want to build a package for another kernel that youve already installed on your computer, and you dont 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 ./ | ||
+ | }}} | ||
+ | If the kernel source tree cannot be found (i.e. if the kernel source tree is not found where the link / | ||
+ | {{{ | ||
+ | KVER=2.6.13 KSRC=~/ | ||
+ | }}} | ||
+ | If you downloaded a newer/other version of the madwifi sources and you want to build a package out of that, you will have to edit the madwifi.SlackBuild script, and substitute the correct value for the ''''' | ||
+ | {{{ | ||
+ | VERSION=< | ||
+ | }}} | ||
+ | | ||
+ | Be warned that the madwifi sources are in constant development, | ||
+ | |||
+ | |||
+ | * Install the madwifi package with | ||
+ | {{{ | ||
+ | installpkg madwifi-VERSION_KERNELVERSION-i486-BUILDNR.tgz | ||
+ | }}} | ||
+ | or if you already had a previous package installed, use | ||
+ | {{{ | ||
+ | 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 / | ||
+ | {{{ | ||
+ | / | ||
+ | }}} | ||
+ | which will then load the kernel module when the computer boots. | ||
+ | |||
+ | == Network configuration == | ||
+ | |||
+ | === rc.wireless.conf === | ||
+ | |||
+ | If you have a Wireless Access Point that is broadcasting its station ID (the '' | ||
+ | |||
+ | 1. you just took your Wireless Access Point out of the box you were sold it in, and didnt have time yet to configure it; | ||
+ | 2. 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 | ||
+ | {{{ | ||
+ | / | ||
+ | }}} | ||
+ | and add a specific configuration that matches your wireless card and Access Point. | ||
+ | |||
+ | You will notice that the content of / | ||
+ | {{{ | ||
+ | MAC_Address) | ||
+ | INFO=" | ||
+ | PARAMETER1=" | ||
+ | PARAMETER2=" | ||
+ | [more parameters] ....... | ||
+ | ;; | ||
+ | }}} | ||
+ | The MAC_Address in this example can be a full MAC address (six hex bytes separated by colons, like 00: | ||
+ | You are going to add such a section for your card, and this is how to do it: | ||
+ | |||
+ | * After the module is loaded and your ath0 interface is available, run ifconfig ath0 and get the MAC address of ath0. | ||
+ | * Edit / | ||
+ | {{{ | ||
+ | *) | ||
+ | INFO=" | ||
+ | ESSID=" | ||
+ | ;; | ||
+ | }}} | ||
+ | so that it will look like this: | ||
+ | {{{ | ||
+ | # *) | ||
+ | # | ||
+ | # | ||
+ | # ;; | ||
+ | }}} | ||
+ | * 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=" | ||
+ | ;; | ||
+ | }}} | ||
+ | Your MAC address, ESSID, KEY and info comment are obviously going to be different. | ||
+ | |||
+ | === rc.inet1.conf === | ||
+ | |||
+ | Slackware 10.2 understands network interfaces whose names do not start with eth. A network card that shows up as ''''' | ||
+ | |||
+ | * 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]=" | ||
+ | }}} | ||
+ | Or like this: | ||
+ | {{{ | ||
+ | # Config information for ath0 (using static IP address): | ||
+ | IFNAME[1]=" | ||
+ | IPADDR[1]=" | ||
+ | NETMASK[1]=" | ||
+ | USE_DHCP[1]="" | ||
+ | DHCP_HOSTNAME[1]="" | ||
+ | GATEWAY=" | ||
+ | }}} | ||
+ | These are example values of course and you will have to substitute your own. | ||
+ | |||
+ | * NOTE [[BR]] | ||
+ | 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 [[BR]] | ||
+ | Any setting that is available in '' | ||
+ | {{{ | ||
+ | WPA=" | ||
+ | WPADRIVER=" | ||
+ | }}} | ||
+ | but this is how you could do it in '' | ||
+ | {{{ | ||
+ | IFNAME[1]=" | ||
+ | ... | ||
+ | WLAN_WPA[1]=" | ||
+ | WLAN_WPADRIVER[1]=" | ||
+ | }}} | ||
+ | You can configure your card in either one, or both of the configuration files, but the settings in '' | ||
+ | |||
+ | === (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 / | ||
+ | If you have difficulties extracting these files from a Slackware 10.2 CD or Internet server, you can find them [http:// | ||
+ | |||
+ | === Network configuration the manual way (Slackware 10.1 and older) === | ||
+ | |||
+ | These are the relatively easy ways to get slackware to bring up your interface: | ||
+ | |||
+ | 1. Run / | ||
+ | 2. Run dhcpcd ath0 which should be enough to get you up and running; | ||
+ | 3. It depends on your local network and your settings if you want ifconfig (instead of dhcpcd) and possibly additional iwconfig commands. | ||
+ | 4. Put a dhcpcd ath0 or ifconfig ath0 statement at the bottom of / | ||
+ | 5. 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 ... | ||
+ | ;; | ||
+ | }}} | ||
+ | In the remove|unregister branch it will automatically bring down dhcpcd if running. | ||
+ | |||
+ | == Using early madwifi-ng versions with Slackware 10.2 == | ||
+ | |||
+ | '' | ||
+ | |||
+ | Madwifi-ng' | ||
+ | The reason is that the hotplugging subsystem sees at least two events each for adding and removing: one for the wifi0 device when the card is plugged in, and one for each activation of a virtual interface. | ||
+ | When the events for the wifi0 device are received, wlanconfig needs to be executed to enable the virtual APs. | ||
+ | This can be accomplished by editing / | ||
+ | |||
+ | 1. Editing / | ||
+ | {{{ | ||
+ | | ||
+ | exec / | ||
+ | ;; | ||
+ | }}} | ||
+ | 2. Editing / | ||
+ | {{{ | ||
+ | | ||
+ | exec / | ||
+ | ;; | ||
+ | }}} | ||
+ | 3. 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 / | ||
+ | }}} | ||
+ | |||
+ | This takes care of creating a virtual AP as normal station mode, with device name athx (usually ath0). From this point forward, the normal rc.inet1 processing for athx, as explained above, takes place. | ||
+ | |||
+ | == 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 Updating the network scripts (Slackware 10.1 and older). | ||
+ | |||
+ | The madwifi package obtained [http:// | ||
+ | |||
+ | If you want to compile your own packages, you might find some useful information in the [wiki: | ||
+ | |||
+ | 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 | ||
+ | } | ||
+ | }}} | ||
+ | but youll need to supply your own values for the ssid and the psk. | ||
+ | |||
+ | * 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 | ||
+ | }}} | ||
+ | with the SSID of your AP and the passphrase youve entered in its WPA-PSK configuration. Youll receive an output, which looks like this: | ||
+ | {{{ | ||
+ | network={ | ||
+ | ssid=" | ||
+ | # | ||
+ | psk=04dffae0172e3a255e5bab6f28ab78cc23d845f3dd8d4a63ba64a37555e2a33b | ||
+ | } | ||
+ | }}} | ||
+ | Next, you should copy the three lines that you find inside the network={} section and paste them inside the network={} section of the file / | ||
+ | {{{ | ||
+ | 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]=" | ||
+ | }}} | ||
+ | then youd have to add two lines so that it will read: | ||
+ | {{{ | ||
+ | # Config information for ath0 (using dhcp): | ||
+ | IFNAME[1]=" | ||
+ | IPADDR[1]="" | ||
+ | NETMASK[1]="" | ||
+ | USE_DHCP[1]=" | ||
+ | DHCP_HOSTNAME[1]=" | ||
+ | WLAN_WPA[1]=" | ||
+ | WLAN_WPADRIVER[1]=" | ||
+ | }}} | ||
+ | Adapt this to your own configuration of course. | ||
+ | * You can restart your network card now, by running | ||
+ | {{{ | ||
+ | / | ||
+ | }}} | ||
+ | If your WPA connection does not activate, try some debugging: | ||
+ | |||
+ | === 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/ | ||
+ | }}} | ||
+ | Then activate the network interface in another terminal (run / | ||
+ | |||
+ | * Get a run-time status overview of the supplicant: | ||
+ | As root, run | ||
+ | {{{ | ||
+ | wpa_cli status | ||
+ | }}} | ||
+ | to see the current status of wpa_supplicants authentication process. | ||
+ | |||
+ | * Debug Slackwares network intitialization. | ||
+ | Add | ||
+ | {{{ | ||
+ | DEBUG_ETH_UP=" | ||
+ | }}} | ||
+ | to / | ||
+ | |||
+ | * 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): | ||
+ | {{{ | ||
+ | / | ||
+ | }}} | ||
+ | If this works, but it happens a lot, you can change the wait time for the WPA authentication process by editing the file / | ||
+ | {{{ | ||
+ | WPAWAIT=10 | ||
+ | }}} | ||
+ | to | ||
+ | {{{ | ||
+ | WPAWAIT=20 | ||
+ | }}} | ||
+ | or any other larger value that helps your particular setup. | ||
+ | |||
+ | * 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). | ||
+ | |||
+ | %% |