Welcome to Eric Hameleers (Alien BOB)'s Wiki pages.

If you want to support my work, please consider a small donation:

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

slackware:madwifi [2006/03/17 23:00]
alien created
slackware:madwifi [2008/11/19 11:23] (current)
alien New project name, new homepage URL , new logo
Line 1: Line 1:
 ===== Installing Madwifi on Slackware ===== ===== 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, everything should work right away.\\ +{{ :slackware:madwifi-logo-20081106-2.png|Madwifi }}\\ Wireless support in Slackware has much improved since Slackware 10.0 (the first release to support non-PCMCIA wireless cards out of the box). The [[http://madwifi-project.org/|madwifi driver]] for Atheros based chipsets works fine with the current 2.6.x series of kernels and the 2.4.x kernels found in Slackware releases prior to 12.0. The Slackware configuration files support unencryptedWEP- and WPA-protected connections. For WPA encryptionthe wpa_supplicant package (part of Slackware since 12.0) is an additional requirement.\\ 
-If you need WPA encryption, read the [[#SupportforWPAencryption|Support for WPA encryption]] section of this page.+If you need WPA encryption, be sure to read the [[#support_for_wpa_encryption|Support for WPA encryption]] section of this page.
  
-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 "madwifi-ng" or "madwifi next-generation". The name used for the driver is just "madwifi" and where needed, I will refer to "madwifi-old" for the old code which is no longer being developed (but fixes are still being applied).+This Wiki page explains how to install an appropriate Madwifi package on your Slackware computer, and gives directions on how to build your own package if you need to (for instance if you run a non-Slackware kernel).
  
-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 "sta") will by created by default when the kernel module loads and is called //ath0//. This //ath0// is the real network device, which you will be configuring and using.\\ People who want to create something other than a user station, for instance a real Access Point (master mode) will want to read this [[http://madwifi.org/wiki/UserDocs/autocreate|MadWiki documentation]]. +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 "sta") will by created by default when the kernel module loads and is called //ath0//. This //ath0// is the real network device, which you will be configuring and using.\\ People who want to create something other than a user station, for instance a real Access Point (master mode) will want to read this [[http://madwifi-project.org/wiki/UserDocs/autocreate|MadWiki documentation]]. 
  
  
 ==== Obtaining slackware packages for madwifi ==== ==== Obtaining slackware packages for madwifi ====
  
-Binary Slackware packages for the madwifi driver can be found at [[http://www.slackware.com/~alien/slackbuilds/madwifi/pkg/|slackware.com]]. They can be installed onto your computer using ''installpkg'' or ''upgradepkg''. They are packages for specific kernels. The package naming convention is **madwifi-${VERSION}_${KERNELVERSION}-i486-${NUMBER}.tgz**. Here, //${VERSION}// is the version of the madwifi source package, and //${KERNELVERSION}// is the version of the kernel that the package is meant for. The //${NUMBER}// is the build number. In case there are multiple packages where only the build number differs, then the package with the highest build number is the most recent and should be used.+Binary Slackware packages for the madwifi driver can be found at [[http://www.slackware.com/~alien/slackbuilds/madwifi/pkg/|slackware.com]]. They can be installed onto your computer using ''installpkg'' or ''upgradepkg''. They are packages for specific kernels. The package naming convention is //madwifi-${VERSION}_${KERNELVERSION}-i486-${NUMBER}.tgz//. Here, //${VERSION}// is the version of the madwifi source package, and //${KERNELVERSION}// is the version of the kernel that the package is meant for. The //${NUMBER}// is the build number. In case there are multiple packages where only the build number differs, then the package with the highest build number is the most recent and should be used.
  
-The old driver, also referred to as "madwifi-old", still has some features that have not yet been ported to the "madwifi-ng" code. For people who need this old driver specifically, there is a package still available [[http://www.slackware.com/~alien/slackbuilds/madwifi-old/|here]].+==== Building 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 <code>uname -r</code>
  
- +  * Start with downloading __all__ the source files [[http://www.slackware.com/~alien/slackbuilds/madwifi/build/|here]] to a directory on your local hard disk. This command will do exactly that: <code> 
-%% +lftp -c "open http://www.slackware.com/~alien/slackbuilds/madwifi/; mirror build" 
-== Building a slackware package for madwifi from source == +</code> This will create a subdirectory ''build'' in your current directory. Change to that directory, ''su -'' to root if you haven't done so already, and start the ''madwifi.SlackBuild'' script after making it executable: <code>
- +
-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://www.slackware.com/~alien/slackbuilds/madwifi/build/ here] to a directory on your local hard disk. Change to that directory, su to root if you havent done so already, and start the madwifi.SlackBuild script after making it executable: +
-{{{+
 chmod +x madwifi.SlackBuild chmod +x madwifi.SlackBuild
 ./madwifi.SlackBuild ./madwifi.SlackBuild
-}}} +</code> A binary Slackware 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.
-   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): +  * If you want to build a package for another kernel that you've 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.23.16-smp''): <code> 
-{{{ +KVER=2.6.23.16-smp ./madwifi.SlackBuild 
-KVER=2.6.13 ./madwifi.SlackBuild +</code> If the kernel source tree cannot be found (i.e. if the kernel source tree is not found where the link /lib/modules/${KVER}/build points) you can specify your kernel source directory as well (again, this is only an example): <code> 
-}}} +KVER=2.6.23.16-smp KSRC=~/src/linux-2.6.23.16 ./madwifi.SlackBuild 
-   If the kernel source tree cannot be found (i.e. if the kernel source tree is not found where the link /lib/modules/${KVER}/build points) you can specify your kernel source directory as well (again, this is only an example): +</code> 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** parameter in the line<code>
-{{{ +
-KVER=2.6.13 KSRC=~/src/linux-2.6.13 ./madwifi.SlackBuild +
-}}} +
-   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''''' in the line +
-{{{+
 VERSION=<value> VERSION=<value>
-}}} +</code> before executing the script.\\ Be warned that the madwifi sources are in constant development, so the possibility exists that the madwifi.SlackBuild script will not produce correct results for newer (or older) madwifi sources.
-   before executing the script. +
-   Be warned that the madwifi sources are in constant development, so the possibility exists that the madwifi.SlackBuild script will not produce correct results for newer (or older) madwifi sources.+
  
- +  * Install the madwifi package with <code>
- * Install the madwifi package with +
-{{{+
 installpkg madwifi-VERSION_KERNELVERSION-i486-BUILDNR.tgz installpkg madwifi-VERSION_KERNELVERSION-i486-BUILDNR.tgz
-}}} +</code> or if you already had a previous package installed, use <code>
-   or if you already had a previous package installed, use +
-{{{+
 upgradepkg madwifi-VERSION_KERNELVERSION-i486-BUILDNR.tgz upgradepkg madwifi-VERSION_KERNELVERSION-i486-BUILDNR.tgz
-}}}+</code>
  
-== 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 /etc/rc.d/rc.modules: +==== Loading the kernel modules automatically ==== 
-{{{+ 
 +You can use hotplug/udev to load the madwifi driver automatically. There is nothing to configure; hotplug/udev takes care of everything. If you do not use hotplug or udev, you can add a line like this to ''/etc/rc.d/rc.modules''<code>
 /sbin/modprobe ath_pci /sbin/modprobe ath_pci
-}}} +</code> which will then load the kernel module when the computer boots.
-which will then load the kernel module when the computer boots.+
  
-== Network configuration ==+If you need to pass parameters to the madwifi driver, like a different country code, you can create a file in the ''/etc/modprobe.d/'' directory which contains these parameters. The filename is yours to choose - let's use 'madwifi' as the name. For example, suppose you need to tell the driver to use country code ''25''. You create the file "''/etc/modprobe.d/madwifi''" and add the following single line to it: 
 +<code>options ath_pci countrycode=25</code> (by the way, a list of country codes is available on the [[http://madwifi.org/wiki/UserDocs/CountryCode|madwifi Wiki]]). 
 +<note tip>If your (older) version of Slackware does not have a ''/etc/modprobe.d'' directory, you can add the line <code>options ath_pci countrycode=25</code> to the file ''/etc/modprobe.conf'' (for 2.6 kernels) or ''/etc/modules.conf'' (for 2.4 kernels) instead.</note> 
 + 
 +==== Network configuration ====
  
 === rc.wireless.conf === === 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+If you have a Wireless Access Point that is broadcasting its station ID (the //ESSID//), and is not configured for encrypted traffic, then you're 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 bought it in, and didn't have time yet to configure it;
  
- 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; +  - you are at an airport/hotel/pub where they offer free wireless access.
- 2. you are at an airport/hotel/pub where they offer free wireless access.+
  
-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 +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 either the file <code>/etc/rc.d/rc.wireless.conf</code> or the file <code>/etc/rc.d/rc.inet1.conf</code> (one of the two will do) and add a specific configuration that matches your wireless card and Access Point. Let's use ''/etc/rc.d/rc.wireless.conf'' as an example of how to configure your wireless.
-{{{ +
-/etc/rc.d/rc.wireless.conf +
-}}} +
-and add a specific configuration that matches your wireless card and Access Point.+
  
-You will notice that the content of /etc/rc.d/rc.wireless.conf is basically a number of sections that apply to certain (ranges of) wireless network cards. The distinguishing factor is the hardware address (the MAC address) of a card. A section for a specific card or range of cards looks like this: +You will notice that the content of ''/etc/rc.d/rc.wireless.conf'' is basically a number of sections that apply to certain (ranges of) wireless network cards. The distinguishing factor is the hardware address (the //MAC address//) of a card. A section for a specific card or range of cards looks like this: <code>
-{{{+
   MAC_Address)   MAC_Address)
       INFO="a string that decribes your card type"       INFO="a string that decribes your card type"
Line 88: Line 68:
       [more parameters] .......       [more parameters] .......
       ;;       ;;
-}}} +</code> The MAC_Address in this example can be a full MAC address (six //HEX// bytes separated by colons, like ''00:12:8E:A0:32:DC'') that matches a single network card, or a wildcard address that matches a whole range of cards, typically all cards from a specific vendor (like ''00:12:8E:A0:*'').\\ You are going to add such a section for your card, and this is how to do it:
-The MAC_Address in this example can be a full MAC address (six hex bytes separated by colons, like 00:12:8E:A0:32:DC) that matches a single network card, or a wildcard address that matches a whole range of cards, typically all cards from a specific vendor (like 00:12:8E:A0:*). +
-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. +  * After the module is loaded and your ath0 interface is available, run ''ifconfig ath0'' and get the ''MAC'' address of your wireless interface (called ''ath0'' for a madwifi supported card). 
-  * Edit /etc/rc.d/rc.wireless.conf and comment out this section right in the beginning of the file: + 
-{{{+  * Edit /etc/rc.d/rc.wireless.conf and comment out this section right in the beginning of the file: <code>
   *)   *)
       INFO="Any ESSID"       INFO="Any ESSID"
       ESSID="any"       ESSID="any"
       ;;       ;;
-}}} +</code> so that it will look like this: <code>
-   so that it will look like this: +
-{{{+
 # *) # *)
 #     INFO="Any ESSID" #     INFO="Any ESSID"
 #     ESSID="any" #     ESSID="any"
 #     ;; #     ;;
-}}} +</code> 
-  * 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: + 
-{{{+  * Somewhere further below the lines you just commented out, add a few lines (easiest is to add it to the bottom of the file for instance, **right above** the ''esac'' line) that will apply to your card, like these: <code>
   00:06:25:13:2B:D4)   00:06:25:13:2B:D4)
       INFO="D-LINK DWL-G510 revB1"       INFO="D-LINK DWL-G510 revB1"
-      ESSID="yourapessid"+      ESSID="your_ap_essid"
       KEY="0100030203"       KEY="0100030203"
       ;;       ;;
-}}} +</code> The first line is your card's MAC address followed by a ')', and the last line must be two semicolons all by themselves (copy and paste one of the available examples if you're unsure).\\ Your ''MAC'' address, ''ESSID''''KEY'' and info comment are obviously going to be different from the values in the above example. 
-   Your MAC address, ESSID, KEY and info comment are obviously going to be different.+
  
 === rc.inet1.conf === === 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 ''Updating the network scripts and Configuration the manual way''.+Slackware since release 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 or newer. For older releases, read [[#network_configuration_the_manual_way_slackware_10.1_and_older|Updating the network scripts and Configuration the manual way]].
  
- * You will need to add or modify a few lines in /etc/rc.d/rc.inet1.conf in order to get a configuration like this: +  * You will need to add or modify a few lines in /etc/rc.d/rc.inet1.conf in order to get a configuration like this: <code>
-{{{+
 # Config information for ath0 (using dhcp): # Config information for ath0 (using dhcp):
 IFNAME[1]="ath0" IFNAME[1]="ath0"
Line 129: Line 104:
 USE_DHCP[1]="yes" USE_DHCP[1]="yes"
 DHCP_HOSTNAME[1]="mywirelessbox" DHCP_HOSTNAME[1]="mywirelessbox"
-}}} +</code> Or like this: <code>
-   Or like this: +
-{{{+
 # Config information for ath0 (using static IP address): # Config information for ath0 (using static IP address):
 IFNAME[1]="ath0" IFNAME[1]="ath0"
Line 139: Line 112:
 DHCP_HOSTNAME[1]="" DHCP_HOSTNAME[1]=""
 GATEWAY="192.168.3.1" GATEWAY="192.168.3.1"
-}}} +</code> These are example values of course and you will have to substitute your own.
-   These are example values of course and you will have to substitute your own.+
  
- * NOTE [[BR]] +  * NOTE\\ In the above example, where I used the index 1, like in: VARIABLENAME[**1**], you may use whatever index is not used. If you do not have an eth0 interface for instance, you might as well want to use the unused 0 array index. The last configuration example would then look like this: <code>
-   In the above example, where I used the index 1, like in: VARIABLENAME[1], you may use whatever index is not used. If you do not have an eth0 interface for instance, you might as well want to use the unused 0 array index. The last configuration example would then look like this: +
-{{{+
 # Config information for ath0 (using static IP address): # Config information for ath0 (using static IP address):
 IFNAME[0]="ath0" IFNAME[0]="ath0"
Line 152: Line 122:
 DHCP_HOSTNAME[0]="" DHCP_HOSTNAME[0]=""
 GATEWAY="192.168.3.1" GATEWAY="192.168.3.1"
-}}} +</code> Obviously, any array index value ([0],[1],[2], ) in /etc/rc.d/rc.inet1.conf should be used for exactly one card's configuration. If you copy a set of lines, be sure to change the array index to an unused value. If you forget this, and create a double entry, then Slackware will happily forget about the first, and will use only the last value for any parameter found in the file.
-   Obviously, any array index value ([0],[1],[2], ) in /etc/rc.d/rc.inet1.conf should be used for exactly one cards configuration. If you copy a set of lines, be sure to change the array index to an unused value. If you forget this, and create a doublure, then Slackware will happily forget about all but the last values found in the file.+
  
- * NOTE [[BR]] +  * NOTE\\ Any configuration setting that is available in //rc.wireless.conf// can also be configured in //rc.inet1.conf// by prefixing the parameter with "//WLAN_//". For instance, suppose you want to configure [[#support_for_wpa_encryption|WPA]]. You could add the following to your card's section in //rc.wireless.conf// 
-   Any setting that is available in ''rc.wireless.conf'' can also be configured in ''rc.inet1.conf'' by prefixing the parameter with "''WLAN_''". For instance, suppose you want to configure [wiki:UserDocs/Distro/Slackware#SupportforWPAencryption WPA]. You could add the following to your card's section in ''rc.wireless.conf'' +<code>
-{{{+
 WPA="wpa_supplicant" WPA="wpa_supplicant"
-WPADRIVER="madwifi+WPADRIVER="wext
-}}} +</code> but this is how you could do it in //rc.inet1.conf// as well: <code>
-   but this is how you could do it in ''rc.inet1.conf'' as well: +
-{{{+
 IFNAME[1]="ath0" IFNAME[1]="ath0"
    ...    ...
 WLAN_WPA[1]="wpa_supplicant" WLAN_WPA[1]="wpa_supplicant"
-WLAN_WPADRIVER[1]="madwifi+WLAN_WPADRIVER[1]="wext
-}}} +</code> You can configure your card in either one, or both of the configuration files, but the settings in //rc.inet1.conf// will always have priority. It depends on your own taste which of the two configuration files you want to put your configuration in, but if I may make a suggestion: don't use ''rc.wireless.conf'' and group all of the network configuration (wireless as well as non-wireless) for an interface nicely together in ''rc.inet1.conf''.
-You can configure your card in either one, or both of the configuration files, but the settings in ''rc.inet1.conf'' will always have priority. It depends on your own taste which of the two configuration files you want to put your configuration in.+
    
 +
 === (Re) starting the network interface === === (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: +If you're using Slackware 10.2 or newer, or in case you run an older release but updated your network scripts, you can start your ath0 interface like this: 
-{{{+<code>
 /etc/rc.d/rc.inet1 ath0_start /etc/rc.d/rc.inet1 ath0_start
-}}}+</code>
 or restart it like this (after making changes to the above configuration files for instance): or restart it like this (after making changes to the above configuration files for instance):
-{{{+<code>
 /etc/rc.d/rc.inet1 ath0_restart /etc/rc.d/rc.inet1 ath0_restart
-}}}+</code>
 Earlier versions of Slackware will (re-)start all configured interfaces at once, because all you can run is Earlier versions of Slackware will (re-)start all configured interfaces at once, because all you can run is
-{{{+<code>
 /etc/rc.d/rc.inet1 /etc/rc.d/rc.inet1
-}}}+</code> 
  
 === Updating the network scripts (Slackware 10.1 and older) === === 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 /etc/rc.d/rc.wireless* and /etc/rc.d/rc.inet1* +The network scripts of Slackware 10.2 or later can be used in older releases of Slackware as well. You will need /etc/rc.d/rc.wireless* and /etc/rc.d/rc.inet1* \\ If you have difficulties extracting these files from a Slackware CD or Internet server, you can find them [[http://www.slackware.com/~alien/rc_scripts/|here too]]. 
-If you have difficulties extracting these files from a Slackware 10.2 CD or Internet server, you can find them [http://www.slackware.com/~alien/rc_scripts/ here too].+
  
 === Network configuration the manual way (Slackware 10.1 and older) === === Network configuration the manual way (Slackware 10.1 and older) ===
Line 194: Line 161:
 These are the relatively easy ways to get slackware to bring up your interface: These are the relatively easy ways to get slackware to bring up your interface:
  
- 1. Run /etc/rc.d/rc.wireless to configure the wireless parameters for your card. +  - Run ''/etc/rc.d/rc.wireless'' to configure the wireless parameters for your card. 
- 2. Run dhcpcd ath0 which should be enough to get you up and running; +  - 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. +  - 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 /etc/rc.d/rc.local +  - Put a ''dhcpcd ath0'' or ''ifconfig ath0'' statement at the bottom of ''/etc/rc.d/rc.local'' 
- 5. If youre using hotplug, you can have it automatically bring up the interface by editing /etc/hotplug/net.agent and inserting the following lines in the case add|register) branch: +  - If you're using hotplug, you can have it automatically bring up the interface by editing ''/etc/hotplug/net.agent'' and inserting the following lines in the case add|register) branch: <code>
-{{{+
      ath*)      ath*)
        dhcpcd -n $INTERFACE % If you use dhcp for the interface        dhcpcd -n $INTERFACE % If you use dhcp for the interface
Line 205: Line 171:
        % ifconfig $INTERFACE 192.168.1.1 netmask 255.255.255.0 ...        % ifconfig $INTERFACE 192.168.1.1 netmask 255.255.255.0 ...
        ;;        ;;
-}}} +&lt;/code> In the //remove|unregister// branch it will automatically bring down dhcpcd if running.
-In the remove|unregister branch it will automatically bring down dhcpcd if running. +
- +
-== Using early madwifi-ng versions with Slackware 10.2 == +
- +
-  ''NOTE:'' [[BR]]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, the directions given in this paragraph are no longer needed; when loading the kernel module (/sbin/modprobe ath_pci), an interface ath0 will be automatically created, and there is no longer a need to run wlanconfig (either manually or by modifying the hotplug scripts). See [wiki:UserDocs/autocreate VAP autocreate] if you want to know more about this. +
- +
-Madwifi-ng's concept of virtual APs makes the configuration a bit more complicated, in particular if you have hotplugging enabled. +
-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 /etc/hotplug/net.agent and inserting a couple of lines, and adding a new script in the /etc/rc.d directory. +
- +
- 1. Editing /etc/hotplug/net.agent, in the case add|register) branch: +
-{{{ +
-     wifi*) +
-       exec /etc/rc.d/rc.madwifi-ng ${INTERFACE}_start +
-       ;; +
-}}} +
- 2. Editing /etc/hotplug/net.agent, in the &quot;case remove|unregister)" branch: +
-{{{ +
-     wifi*) +
-       exec /etc/rc.d/rc.madwifi-ng ${INTERFACE}_stop +
-       ;; +
-}}} +
- 3. Creating a new file, /etc/rc.d/rc.madwifi-ng, with the following content: +
-{{{ +
-#!/bin/sh +
-# /etc/rc.d/rc.madwifi-ng +
-# This script is used to bring up an Atheros wireless interface +
-# Using the madwifi-ng code (http://www.madwifi.org/) +
-+
-# Version 1.0 +
-# For Slackware 10.2 - Joe Feise 2005-Dec-15 +
- +
-# Find the path where wireless tools are installed +
-for IWPATH in /usr/{bin,sbin} /usr/local/{bin,sbin} /sbin /bin ; do +
-    if [ -x $IWPATH/wlanconfig ] ; then break ; fi +
-done +
-WLANCONFIG="$IWPATH/wlanconfig ath" +
- +
-########### +
-# LOGGING # +
-########### +
- +
-# If possible, log events in /var/log/messages: +
-if [ -f /var/run/syslogd.pid -a -x /usr/bin/logger ]; then +
-  LOGGER=/usr/bin/logger +
-else # output to stdout/stderr: +
-  LOGGER=/bin/cat +
-fi +
- +
-####################### +
-# INTERFACE FUNCTIONS # +
-####################### +
- +
-# Function to bring up a wireless interface.  If the interface is +
-# 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's an alias for it in +
-  # modules.conf), then it should be loaded first: +
-  if ! grep `echo ${1}: | cut -f 1 -d :`: /proc/net/dev 1/dev/null ; then # no interface yet +
-    if /sbin/modprobe -c | grep -w "alias ${1}" | grep -vw "alias ${1} off" > /dev/null ; then +
-      echo "/etc/rc.d/rc.inet1:  /sbin/modprobe ${1}" | $LOGGER +
-      /sbin/modprobe ${1} +
-    fi +
-  fi +
-  if grep `echo ${1}: | cut -f 1 -d :`: /proc/net/dev 1> /dev/null ; then # interface exists +
-    if ! /sbin/ifconfig | grep -w "${1}" 1>/dev/null 1> /dev/null ; then # interface not up or not configured +
-      $WLANCONFIG create wlandev ${1} wlanmode sta +
-    else +
-      if [ "$DEBUG_ETH_UP" = "yes" ]; then +
-        echo "/etc/rc.d/rc.madwifi-ng:  ${1} is already up, skipping" | $LOGGER +
-      fi +
-    fi  +
-  else +
-    if [ "$DEBUG_ETH_UP" = "yes" ]; then +
-      echo "/etc/rc.d/rc.madwifi-ng:  ${1} interface does not exist (yet)" | $LOGGER +
-    fi +
-  fi +
-+
- +
-# Function to take down a wireless interface: +
-if_down() { +
-  # Removing the modules +
-  sleep 2 +
-  /sbin/modprobe -r ${1} +
-+
- +
- +
-# Function to start the network: +
-start() { +
-  if_up wifi0 +
-+
- +
-# Function to stop the network: +
-stop() { +
-  if_down wifi0 +
-+
- +
- +
-############ +
-### MAIN ### +
-############ +
- +
-case "$1" in +
-'start') # "start" brings up all configured interfaces: +
-  start +
-  ;; +
-'stop') # "stop" takes down all configured interfaces: +
-  stop +
-  ;; +
-'restart') # "restart" restarts the network: +
-  stop +
-  start +
-  ;; +
-*_start) # Example: "wifi0_start" will start the specified interface 'wifi0' +
-  INTERFACE=`echo $1 | /bin/cut -d '_' -f 1` +
-  if_up $INTERFACE +
-  ;; +
-*_stop) # Example: "wifi0_stop" will stop the specified interface 'wifi0' +
-  INTERFACE=`echo $1 | /bin/cut -d '_' -f 1` +
-  if_down $INTERFACE +
-  ;; +
-*_restart) # Example: "wifi0_restart" will take 'wifi0' down and up again +
-  INTERFACE=`echo $1 | /bin/cut -d '_' -f 1` +
-  if_down $INTERFACE +
-  sleep 1 +
-  if_up $INTERFACE +
-  ;; +
-'up') # "up" does the same thing as "start" +
-  start +
-  ;; +
-'down') # "down" does the same thing as "stop" +
-  stop +
-  ;; +
-*_up) # "*_up" does the same thing as "*_start" +
-  INTERFACE=`echo $1 | /bin/cut -d '_' -f 1` +
-  if_up $INTERFACE +
-  ;; +
-*_down) # "*_down" does the same thing as "*_stop" +
-  INTERFACE=`echo $1 | /bin/cut -d '_' -f 1` +
-  if_down $INTERFACE +
-  ;; +
-*) # The default is to bring up all configured interfaces: +
-  if_up wifi0 +
-esac +
- +
-# End of /etc/rc.d/rc.madwifi-ng +
-}}}+
  
-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 ==+==== 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).+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|Updating the network scripts (Slackware 10.1 and older)]].
  
-The madwifi package obtained [http://www.slackware.com/~alien/slackbuilds/madwifi/pkg/ here] is for a "madwifi-ngversion that I tested with the wpa_supplicant package also found [http://www.slackware.com/~alien/slackbuilds/wpa_supplicant/pkg/ here]. People who want to use the old version of the madwifi driver can find a package [http://www.slackware.com/~alien/slackbuilds/madwifi-old/pkg/ here]. Be warned that in order to get WPA working with the "old" driver, I needed fairly old madwifi snapshots. Your mileage may vary.+The madwifi package obtained [[http://www.slackware.com/~alien/slackbuilds/madwifi/pkg/|here]] works well with the wpa_supplicant package found in Slackware 12.0. Starting with the linux kernel 2.6.14, madwifi and wpa_supplicant can communicate using wpa_supplicant's "''wext''" driver using the kernel's "wireless extensions". For older kernel versions, you will need wpa_supplicant's "''madwifi''driver for which you need the wpa_supplicant package found [[http://www.slackware.com/~alien/slackbuilds/wpa_supplicant/pkg/|here]].
  
-If you want to compile your own packages, you might find some useful information in the [wiki:UserDocs/802.11i Setting up a Client Using WPA-PSK] Wiki page.+If you want to compile your own wpa_supplicant package, you might find some useful information in the [[http://madwifi.org/wiki/UserDocs/802.11i|Setting up a Client Using WPA-PSK]] Wiki page.
  
-Note: Recent wpa_supplicant should have support for roaming open networks as well as for wpa-protected networks. This makes the [http://0pointer.de/lennart/projects/waproamd/ waproamd] program obsolete for instance.+>> Note: 
 +>> Recent wpa_supplicant should have support for roaming open networks as well 
 +>> as for wpa-protected networks. This makes the [[http://0pointer.de/lennart/projects/waproamd/|waproamd]]  
 +>> program obsolete for instance.
  
-Note: When you want to re-build wpa_supplicant, make sure you have installed the madwifi package on your system as well. The wpa_supplicant build needs the include files that thie madwifi package installs. If you want to use the SlackBuild scripts for madwifi and wpa_supplicant found [http://www.slackware.com/~alien/slackbuilds/ here] to rebuild the packages for your system, build them in that order (first build and install madwifi, then build and install wpa_supplicant). The madwifi include files will be found by the wpa_supplicant build script.+>> Note: 
 +>> When you want to re-build wpa_supplicant and run a Linux kernel older than 2.6.14, 
 +>> make sure you have installed the madwifi package on your system as well. 
 +>> The wpa_supplicant build needs the include files which the madwifi package installs. 
 +>> If you want to use the SlackBuild scripts for madwifi and wpa_supplicant 
 +>> which you can find [[http://www.slackware.com/~alien/slackbuilds/|here]] to rebuild the packages for your system, 
 +>> build them in that specific order (first build and install madwifi, 
 +>> then build and install wpa_supplicant). 
 +>> The madwifi include files will be detected by the wpa_supplicant build script and madwifi support enabled.
  
- * 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 /etc/wpa_supplicant.conf in an editor. It should look something like this: +  * 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 ''/etc/wpa_supplicant.conf'' in an editor. It should look something like this: <code>
-{{{+
   ctrl_interface=/var/run/wpa_supplicant   ctrl_interface=/var/run/wpa_supplicant
   ctrl_interface_group=0   ctrl_interface_group=0
Line 387: Line 213:
         psk=your_64_hex_characters_long_key         psk=your_64_hex_characters_long_key
   }   }
-}}} +</code> but you'll need to supply your own values for the //ssid// and the //psk//.
-   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: +  * 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: <code>
-{{{+
 wpa_passphrase YOURSSID passphrase wpa_passphrase YOURSSID passphrase
-}}} +</code> with the SSID of your AP and the passphrase youve entered in its WPA-PSK configuration. You'll receive an output, which looks like this: <code>
-   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={ network={
     ssid="YOURSSID"     ssid="YOURSSID"
Line 401: Line 223:
     psk=04dffae0172e3a255e5bab6f28ab78cc23d845f3dd8d4a63ba64a37555e2a33b     psk=04dffae0172e3a255e5bab6f28ab78cc23d845f3dd8d4a63ba64a37555e2a33b
 } }
-}}} +</code> Next, you should copy the three lines that you find inside the ''network={}'' section of the command's output and paste them inside the ''network={}'' section of the file ''/etc/wpa_supplicant.conf''. Do not forget to check the permissions of the configuration file! The key that it contains should be protected from prying eyes. <code>
-   Next, you should copy the three lines that you find inside the network={} section and paste them inside the network={} section of the file /etc/wpa_supplicant.conf. Do not forget to check the permissions of the configuration file! The key that it contains should be protected from prying eyes. +
-{{{+
 chmod 600 /etc/wpa_supplicant.conf chmod 600 /etc/wpa_supplicant.conf
-}}} +</code> 
- * You will also need to apply the following patch to /etc/hotplug/net.agent if youre not yet running Slackware 10.2. The patch makes the network initialization cleaner if you have more than one network interface, and wpa_supplicant needs that. + 
-{{{+  * You will also need to apply the following patch to ''/etc/hotplug/net.agent'' if you're not yet running Slackware 10.2 or newer. The patch makes the network initialization cleaner if you have more than one network interface, and wpa_supplicant needs that. <code>
 --- net.agent.org       2005-04-17 00:48:48.000000000 +0200 --- net.agent.org       2005-04-17 00:48:48.000000000 +0200
 +++ net.agent   2005-04-17 00:41:56.000000000 +0200 +++ net.agent   2005-04-17 00:41:56.000000000 +0200
Line 418: Line 238:
                  fi                  fi
             # RedHat and similar             # RedHat and similar
-}}} +</code> 
- * 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://www.slackware.com/~alien/slackbuilds/wireless-tools/pkg/ here] in case you need an even more advanced version (as I do).+  * Finally, you'll need to upgrade your wireless-tools to at least wireless-tools-27 (if you run anything older than Slackware 10.2). There is a package for wireless-tools [[http://www.slackware.com/~alien/slackbuilds/wireless-tools/pkg/ |here]] in case you need more advanced version.
  
- * Now, if your network configuration in rc.inet1.conf looked like this: +  * Now, if your network configuration in ''rc.inet1.conf'' looked like this at first<code>
-{{{+
   # Config information for ath0 (using dhcp):   # Config information for ath0 (using dhcp):
   IFNAME[1]="ath0"   IFNAME[1]="ath0"
Line 429: Line 248:
   USE_DHCP[1]="yes"   USE_DHCP[1]="yes"
   DHCP_HOSTNAME[1]="mywirelessbox"   DHCP_HOSTNAME[1]="mywirelessbox"
-}}} +</code> then you'd have to add two lines so that it will read: <code>
-   then youd have to add two lines so that it will read: +
-{{{+
   # Config information for ath0 (using dhcp):   # Config information for ath0 (using dhcp):
   IFNAME[1]="ath0"   IFNAME[1]="ath0"
Line 439: Line 256:
   DHCP_HOSTNAME[1]="mywirelessbox"   DHCP_HOSTNAME[1]="mywirelessbox"
   WLAN_WPA[1]="wpa_supplicant"   WLAN_WPA[1]="wpa_supplicant"
 +  WLAN_WPADRIVER[1]="wext"
 +</code> Adapt this to your own configuration of course. With kernels older than 2.6.14, the last line should become <code>
   WLAN_WPADRIVER[1]="madwifi"   WLAN_WPADRIVER[1]="madwifi"
-}}} +</code> and you'll need the version of wpa_supplicant that has support for the madwifi driver (see above)
-   Adapt this to your own configuration of course+ 
- * You can restart your network card now, by running +  * You can restart your wireless network card (''ath0'') now, by running <code>
-{{{+
 /etc/rc.d/rc.inet1 ath0_restart /etc/rc.d/rc.inet1 ath0_restart
-}}} +</code> If your WPA connection does not activate, try some debugging: 
-   If your WPA connection does not activate, try some debugging:+
  
 === WPA debugging === === WPA debugging ===
  
- * Was wpa_supplicant compiled with support for madwifi? +  [//If you run a kernel older than 2.6.14 ://] Was wpa_supplicant compiled with support for madwifi?\\ Run the command ''wpa_supplicant'' on the commandline, and verify that the output mentions ''madwifi = MADWIFI 802.11 support (Atheros, etc.)'' under ''drivers:''. If not, you will have to find another package which has the support for madwifi compiled in, or build a wpa_supplicant package yourself, and make sure that the build script finds the madwifi source code on your box.
-   Run wpa_supplicant on the commandline, and verify that the output mentions madwifi = MADWIFI 802.11 support (Atheros, etc.) under drivers:. If not, you will have to find another package which has the support for madwifi compiled in, or build a wpa_supplicant package yourself, and make sure that the build script finds the madwifi source code on your box.+
  
- * Debug the WPA authentication process. +  * Debug the WPA authentication process.\\ Make sure the network interface is down (run <code> 
-   Make sure the network interface is down (run /etc/rc.d/rc.inet1 ath0_stop to make sure). Start the wpa_supplicant daemon as a foreground process with additional debugging enabled: +/etc/rc.d/rc.inet1 ath0_stop 
-{{{ +</code> to make sure). Start the wpa_supplicant daemon as a foreground process with additional debugging enabled: <code> 
-wpa_supplicant -dw -c/etc/wpa_supplicant.conf -Dmadwifi -iath0 +wpa_supplicant -dw -c/etc/wpa_supplicant.conf -Dwext -iath0 
-}}} +</code> Then activate the network interface in another terminal (run <code> 
-   Then activate the network interface in another terminal (run /etc/rc.d/rc.inet1 ath0_start)Look at the output of wpa_supplicant in the first terminal, it might give you pointers to look for a solution.+/etc/rc.d/rc.inet1 ath0_start) 
 +</code> Look at the output of wpa_supplicant in the first terminal, it might give you pointers to look for a solution.
  
- * Get a run-time status overview of the supplicant: +  * Get a run-time status overview of the supplicant:\\ As root, run <code>
-   As root, run +
-{{{+
 wpa_cli status wpa_cli status
-}}} +</code> to see the current status of wpa_supplicant's authentication process.
-   to see the current status of wpa_supplicants authentication process.+
  
- * Debug Slackwares network intitialization. +  * Debug Slackwares network intitialization.\\ Change <code>DEBUG_ETH_UP="no"</code> to <code>
-   Add +
-{{{+
 DEBUG_ETH_UP="yes" DEBUG_ETH_UP="yes"
-}}} +</code> in ''/etc/rc.d/rc.inet1.conf'' and look for //logger// messages that are written to ''/var/log/messages''. Maybe those messages will help you trace your problem.\\ NOTE: with debugging enabled, Slackware will write your WEP/WPA keys to the message log as well, in clear text!
-   to /etc/rc.d/rc.inet1.conf and look for logger messages that are written to /var/log/messages. Maybe those messages will help you trace your problem. NOTE: with debugging enabled, Slackware will write your WEP/WPA keys to the message log as well!+
  
- * The WPA association might take a long time. +  * 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 a //start//): <code>
-   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): +
-{{{+
 /etc/rc.d/rc.inet1 ath0_start /etc/rc.d/rc.inet1 ath0_start
-}}} +</code> If this makes your wirelesss work, but the problem occurs often, you can change the 'waittime for the WPA authentication process by editing the file ''/etc/rc.d/rc.inet1.conf'' and adding the line <code> 
-   If this works, but it happens a lot, you can change the wait time for the WPA authentication process by editing the file /etc/rc.d/rc.wireless and changing the line +WLAN_WPAWAIT[?]=30 
-{{{ +</code> or any other larger value that helps your particular setup.\\ __NOTE__: in the last line make sure that you replace the questionmark in **[?]** with the array value that matches your wireless card configuration In the [[#rc.inet1.conf|above example]] this array index would be [**1**]. 
-WPAWAIT=10 + 
-}}} +  * 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).
-   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). 
  
-== Author(s) and further pointers ==+==== Author(s) and further pointers ====
  
- * The original information on this page was written by unknown author +  * The original information on this page was written by unknown author for the original DokuWiki based [[http://madwifi.org/wiki/MadWiki]] 
- * 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. +  * 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 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>. Also, fixed the bad wiki formatting caused by migration to [http://madwifi.org/about Trac].+  * 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. 
 +  * Added some configuration info for Slackware 12.0 and kernels >= 2.6.14, removed sections about the early madwifi-ng drivers.
  
-%% 

Personal Tools
sponsoring