HostAPD
Zur Navigation springen
Zur Suche springen
Installation[Bearbeiten]
apt-get install hostapd bridge-utils iw dnsmasq perl -pi -e 's!^#DAEMON_CONF=.*!DAEMON_CONF="/etc/hostapd/hostapd.conf"!' /etc/default/hostapd
Variante ohne Bridge[Bearbeiten]
FN=/etc/hostapd/hostapd.conf SID=rex-regio CODE=geheim test -e $FN && mv $FN $FN.$(date "+%Y%m%d.%H%M%S") cat >$FN <<EOS # interface used by access point interface=wlan0 # firmware driver driver=nl80211 # access point SSID ssid=$SID # operation mode (a = IEEE 802.11a, b = IEEE 802.11b, g = IEEE 802.11g) hw_mode=g # access point channel channel=6 macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 # key management algorithm wpa_key_mgmt=WPA-PSK wpa_passphrase=$CODE wpa=2 # set ciphers wpa_pairwise=TKIP rsn_pairwise=CCMP EOS
Passende Firewall-Regeln:
FN=/etc/hostapd/fw_rules.ap cat >$FN <<'EOS' # Generated by iptables-save v1.4.14 on Wed Jul 30 19:27:46 2014 *filter :INPUT ACCEPT [10:882] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [6:865] -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT -A FORWARD -i wlan0 -o eth0 -j ACCEPT COMMIT # Completed on Wed Jul 30 19:27:46 2014 EOS iptables-restore $FN
Variante mit Bridge[Bearbeiten]
FN=/etc/hostapd/hostapd.conf SID=rex-regio CODE=geheim test -e $FN && mv $FN $FN.$(date "+%Y%m%d.%H%M%S") cat >$FN <<EOS interface=wlan0 bridge=br0 driver=nl80211 country_code=DE ssid=$SID hw_mode=g channel=6 wpa=2 wpa_passphrase=$CODE wpa_key_mgmt=WPA-PSK ieee80211n=1 wmm_enabled=1 EOS