4

https://github.com/Phoenix1747/RouteryPi contains instructions for using a Rasberry Pi as a wireless router for 2.4Ghz networks.

How can I change this to get 5Ghz? I tried to change hw_mode to ac, but that doesn't seem to work. Where can I get decent information on the parameters in the hostapd config file, and how do I write a good config file?

1
  • I gather my answer didn't help at all Nov 26, 2018 at 0:38

2 Answers 2

14

TL;DR

use

hw_mode=a

I see that the man pages for hostapd are quite useless

I found a more useful page https://wiki.gentoo.org/wiki/Hostapd with the following example

802.11a/n/ac with WPA2-PSK and CCMP

A simple but secure AP for recent hardware:
FILE /etc/hostapd/hostapd.conf

interface=wlan0       # the interface used by the AP
hw_mode=a             # a simply means 5GHz
channel=0             # the channel to use, 0 means the AP will search for the channel with the least interferences 
ieee80211d=1          # limit the frequencies used to those allowed in the country
country_code=FR       # the country code
ieee80211n=1          # 802.11n support
ieee80211ac=1         # 802.11ac support
wmm_enabled=1         # QoS support

ssid=somename         # the name of the AP
auth_algs=1           # 1=wpa, 2=wep, 3=both
wpa=2                 # WPA2 only
wpa_key_mgmt=WPA-PSK 
rsn_pairwise=CCMP
wpa_passphrase=somepassword

with the useful comment

hw_mode=a             # a simply means 5GHz

Please note: apparently later versions (v2.6+) of hostapd do NOT like inline comments in the config file

4
  • raspberrypi.org/documentation/configuration/wireless/… also contains some useful documentation on the configuration file Apr 12, 2020 at 8:42
  • 1
    FYI; on hostapd v2.6 it doesn't like inline comments specifically for the hw_mode line; Configuration file: /etc/hostapd/hostapd.conf Line 5: unknown hw_mode 'a # a = 5Ghz, g = 2.4Ghz (apparently)' HT (IEEE 802.11n) in 11b mode is not allowed, disabling HT capabilities 1 errors found in configuration file '/etc/hostapd/hostapd.conf'
    – sirlark
    Jan 26, 2021 at 15:18
  • 1
    I used "channel=0" and never saw the AP. The service would exit after a short time with no errors. Mar 25, 2021 at 5:02
  • @electron1979 - of course, this answer is almost 2.5 years old - things change Mar 25, 2021 at 5:12
1

My hostapd.conf in raspberry pi 3B plus with raspbian stretch:

interface=wlan0
ssid=pi-5G
macaddr_acl=0
ignore_broadcast_ssid=0

## 2.4G
#hw_mode=a
#channel=7


## 5G
hw_mode=a
channel=36
country_code=US
ieee80211d=1
ieee80211n=1
ieee80211ac=1
wmm_enabled=1


## wpa auth
auth_algs=1
wpa=2
wpa_passphrase=11111111
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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