This tutorial provides a simple (or almost simple) experience as base for setting up a wireless access point using a PC equiped with an 802.11a or 802.11b/g WiFi card and, of course, Slackware-Linux.

Bill of materials (in this experience ;) )

HP Pavilion dv5000
CPU AMD Sempron(tm) Processor 3300+
WLAN BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller
Slackware 13.1.0
hostapd v0.7.3
Network configuration
eth0, with Internet access
wlan0 as wireless Access Point

Testing wireless card capability

iw list

Wiphy phy0
        Band 1:
                        * 2412 MHz [1] (20.0 dBm)
                        * 2417 MHz [2] (20.0 dBm)
                        * 2422 MHz [3] (20.0 dBm)
                        * 2427 MHz [4] (20.0 dBm)
                        * 2432 MHz [5] (20.0 dBm)
                        * 2437 MHz [6] (20.0 dBm)
                        * 2442 MHz [7] (20.0 dBm)
                        * 1.0 Mbps
                        * 36.0 Mbps
                        * 48.0 Mbps
                        * 54.0 Mbps
        max # scan SSIDs: 4
        Supported interface modes:
                 * IBSS
                 * managed
                 * AP
                 * AP/VLAN
                 * WDS
                 * monitor
                 * mesh point

In Supported interface modes: * AP ... ok!

Install and configure hostapd

To set our wireless card as AP we will use hostapd, a user space daemon for access point and authentication servers. Hostapd releases and other tools are here: hostap.epitest.fi.

I've installed hostapd v.0.7.3, the SBo slackbuild is out of date, you can use this: File:Hostapd.slackbuild.tar.gz (hostapd-0.7.3 slackbuild rev.2, with 802.11n support). Unpack and do:

cd hostapd.slackbuild
installpkg /tmp/hostapd-0.7.3-i486-1_SBo.tgz

Parameters I've set in /etc/hostapd/hostapd.conf:


Install and configure DHCP service

Many wireless clients needs DHCP to get network configuration, so we must install dhcpd service (available only in network wlan0, in this example). This is a suitable /etc/dhcpd.conf

ddns-update-style none;
default-lease-time -1;
max-lease-time 7200;
# default gateway
option routers;
option subnet-mask;
option broadcast-address;
option domain-name-servers;
subnet netmask
 range dynamic-bootp;
 option host-name "Wifi";
 group customIP
  host pc-01  { hardware ethernet 00:11:22:33:44:55 ; fixed-address ; }

If service script is missing in your Slackware installation, use this /etc/rc.d/rc.dhcpd:

# /etc/rc.d/rc.dhcpd
# Start/stop/restart the DHCP server.
# To make DHCP daemon start automatically at boot, make this
# file executable:  chmod 755 /etc/rc.d/rc.dhcpd
case "$1" in
      /usr/sbin/dhcpd ;;
      killall -s 9 dhcpd ;;
      killall -s 9 dhcpd
      /usr/sbin/dhcpd  ;;
      echo "usage $0 start|stop|restart" ;;

Starting Access Point script


modprobe b43 qos=0
ifconfig $WLAN_DEV $WLAN_IP
iwconfig $WLAN_DEV txpower 20dBm
echo 1 > /proc/sys/net/ipv4/ip_forward
touch /var/lock/subsys/local
modprobe ip_nat_ftp
modprobe ip_conntrack_ftp
iptables -t nat -A POSTROUTING -s $WLAN_IP/24 -d 0/0 -o eth0 -j MASQUERADE
/etc/rc.d/rc.hostapd start
/etc/rc.d/rc.dhcpd restart 2> /dev/null

The card needs firmware to work as AP

output of dmesg when hostapd starts:

b43 ssb0:0: firmware: requesting b43/ucode5.fw
b43 ssb0:0: firmware: requesting b43/pcm5.fw
b43 ssb0:0: firmware: requesting b43/b0g0initvals5.fw
b43 ssb0:0: firmware: requesting b43/b0g0bsinitvals5.fw
b43-phy0: Loading firmware version 508.154 (2009-08-18 00:58:22)

Device firmware installation

To get and install firmware a reference guide is here: linuxwireless.org

As noted in linuxwireless.org site, often the firmware extracted from the binary driver is copyrighted by the manifacturing company and cannot be redistributed in this form. You must download the specific driver for your wireless card and use tools as b43-fwcutter (b43-tools). This works in case of the BCM4318 chipset:

tar -xjf broadcom-wl-
b43-fwcutter --unsupported broadcom-wl-
cp -Rv b43 /lib/firmware/

Results and notes


This realization has shown exceptional results: the radio range is similar to a true access point device, the system is also very stable with high performance with multiple clients connected.

Other wireless cards tested

Wireless adapter Standards tested Driver Notes
Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01) 802.11g b43, ath9k
ID 148f:3070 Ralink Technology, Corp. RT2870/RT3070 Wireless Adapter (USB) 802.11g/n rt2800usb, mac80211 short range
ID 1737:0079 Linksys WUSB600N v2 Dual-Band Wireless-N Network Adapter [Ralink RT3572] 802.11a/g cfg80211, rt2800usb work only with kernel 3+

Zoros 17:41, 2 February 2012 (CET)

Retrieved from "http://www.zoros.org/wiki/index.php?title=Using_your_Slackware_Linux_box_as_wireless_AP"