PIROVANO
1 Alix Slackware
1.3 Wireless Access-Point
This ONLY applies if you have an Atheros based WLAN module! Please refer to www.madwifi.org and/or www.madwifi-project.org.
Note
In my case it's a quite new Atheros Communications Inc. AR5413 802.11abg
NIC, which isn't fully supported by the below driver:
11a OK but fails after ~1
day.
11b OK but not used long enough beeing able to judge (switched to OpenBSD).
Old Atheros AR52** must most probably work as expected.
madwifi
Obtain the madwifi-driver r3878 from here, mirror for Slackware 12.1, or here, mirror for Slackware 12.2.
Example: wget www.pirovano.ch/madwifi-r3878_20081204_2.6.27.7_smp-i486-1alien.tgz
Install: installpkg madwifi-r3878_20081204_2.6.27.7_smp-i486-1alien.tgz
vi /etc/modprobe.d/ath_pci
###options ath_pci autocreate=none
options ath_pci autocreate=ap countrycode=XXX #See here for your country.
:write :quit
##echo "/sbin/modprobe ath_pci" >> /etc/rc.d/rc.modules
echo "alias ath0 ath_pci" >> /etc/modprobe.d/ath_pci
vi /etc/rc.d/rc.inet1.conf
IFNAME[4]="ath0"
IPADDR[4]="192.168.10.1" #Put here your desired IP-Address for your AP.
NETMASK[4]="255.255.255.0"
:write :quit
mv /etc/rc.d/rc.wireless /etc/rc.d/rc.wireless.bak
chmod -x /etc/rc.d/rc.wireless.bak
vi /etc/rc.d/rc.wireless
#############################################################
ESSID="myessid"
CHANNEL="40" #Prompt "iwlist ath0 chan" and "wlanconfig ath0 list freq" for more channels.
KEY="off" #Example-Key: "1234567890987654321abcdef0"
#############################################################
#############################################################
INTERFACE=$1
FUNCTION=$2
is_wireless_device ()
{
if ! grep `echo ${1}: | cut -f 1 -d :`: /proc/net/wireless 1> /dev/null ; then
return 1
else
return 0
fi
}
is_wireless_device ${INTERFACE} || return 0 2> /dev/null || exit 0
if [ "${FUNCTION}" = "start" ] ; then
iwconfig ${INTERFACE} essid ${ESSID}
iwconfig ${INTERFACE} channel ${CHANNEL}
iwconfig ${INTERFACE} key ${KEY}
fi
if [ "${FUNCTION}" = "stop" ] ; then
##iwconfig ${INTERFACE} essid off
##iwconfig ${INTERFACE} key off
madwifi-unload
fi
:write :quit
chmod +x /etc/rc.d/rc.wireless
DHCP for WLAN-Clients
vi /etc/dhcpd.conf
default-lease-time 86400 ;
max-lease-time 604800 ;
ddns-update-style ad-hoc ;
#ddns-updates on;
#option ip-forwarding off;
#ignore client-updates ;
subnet 192.168.10.0 netmask 255.255.255.0 {
option routers 192.168.10.1;
#option subnet-mask 255.255.255.0;
#option broadcast-address 192.168.10.255;
option domain-name-servers 192.168.10.1;
range 192.168.10.200 192.168.10.240;
}
put dhcpd into /etc/rc.d/rc.local in order to run at startup.
Let's get WLAN accessible
You either reboot
OR
##modprobe ath_pci
/etc/rc.d/rc.inet1 ath0_start
dhcpd
Note: By manually restarting ath0, dhcpd should also be restartet: /etc/rc.d/rc.inet1 ath0_restart && killall dhcpd && dhcpd
MAC Address Filter
put
iptables -A INPUT -i ath0 -m mac --mac-source 00:00:00:00:00:00 -j ACCEPT #Replace 00:00:00:00:00:00 with your clients MAC
iptables -A INPUT -i ath0 -j DROP
iptables -A FORWARD -i ath0 -m mac --mac-source 00:00:00:00:00:00 -j ACCEPT
iptables -A FORWARD -i ath0 -j DROP
into /etc/rc.d/rc.firewall
Re-run the script
/etc/rc.d/rc.firewall
Copyright 2009 pirovano.ch. Last modified 2009-08-13 1140 CEST.
E-Mail: pirovano(at)[this-very-domain]