Hostapd with more than one adapter

Getting your soundcard to work, using Debian on non-i386 hardware, etc

Hostapd with more than one adapter

Postby propofol123 » 2019-07-05 05:38

I have a wireless access point running on a headless server with Debian Stretch. I have two wifi cards and my hostapd startup options look like this:

/etc/default/hostapd:
...
DAEMON_CONF="/etc/hostapd/hostapd.wlan1.conf /etc/hostapd/hostapd.wlan0.conf"
...

hostapd stopped working recently with this error after an apt upgrade:
Code: Select all
hostapd: Could not open configuration file ''/etc/hostapd/hostapd.wlan1.conf /etc/hostapd/hostapd.wlan0.conf" for reading.


I came across a Debian bug report (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=919892) where the author suggested editing /lib/systemd/system/hostapd.service from
Code: Select all
ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF}

to
Code: Select all
ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.pid -B $DAEMON_OPTS $DAEMON_CONF


What is the accepted way of running hostapd with multiple wifi cards under Debian?

Regards,
Stefan
propofol123
 
Posts: 15
Joined: 2013-05-16 14:06

Re: Hostapd with more than one adapter

Postby ruwolf » 2019-07-06 18:18

You have description in the bugreport, why there should not be curly brackets.
It is behaviour of systemd services' command line (look for "environment variable substitution"): FreeDesktop.org/software/systemd/man/systemd.service.html#Command%20lines

P.S.
My English is very poor, but I am going to explain it, here, if you need it:
With curly brackets, the string "/etc/hostapd/hostapd.wlan1.conf /etc/hostapd/hostapd.wlan0.conf" is concatenated, expanded as single file name (in strange directory "/etc/hostapd/hostapd.wlan1.conf /etc/hostapd/" ), what very probably does not exist in your system.
Without curly brackets, the string is expanded as two file names, they are separated ("/etc/hostapd/hostapd.wlan1.conf" and "/etc/hostapd/hostapd.wlan0.conf"), which probably exist in your computer...
User avatar
ruwolf
 
Posts: 392
Joined: 2008-02-18 05:04
Location: Slovakia, Banovce nad Bebravou, Matice slovenskej 1260/4-7

Re: Hostapd with more than one adapter

Postby propofol123 » 2019-07-09 00:37

Thanks for the explanation. I was just wondering if there was an official way of adding another a configuration for a second adapter other than editing one of the system files.
propofol123
 
Posts: 15
Joined: 2013-05-16 14:06


Return to Hardware

Who is online

Users browsing this forum: No registered users and 7 guests

fashionable