kravietz.hostapd
Role Name
=========
This role sets up and configures hostapd
using systemd.service
, supporting all configuration options.
Requirements
None.
Role Variables
Interface: This is the network interface for running
hostapd
. It will start the[email protected]
insystemd
.hostapd_interface: wlan1
hostapd_config: This dictionary will directly translate into the
hostapd
configuration file. You can check the hostapd.conf reference for more details on each option:hostapd_config: country_code: GB bridge: br0 interface: "{{ hostapd_interface }}" driver: nl80211 ssid: "MyWLAN" hw_mode: g channel: 9 wmm_enabled: 0 macaddr_acl: 0 auth_algs: 1 wpa: 2 wpa_passphrase: "OhGae6hay0rooRi0poo7" # protect this with ansible-vault wpa_key_mgmt: WPA-PSK WPA-PSK-SHA256 wpa_pairwise: TKIP CCMP rsn_pairwise: CCMP ctrl_interface: /var/run/hostapd
Dependencies
If you are connecting a WiFi network to a LAN, you may also want to set up a bridge using the shibumi.systemd-conf role. Here’s an example:
systemd_conf_network:
10-lan:
- Match:
- Name: br0
- Network:
- Address: '192.168.1.251/24'
- Gateway: '192.168.1.252'
20-eth:
- Match:
- Name: eth0
- Network:
- Bridge: br0
systemd_conf_netdev:
10-bridge:
- NetDev:
- Name: br0
- Kind: bridge
Example Playbook
Here’s an example assuming the above configuration is in host_vars
:
- hosts: access_point
roles:
- kravietz.hostapd
- shibumi.systemd-conf
License
GPLv3
Author Information
Paweł Krawczyk https://krvtz.net/
Informazioni sul progetto
Role to set up and configure `hostapd` using `systemd.service` that supports all configuration options.
Installa
ansible-galaxy install kravietz.hostapd
Licenza
gpl-3.0
Download
668
Proprietario
Information security, DevOps and DevSecOps professional from Poland living in the UK