Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Hostapd with more than one adapter

Need help with peripherals or devices?
Post Reply
Message
Author
propofol123
Posts: 15
Joined: 2013-05-16 14:06

Hostapd with more than one adapter

#1 Post by propofol123 »

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/bugrepo ... 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

User avatar
ruwolf
Posts: 623
Joined: 2008-02-18 05:04
Location: Banovce nad Bebravou
Has thanked: 35 times
Been thanked: 26 times

Re: Hostapd with more than one adapter

#2 Post by ruwolf »

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...

propofol123
Posts: 15
Joined: 2013-05-16 14:06

Re: Hostapd with more than one adapter

#3 Post by propofol123 »

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.

Post Reply