kravietz.hostapd
角色名称
该角色用于使用 systemd.service
设置和配置 hostapd
,支持所有配置选项。
要求
无。
角色变量
要运行 hostapd
的接口。这将用于启动 systemd
中的 [email protected]
。
hostapd_interface: wlan1
以下 hostapd_config
字典将一一对应转换为 hostapd
配置文件。有关单个选项的详细信息,请参见 hostapd.conf 参考:
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" # 使用 ansible-vault 保护
wpa_key_mgmt: WPA-PSK WPA-PSK-SHA256
wpa_pairwise: TKIP CCMP
rsn_pairwise: CCMP
ctrl_interface: /var/run/hostapd
依赖性
如果您将 WiFi 子网桥接到 LAN,您还可以使用 shibumi.systemd-conf 角色设置桥接,如以下示例所示:
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
示例剧本
假设在 host_vars
中有上述配置:
- hosts: access_point
roles:
- kravietz.hostapd
- shibumi.systemd-conf
许可证
GPLv3
作者信息
Paweł Krawczyk https://krvtz.net/
关于项目
Role to set up and configure `hostapd` using `systemd.service` that supports all configuration options.
安装
ansible-galaxy install kravietz.hostapd
许可证
gpl-3.0
下载
668
拥有者
Information security, DevOps and DevSecOps professional from Poland living in the UK