hostapd & systemd on gentoo

Dan Egli ddavidegli at
Fri Nov 13 22:36:54 MST 2015

Hey folks, perhaps my google foo isn't up to snuff today. I've been looking
for articles that help me understand exactly how to setup hostapd on gentoo
using systemd, and I'm not finding anything. I looked all over the Gentoo
Wiki and found nothing that mentioned both hostapd and systemd. I found
pages that mention one or the other, but they seem to contradict each
other's setup, making it impossible to use both pages at once. If possible,
I'd really like to use netifrc as well. But I can't tell for sure if that's
possible or if it's only for OpenRC setups. The Gentoo AMD64 walkthrough
specifically states that they assume you're using OpenRC vs. systemd. I'd
consider just using OpenRC, but I want this setup to be as future proof as
possible and since it looks like everyone is moving towards systemd, I'd
prefer to stick with that. This is especially true as all the walkthroughs
for luks that I've encountered have entailed using systemd and
/etc/crypttab and I can't find any that explain how to use luks with
OpenRC, although I'm sure it's possible. And yes, I've looked. Again, my
google skills must not be up to par today.

I've no idea where else to look. So perhaps someone here can point me in
the right direction. I'm trying to create a wireless hotspot (that can work
in managed mode, obviously, not just ad-hoc) that gets called with systemd
under Gentoo. The desired network setup would be like this:

eth0 - Public IP - Protected by iptables firewall that uses NAT to rewrite
requests from eth1 or wlan0 using eth0's IP
eth1 - Private IP ( let's say)
wlan0 - Private IP (say

The iptables rules are in place and seem to work fine for eth0 & eth1. Both
eth1 and wlan0 are serviced by dhcpd. I've got dhcpd running and serving
addresses to those connected to eth1 just fine. And from what I can tell it
should serve addresses to wlan0 connected nodes, but I can't tell until I
can get hostapd up and running so that nodes can associate with the
wireless nic in the first place. I want the nodes to be wpa2 protected, of
course, and I have wpa_supplicant installed. But all the gentoo docs seem
to be about using wpa_supplicant to connect to an existing AP, not to have
the box serve as an AP itself (and there are reasons for this that I'm not
getting into at the moment, but I do have them). They mention hostapd, but
never give any config details that I can see.

Any suggestions would be most welcome. I'm getting ready to pull my hair
out. Help!?

More information about the PLUG mailing list