A wifi AP with a single NIC
In case anyone comes here to identify "STA/AP BI must match":
The kernel source in include/net/cfg80211.h
, in particular struct ieee80211_iface_combination
, says
* @beacon_int_infra_match: In this combination, the beacon intervals
* between infrastructure and AP types must match. This is required
* only in special cases.
So BI is the beacon interval, and getting that to match shouldn't be a big problem.
Actually, the mysterious sentence
STA/AP BI must match
seems to have nothing to do with my setup not working. It turns out instead that
#channels <= 1
was the key to make it work. I eventually understood it means I can use only one channel when I have two vif's on the same physical device (my Intel Centrino, at any rate), one in AP, the other in Station mode. So I switched the channel in the hostapd conf file, to the same I was trying to connect to, and I had no error messages.
At this point I configured iptables, started dnsmasq, then hostapd by means of
echo 1 >/proc/sys/net/ipv4/ip_forward
iptables --table nat --append POSTROUTING --out-interface new0 -j MASQUERADE
iptables --append FORWARD --in-interface new1 -j ACCEPT
dnsmasq
/usr/local/bin/hostapd /etc/hostapd/hostapd.conf
and then I had it, a single wifi card working symultaneously as Access Point and client to a network connected to the Internet.