Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've been trying to create an access point using hostapd, but I get an error message saying that my card doesn't support AP mode. I tried sudo iwconfig eth1 mode master and I get the following error:

Error for wireless request "Set Mode" (8B06) :
    SET failed on device eth1 ; Invalid argument.

How do I get Ubuntu to recognize the card's AP mode function? Because it clearly supports access point mode as it works perfectly with Connectify on Windows.

My card is:

03:00.0 Network controller: Broadcom Corporation BCM4313 802.11bgn Wireless Network Adapter (rev 01)
share|improve this question
    
I guess the driver might not support AP mode. –  Ramchandra Apte Oct 13 '13 at 7:55
add comment

1 Answer

Access Point mode Hotspot on BCM4313

BCM4313 can operate on AP mode using brcmsmac driver, starting from 3.10 linux kernel onwards. For a very long time, BCM4313 didn't have AP mode support under any linux driver. But now, you got lucky, coz both AdHoc(IBSS) and AP mode have been implemented for brcmsmac. So, for making AP mode work for BCM4313, you need a linux kernel newer than 3.10. Use Ubuntu 12.04.4, Ubuntu 13.10 or a newer release. If you're using a Ubuntu 12.04LTS version older than 12.04.4, install the package linux-generic-lts-saucy . For more details about upgrading 12.04LTS's kernel, visit this link.
Once you have a suitable kernel, make sure you are not running other Broadcom drivers like bcmwl-kernel-source,b43,etc. If yes, uninstall them. No need to explicitly install brcmsmac, as it is already a preinstalled module in the linux kernel. Now, create Access Point hotspot according to this answer. This is a custom hostapd configuration I use with BCM4313 :

#####Basic Settings########################
#sets the wifi interface to use, is wlan0 in most cases
interface=wlan0
#driver to use, nl80211 works in most cases
driver=nl80211
#Access Point name
#Replace it with ssid=<YourHotspotName>
ssid=HEXspot

#####Channel and Mode Settings#############
# Operation mode (a = IEEE 802.11a, b = IEEE 802.11b, g = IEEE 802.11g,
# ad = IEEE 802.11ad (60 GHz); a/g options are used with IEEE 802.11n, too, to
# specify band)
# Default: IEEE 802.11b
hw_mode=g
# WiFi Channel:
channel=11

##### IEEE 802.11n related configuration ##
#WMM needs to be enabled for full HT functionality
wmm_enabled=1
# ieee80211n: Whether IEEE 802.11n (HT) is enabled
# 0 = disabled (default)
# 1 = enabled
# Note: You will also need to enable WMM for full HT functionality.
ieee80211n=1
# ht_capab: HT capabilities (list of flags)
# LDPC coding capability: [LDPC] = supported
# Supported channel width set: [HT40-] = both 20 MHz and 40 MHz with secondary
#   channel below the primary channel; [HT40+] = both 20 MHz and 40 MHz
#   with secondary channel below the primary channel
#   (20 MHz only if neither is set)
#   Note: There are limits on which channels can be used with HT40- and
#   HT40+. Following table shows the channels that may be available for
#   HT40- and HT40+ use per IEEE 802.11n Annex J:
#   freq        HT40-       HT40+
#   2.4 GHz     5-13        1-7 (1-9 in Europe/Japan)
#   5 GHz       40,48,56,64 36,44,52,60
#   (depending on the location, not all of these channels may be available
#   for use)
#   Please note that 40 MHz channels may switch their primary and secondary
#   channels if needed or creation of 40 MHz channel maybe rejected based
#   on overlapping BSSes. These changes are done automatically when hostapd
#   is setting up the 40 MHz channel.
# Spatial Multiplexing (SM) Power Save: [SMPS-STATIC] or [SMPS-DYNAMIC]
#   (SMPS disabled if neither is set)
# HT-greenfield: [GF] (disabled if not set)
# Short GI for 20 MHz: [SHORT-GI-20] (disabled if not set)
# Short GI for 40 MHz: [SHORT-GI-40] (disabled if not set)
# Tx STBC: [TX-STBC] (disabled if not set)
# Rx STBC: [RX-STBC1] (one spatial stream), [RX-STBC12] (one or two spatial
#   streams), or [RX-STBC123] (one, two, or three spatial streams); Rx STBC
#   disabled if none of these set
# HT-delayed Block Ack: [DELAYED-BA] (disabled if not set)
# Maximum A-MSDU length: [MAX-AMSDU-7935] for 7935 octets (3839 octets if not
#   set)
# DSSS/CCK Mode in 40 MHz: [DSSS_CCK-40] = allowed (not allowed if not set)
# PSMP support: [PSMP] (disabled if not set)
# L-SIG TXOP protection support: [LSIG-TXOP-PROT] (disabled if not set)
ht_capab=[HT40][GF][SHORT-GI-40][SHORT-GI-20]
# Require stations to support HT PHY (reject association if they do not)
require_ht=1

#####Security and Authentication###########
#macaddr_acl sets options for mac address filtering. 0 means "accept unless in deny list"
macaddr_acl=0
#Sets authentication algorithm
#1 - only open system authentication
#2 - both open system authentication and shared key authentication
auth_algs=1
#setting ignore_broadcast_ssid to 1 will disable the broadcasting of ssid
ignore_broadcast_ssid=0

#####Sets WPA and WPA2 authentication######
#wpa option sets which wpa implementation to use
#1 - wpa only
#2 - wpa2 only
#3 - both
wpa=2
#sets WPA Password required by the clients to authenticate themselves on the network
#Replace it with wpa_passphrase=<Password you wish to use>
wpa_passphrase=anything
#sets wpa key management
wpa_key_mgmt=WPA-PSK
#sets encryption used by WPA2
rsn_pairwise=CCMP

This configuration enables hostapd to start 802.11n mode Access Point for BCM4313. You may use this instead of the generic g-mode configuration described here.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.