Steve Borba

My notes, I hope they help you, feel free to comment/add to them

hostapd

I have a linux firewall/router that has a wireless adapter in it, and I wanted to use it for an AP too. The way I did this allowed me to use it as an AP and a client, which may not be the preference for everyone, but I like to know all the options.

Here is my list/placement of files:

ll /etc/systemd/network/
  120-wireless-vrf.netdev
  130-br0.netdev
  140-wireless-vrf.network
  150-br0.network
  400-wireless-wireless.network
  410-wireless-ethernet.network

First we need to define the virtual devices

120-wireless-vrf.netdev
[NetDev]
Name=wireless
Kind=vrf

[VRF]
TableId=3
120-br0.netdev
[NetDev]
Name=br0
Kind=bridge

now lets turn them on

130-wireless-vrf.network
[Match]
Name=wireless

[Network]
vrf=wireless
140-br0.network
[Match]
Name=br0

[Network]
Address=
LLMNR=false
LinkLocalAddressing=no
vrf=wireless

and I need to connect the ethernet to the bridge

410-wireless-ethernet.network
[Match]
MACAddress=40:4e:36:83:38:e3

[Network]
LLMNR=false
LinkLocalAddressing=no
Bridge=br0
vrf=wireless

then I needed to add a subwireless interface for hostapd to use

/usr/lib/systemd/system/hostapd.service
<-- other lines -->
[Service]
ExecStartPre=/sbin/iw dev wls224 interface add ap_wls224 type managed addr 40:4e:36:83:38:e3
<-- other lines -->

the rest is handled by hostapd

/etc/hostapd/hostapd.conf
ssid=stevebb
wpa_passphrase=12345678

hw_mode=g
channel=7

wpa=2
wpa_key_mgmt=WPA-PSK
auth_algs=1
rsn_pairwise=CCMP

interface=ap_wls224
bridge=br0
driver=nl80211
country_code=US

logger_stdout=-1
logger_stdout_level=2

It works!

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>