Score:0

Hostapd failed to start - Failed to initialize interface

id flag

I'm trying to set up hostapd on linux machine as a network authenticator with 802.1x.

I've been mostly following this guide, with some adaptations since I'm using Ubuntu Jammy instead of RHEL, and using veth interfaces in the bridge instead of physical ones.

I created the hostapd.conf file as instructed with the content as they described - My bridge interface is br0 like in the sample, I changed the own_ip_addr to the IP on interface br0, and changed the nas_identifier, auth_server_addr, auth_server_shared_secret, acct_server_addr, and acct_server_shared_secret to match the config on my RADIUS server.

Everything else is the same as the example file, but for some reason hostapd wont start. /var/log/syslog says there is an error in the config file but doesn't really explain what the problem is:

Oct 25 13:47:13 blackfox systemd[1]: hostapd.service: Scheduled restart job, restart counter is at 320.
Oct 25 13:47:13 blackfox hostapd[347060]: 1 errors found in configuration file '/etc/hostapd/hostapd.conf'
Oct 25 13:47:13 blackfox hostapd[347060]: Failed to set up interface with /etc/hostapd/hostapd.conf
Oct 25 13:47:13 blackfox hostapd[347060]: Failed to initialize interface
Oct 25 13:47:13 blackfox systemd[1]: hostapd.service: Control process exited, code=exited, status=1/FAILURE
Oct 25 13:47:13 blackfox systemd[1]: hostapd.service: Failed with result 'exit-code'.
Oct 25 13:47:15 blackfox systemd[1]: hostapd.service: Scheduled restart job, restart counter is at 321.
Oct 25 13:47:15 blackfox hostapd[347062]: 1 errors found in configuration file '/etc/hostapd/hostapd.conf'
Oct 25 13:47:15 blackfox hostapd[347062]: Failed to set up interface with /etc/hostapd/hostapd.conf
Oct 25 13:47:15 blackfox hostapd[347062]: Failed to initialize interface
Oct 25 13:47:15 blackfox systemd[1]: hostapd.service: Control process exited, code=exited, status=1/FAILURE
Oct 25 13:47:15 blackfox systemd[1]: hostapd.service: Failed with result 'exit-code'.
Oct 25 13:47:17 blackfox systemd[1]: hostapd.service: Scheduled restart job, restart counter is at 322.
Oct 25 13:47:17 blackfox hostapd[347065]: 1 errors found in configuration file '/etc/hostapd/hostapd.conf'
Oct 25 13:47:17 blackfox hostapd[347065]: Failed to set up interface with /etc/hostapd/hostapd.conf
Oct 25 13:47:17 blackfox hostapd[347065]: Failed to initialize interface
Oct 25 13:47:17 blackfox systemd[1]: hostapd.service: Control process exited, code=exited, status=1/FAILURE
Oct 25 13:47:17 blackfox systemd[1]: hostapd.service: Failed with result 'exit-code'.

Does anyone have any idea what's going on?

A.B avatar
cl flag
A.B
You could start hostapd manually in foreground and "even" more debugs (-dd).
A. Trevelyan avatar
id flag
If you want to put this as an answer I'll accept it. Doing that gave me this output: random: getrandom() support available Configuration file: /etc/hostapd/hostapd.conf Line 6: Invalid group 'wheel' 1 errors found in configuration file '/etc/hostapd/hostapd.conf' Failed to set up interface with /etc/hostapd/hostapd.conf hostapd_init: free iface 0x56141e09ca00 Failed to initialize interface From there I read up on the ctrl_interface_group parameter and realized group 'wheel' doesn't exist. Set it to root and it started successfully.
A.B avatar
cl flag
A.B
Glad you found the error but I wouldn't put my basic comment as answer. You can still answer it yourself if you think that will further help people or simply delete the question if you prefer.
A. Trevelyan avatar
id flag
I'll leave it up in case it helps anyone else, thanks man
Score:0
id flag

Running

hostapd -dd /etc/hostapd/hostapd.conf

Gave some more details as to what was going on. RHEL has a special administrative group called wheel which is non-existent in Ubuntu.

Went back to the config file and changed

ctrl_interface_group=wheel

to replace wheel with either 0, root, 27, sudo

It started successfully with all of them.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.