ATIX AG
  • Services
    • Consulting
      • Linux Platform Operations​
      • Infrastructure Automation
      • Container Platforms and Cloud
      • DevOps Processes, Tooling and Culture
      • Cloud Native Software Development
    • Products
      • orcharhino
        • About orcharhino
        • Support
        • orcharhino operation
      • Hangar
        • About Hangar
        • Hangar Roadmap
        • Hangar Community
    • Technologies
      • Ansible
      • Docker
      • Foreman
      • GitLab
      • Istio
      • Kubernetes
      • Linux Distributions
      • OpenShift
      • Puppet
      • OpenVox
      • Rancher
      • Rundeck
      • SaltStack
      • SUSE Manager
      • Terraform
  • Trainings
    • Ansible Training
    • Container Training
    • Docker Training
    • Git Training
    • Go Training (Golang)
    • Istio Training
    • Kubernetes Training
    • OpenShift Training
    • orcharhino Training
    • Puppet Trainings
    • Terraform Training
  • Events
    • Webinars
  • Blog
  • Company
    • About Us
    • References
    • Corporate values
    • Social engagement
    • Newsroom
    • Newsletter
    • Contact us
  • Career
  • Search
  • Menu Menu

How to install a WLAN access point on Fedora

Sometimes you need a configurable access point on a Fedora desktop. In this blog article, we describe how to do this in a few simple steps.

ATTENTION: Now comes a lot of code!

First steps

First you have to install the required software:
yum install hostapd dnsmasq

The WLAN adapter is then configured. First you need to check whether the adapter is online:

[root@seger~]# iwconfig
wlan0 IEEE 802.11bgn ESSID: off/any
Mode: Managed Access Point: Not-Associated Tx-Power=0 dBm
Retry short limit: 7 RTS thr:off Fragment thr:off
Encryption key: off
Power Management: off

lo no wireless extensions.
eth0 no wireless extensions.

Now you need to check whether the Network Manager (NM) has control over the device:

[root@seger~] # nmcli -p r
======================================
Radio switches
======================================
WIFI-HW WIFI WWAN-HW WWAN
--------------------------------------
enabled enabled enabled disabled

If it is activated, it must be deactivated with the nmcli:

[root@seger~] # nmcli r wifi off

The NM sets the killswitch to “on”, so we have to set it to off again to reactivate the WLAN outside the NM.

[root@seger~] # rfkill unblock wlan

After this step, we have an active WLAN card without interference from the NM.

Configure hostapd

The configuration file is located in /etc/hostapd/hostapd.conf. Here are useful settings to enable WPA2 with TKIP-CCMP:

# Einige verwendbare Standardeinstellungen ...
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
# Kommentieren Sie diese für Basis WPA & WPA2-Unterstützung mit einem Pre-Shared Key
wpa=3
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
# NICHT VERGESSEN EIN WPA-PASSPHRASE EINZURICHTEN!!
wpa_passphrase=
# Die meisten modernen WLAN-Treiber im Kernel benötigen driver=nl80211
driver=nl80211
# Passen Sie diese Einstellungen für Ihre lokale Konfiguration an...
interface=wlan0
hw_mode=g
channel=
ssid=
ieee80211n=1

After that the whole thing can be started:

[root@seger ~] # systemctl start hostapd.service
[root@seger~] # systemctl status hostapd.service
hostapd.service - Hostapd IEEE 802.11 AP, IEEE 802.1X / WPA / WPA2 / EAP / RADIUS Authenticator
Loaded: geladene (/usr/lib/systemd/system/hostapd.service; disabled)
Aktiv: aktiv (läuft), da Fr 2014.08.01 13.24.08 CEST; Vor 4s
Prozess: 12208 ExecStart=/usr/sbin/hostapd/etc/hostapd/hostapd.conf -P /run/hostapd.pid -B (code=exited, status=0/SUCCESS)
Haupt PID: 12209 (hostapd)
CGroup: /system.slice/hostapd.service
└─12209 /usr/sbin/hostapd/etc/hostapd/hostapd.conf -P /run/hostapd.pid -B
1. August 13.24.08 seger systemd[1]: Gestartet Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator.

Configure DNSMASQ

Dnsmasq is a combination DHCP/DNS server with a low memory requirement. The configuration is in /etc/dnsmasq/dnsmasq.conf.

The main configuration options:

server=10.159.14.14 # Upstream DNS

interface=wlan0
dhcp-range=192.168.23.50,192.168.23.150,12h
no-resolv
no-Umfrage

Configure firewall

Fedora 20 comes with firewalld that can dynamically adjust iptables rules. For our setup, we need to be able to access the outside network, DNS and DHCP access and IP forwarding from wlan0:

# Setzen Sie die Schnittstelle in einer Zone
firewall-cmd --zone=public --add-interface=wlan0
# MASQ Aktivieren für diese Zone
firewall-cmd --zone=public --add-masquerade
# Lassen Sie DHCP
firewall-cmd --zone=public --add-service=dhcp
# Zulassen DNS
firewall-cmd --zone=public --add-service=dns

Connect everything

Once all services have been configured, a small script is all that is needed to run the whole thing:

#!/bin/bash
# WLAN sollte nicht mehr von Network Manager verwaltet werden
nmcli r wifi off
# WLAN Entblocken 
rfkill unblock wlan
# Rufen Sie die Schnittstelle aufifconfig wlan0 192.168.23.1 Netzmaske 255.255.255.0 up
# IP forward aktivieren
## -> bereits aktiviert!
# Setzen Sie die Schnittstelle in einer Zone
firewall-cmd --zone=public --add-interface=wlan0
# MASQ für diese Zone aktivieren
firewall-cmd --zone=public --add-masquerade
# DHCP erlauben
firewall-cmd --zone=public --add-service=dhcp
# DNS erlauben
firewall-cmd --zone=public --add-service=dns
# hostapd und dnsmasq startensystemctl start hostapd.service
systemctl start dnsmasq.service

That’s it, have fun with the WLAN access point!

You might also like
Migrating Git
fpm – the fast track to the parcel
Terraform vs. OpenTofuTerraform vs. OpenTofu: Which solution is right for your company?
orcharhinoMigrating CentOS 8 to Rocky Linux 8 or AlmaLinux 8 using orcharhino
Btrfs vs ZFS: Die Zukunft der Dateisysteme ATIX BlogBtrfs vs ZFS: The future of file systems
Registers and Macros in Vim
ATIX-Team
+ postsBio
  • ATIX-Team
    https://atix.de/en/blog/author/atixadmin/
    Sphinx
  • ATIX-Team
    https://atix.de/en/blog/author/atixadmin/
    Docker: Storing apps in containers
  • ATIX-Team
    https://atix.de/en/blog/author/atixadmin/
    Docker: Composition of containers
  • ATIX-Team
    https://atix.de/en/blog/author/atixadmin/
    What can you actually do with the Foreman REST API?
Expertise that Drives your IT Forward

🛠️ Boost your skills?
Learn from those who do it every day. Professional training for modern IT.
👉 Browse trainings »

🔔 Technology. Trends. Dates.
Stay up to date with the latest IT developments and upcoming events. Subscribe now and stay informed.
👉 Subscribe to our newsletter »

ISO Certified Certificate
Newsletter
Never miss anything again. Sign up for the ATIX newsletter!
Sign up now
Blog
  • Blog Start Page
  • ATIX Insights
  • Cloud Native
  • Container Plattformen und Cloud
  • DevOps
  • Hangar
  • Infrastructure Automation
  • Linux Platform Operations
  • orcharhino
Privacy & Legal

Privacy Policy

Imprint

Terms and Conditions

B2B

Twitter     Facebook    LinkedIn    Xing     Youtube     mastodon=

© Copyright – ATIX AG

Scroll to top