How to set up wifi hotspot with 802.11n mode?

22,410

To have 802.11n mode, in your /etc/hostapd.conf you need the directives:

hw_mode=g
ieee80211n=1
ht_capab=[SHORT-GI-40][HT40+][HT40-][DSSS_CCK-40]

So basically, you need support for g mode, with 802.11n extensions, and the ht_capab directive is for enabling support for 40MHz. If your chipset does not support 40MHz bandwidth, comment it out.

Beware that for 40MHz bandwidth, you would better look out which channel you are using. I would suggest using a program to listen to and analyse the use of the wifi spectrum in the neighbourhood.

You can also run a command line to scan the networks being used:

sudo iwlist wlan0 scan

You can also try to put in /etc/hostapd.conf

wme_enabled=1

If it is supported, it will be faster, however some chipsets have stability problems with this last directive.

From https://en.wikipedia.org/wiki/Wireless_Multimedia_Extensions

"Wireless Multimedia Extensions (WME), also known as Wi-Fi Multimedia (WMM), is a Wi-Fi Alliance interoperability certification, based on the IEEE 802.11e standard. It provides basic Quality of service (QoS) features to IEEE 802.11 networks. WMM prioritizes traffic according to four Access Categories (AC) - voice, video, best effort, and background."

Share:
22,410

Related videos on Youtube

Betsy Riggins
Author by

Betsy Riggins

Updated on September 18, 2022

Comments

  • Betsy Riggins
    Betsy Riggins over 1 year

    I have two computers running Ubuntu 14.04 (ok, one is actually Mint 17.1, but that's based on Ubuntu 14.04), and I am looking to use one as a wi-fi hotspot for the other. Both computers have identical USB Wi-fi dongles supporting dual-band (2.4/5 GHz) 802.11a/b/g/n modes. Although I have managed to set up a hotspot, it seems limited to 54 Mbps in either g or a mode, even though the dongles are capable of 300 Mbps in n mode. It is important to me to unlock the full speed of the devices.

    What I have tried:

    On Computer 1 (which creates a hotspot):

    Open NetworkConnections, click Add, select Wi-Fi, click Create. Then fill in the SSID, set Mode to Ad-hoc, leave Band on Automatic (although I have also tried limiting to "A (5 GHz)" or "B/G (2.4 GHz)", chosse Device MAC address. In Wi-Fi Security tab, I select "WPA & WPA2 Personal", and enter a password. in "IPv4 Settings" tab, I select Method "Shared to other computers". Click Save, and connect to it.

    On Computer 2 (joins the hotspot):

    I cannot use a GUI so I set it up with nmcli.

    # nmcli dev wifi connect SSID password <password>
    

    and I'm off to the races!

    ... except I lose the race because nmcli dev wifi reports the rate as 54 Mb/s, and scp on a large file reports ~3.3 MB/s, which corresponds to 54 Mb/s at half-duplex.


    I have also tried setting up the hotspot with ap-hotspot after disabling NetworkManager on Computer 1, and I have also tried using wicd instead of Network Manager on Computer 2, but no combination seems to give me N mode/speed greater than 54 Mbps.


    Some debug output

    Computer 1

    user@computer1:$ iwconfig wlan1
    wlan1     IEEE 802.11abgn  ESSID:"MY_SSID"  
              Mode:Ad-Hoc  Frequency:2.412 GHz  Cell: AE:68:F9:9C:EA:00   
              Tx-Power=20 dBm   
              Retry  long limit:7   RTS thr:off   Fragment thr:off
              Power Management:on
    user@computer1:$ nm-tool
    
    NetworkManager Tool
    
    State: connected (global)
    
    - Device: wlan1  [MY_SSID-hotspot] --------------------------------------------
      Type:              802.11 WiFi
      Driver:            rt2800usb
      State:             connected
      Default:           no
      HW Address:        7C:DD:90:79:F2:89
    
      Capabilities:
    
      Wireless Properties
        WEP Encryption:  yes
        WPA Encryption:  yes
        WPA2 Encryption: yes
    
      Wireless Access Points (* = current AP)
        *MY_SSID:       Ad-Hoc, AE:68:F9:9C:EA:00, Freq 2412 MHz, Rate 54 Mb/s, Strength 100 WPA2
        <snip other networks, all reporting Rate 54 Mb/s>
    
      IPv4 Settings:
        Address:         10.42.0.1
        Prefix:          24 (255.255.255.0)
        Gateway:         0.0.0.0
    

    Computer 2

    user@computer2:$ iwconfig wlan1
    wlan1     IEEE 802.11abgn  ESSID:"MY_SSID"  
              Mode:Ad-Hoc  Frequency:2.412 GHz  Cell: AE:68:F9:9C:EA:00   
              Tx-Power=20 dBm   
              Retry  long limit:7   RTS thr:off   Fragment thr:off
              Power Management:off
    user@computer2:$ nm-tool
    
    NetworkManager Tool
    
    State: connected (global)
    
    - Device: wlan1  [MY_SSID] ----------------------------------------------------
      Type:              802.11 WiFi
      Driver:            rt2800usb
      State:             connected
      Default:           yes
      HW Address:        7C:DD:90:6C:2B:23
    
      Capabilities:
    
      Wireless Properties
        WEP Encryption:  yes
        WPA Encryption:  yes
        WPA2 Encryption: yes
    
      Wireless Access Points (* = current AP)
        *MY_SSID:       Ad-Hoc, AE:68:F9:9C:EA:00, Freq 2412 MHz, Rate 54 Mb/s, Strength 100 WPA2
    
      IPv4 Settings:
        Address:         10.42.0.88
        Prefix:          24 (255.255.255.0)
        Gateway:         10.42.0.1
    
        DNS:             10.42.0.1
    
    • Fabby
      Fabby over 9 years
      Have you tried limiting the hotspot to N only and giving it a fixed channel?
    • Betsy Riggins
      Betsy Riggins over 9 years
      @Fabby I haven't seen any way to select N mode. Also, N only gets a performance boost over G or A when using multiple channels, and my understand is that it somehow auto-selects the least congested ones, so I don't think I would have anything to gain by limiting the channel selection.
    • Fabby
      Fabby over 9 years
      What is the output of iwconfig and nm-tool (Use paste.ubuntu.com to paste info and provide link back into comments)
    • Betsy Riggins
      Betsy Riggins over 9 years
      @Fabby See edit.
    • Fabby
      Fabby over 9 years
      Weird. What encryption are you using? AES?
  • Betsy Riggins
    Betsy Riggins over 9 years
    I already tried ap-hotspot, and the hotspot worked, but it was limited to G (54 Mbps) mode. How do I use N mode?
  • texasflood
    texasflood over 9 years
    Sorry didn't read that part, I don't know how to use n mode
  • Betsy Riggins
    Betsy Riggins over 8 years
    Thanks, I'll give this a try when I get a chance, maybe next week. Regarding WME, how does the driver/wifi chip know what kind of data is going through? Is there a way for me to indicate the type of data?
  • Rui F Ribeiro
    Rui F Ribeiro over 8 years
    It seems to work automagically. The fact is that listening to wifi (and/or tcpdump, cant remember at the moment), you see new data (the QoS) there. Even in single use it turns the browsing experience faster, as it avoids using up all the bandwidth of the medium.
  • Giles Bathgate
    Giles Bathgate over 6 years
    I don't think you can pair up both [HT40+] and also [HT40-] like that. The documentation here w1.fi/cgit/hostap/plain/hostapd/hostapd.conf seems to suggest you would use one or the other.
  • Rui F Ribeiro
    Rui F Ribeiro over 6 years
    @GilesBathgate I am using that setup in an old hostapd server that is not running anymore.