--- a/docs/README.madwifi +++ a/docs/README.madwifi @@ -0,0 +1,61 @@ + -*- outline -*- +* MADWIFI/wlanconfig & etcnet + +Starting from 0.9.6, etcnet contains another approach +for handling atheros/madwifi cards, allowing more precise +control over various operational modes, including master one, +achieved by separate iface declarations for link/ieee802.11 +and one or more enslaved link/ether (also called VAPs) layers. +This approach can be selected by TYPE set to `wlan' for enslaved +link/ether iface(s), other options in this mode could be: +HOST= +MODE= + +See also wlanconfig(8) for more detailed discussion. + +Setup for bridged AP mode, ready for use with hostapd, follows: + +** disallow autocreate link/ether (mandatory) +# grep ath_pci /etc/modprobe.d/options +options ath_pci autocreate=none +# + +** link/ieee802.11 iface (optional) +# cat /etc/net/ifaces/wifi0/options +TYPE=eth +# + +** link/ether (VAP) iface(s): +# cat /etc/net/ifaces/wlan/options +TYPE=wlan +HOST=wifi0 +MODE=ap +# + +** bridge iface, including wlan one: +# cat /etc/net/ifaces/br0/options +TYPE=bri +HOST='wan lan wlan' +# + +** sample hostapd configuration +# grep -v '^\(#\|ssid\|wpa_pass\|$\)' /etc/hostapd/hostapd.conf +interface=wlan +bridge=br0 +driver=madwifi +logger_syslog=-1 +logger_syslog_level=2 +logger_stdout=-1 +logger_stdout_level=2 +debug=0 +dump_file=/root/tmp/hostapd.dump +ctrl_interface=/var/run/hostapd +ctrl_interface_group=0 +macaddr_acl=1 +auth_algs=3 +eapol_version=1 +eapol_key_index_workaround=0 +eap_server=0 +wpa=3 +wpa_key_mgmt=WPA-PSK +wpa_pairwise=TKIP CCMP --- a/etc/net/options.d/00-default +++ a/etc/net/options.d/00-default @@ -67,6 +67,6 @@ AUTO_BROADCAST=off IFGROUP[0]='lo dummy' IFGROUP[1]='eth plip usb dvb bnep tuntap' -IFGROUP[2]='vlan bond bri teql' +IFGROUP[2]='vlan bond bri teql wlan' IFGROUP[3]='iptun ipsectun ovpn ossh' IFGROUP[4]='ppp' --- a/etc/net/scripts/create-wlan +++ a/etc/net/scripts/create-wlan @@ -0,0 +1,13 @@ +#!/bin/bash + +pickup_defaults +pickup_options + +[ -x "${WLANCONFIG:=$DEFAULT_WLANCONFIG}" ] || { + print_error "$WLANCONFIG does not exist or is not executable. Try installing madwifi-utils RPM." + exit 1 +} + +: ${HOST:?HOST is missing for $NAME} + +$WLANCONFIG $NAME create nounit wlandev "$HOST" wlanmode "${MODE:=sta}" > /dev/null --- a/etc/net/scripts/destroy-wlan +++ a/etc/net/scripts/destroy-wlan @@ -0,0 +1,11 @@ +#!/bin/bash + +pickup_defaults +pickup_options + +[ -x "${WLANCONFIG:=$DEFAULT_WLANCONFIG}" ] || { + print_error "$WLANCONFIG does not exist or is not executable. Try installing madwifi-utils RPM." + exit 1 +} + +$WLANCONFIG $NAME destroy --- a/etc/net/scripts/functions +++ a/etc/net/scripts/functions @@ -17,6 +17,7 @@ DEFAULT_IFPLUGSTATUS=/usr/sbin/ifplugstatus DEFAULT_IFPLUGD=/usr/sbin/ifplugd DEFAULT_IWPRIV=/sbin/iwpriv DEFAULT_IWCONFIG=/sbin/iwconfig +DEFAULT_WLANCONFIG=/usr/sbin/wlanconfig DEFAULT_WPA_SUPPLICANT=/usr/sbin/wpa_supplicant DEFAULT_WPA_CLI=/usr/sbin/wpa_cli DEFAULT_PLIPCONFIG=/sbin/plipconfig @@ -555,7 +556,7 @@ declare -frx stop_ipv4ll_client modprobe_with_rename modprobe_tuntap declare -frx eval_string kill_by_pidfile declare -rx DENOISE DEFAULT_BONDMODE IFACEDIR LOCALSCRIPTDIR VARLIBDIR declare -rx VLANTAB HOSTTAB IFTAB PROFILE_FILE PROC_CMDLINE DEFAULT_IFPLUGSTATUS -declare -rx DEFAULT_IFPLUGD DEFAULT_IWCONFIG DEFAULT_WPA_SUPPLICANT DEFAULT_WPA_CLI DEFAULT_PLIPCONFIG +declare -rx DEFAULT_IFPLUGD DEFAULT_IWCONFIG DEFAULT_WLANCONFIG DEFAULT_WPA_SUPPLICANT DEFAULT_WPA_CLI DEFAULT_PLIPCONFIG declare -rx DEFAULT_IWPRIV DEFAULT_VCONFIG DEFAULT_PENTANETT DEFAULT_PENTAVALT DEFAULT_PENTANET_CONF declare -rx DEFAULT_PENTAVAL_CONF DEFAULT_IPSECADM DEFAULT_IFENSLAVE DEFAULT_BRCTL declare -rx DEFAULT_ETHTOOL DEFAULT_PPPD DEFAULT_CHAT DEFAULT_PPPOPTIONSFILE