NixOS Networking | 917 Members | |
| Declaratively manage your switching, routing, wireless, tunneling and more. | 269 Servers |
| Sender | Message | Time |
|---|---|---|
| 5 Jun 2021 | ||
In reply to @hexa:lossy.networkthanks for the pointer! | 22:52:14 | |
So this is the networkctl status of my wlan0 interface on the rpi that I set up as an access point yesterday. The network all functions like there's nothing wrong, but there it says it's "failed". Why is that? | 23:50:48 | |
| You typically can't put wireless interfaces into a bridge | 23:53:05 | |
| Zhaofeng Li: Well it works. I have hostapd on wlan0, and my other devices can connect to it as a wifi network, and the bridge with eth0 must be working because those devices can reach the internet. | 23:54:04 | |
| You are doing routing instead of bridging | 23:56:00 | |
| Care to explain your setup again? | 23:56:34 | |
| Zhaofeng Li: I don't have a dhcp server or anything on this pi though | 23:56:38 | |
| One sec... | 23:57:02 | |
| On my pi, I have this:
| 23:59:01 | |
| eth0 leads back to enp4s0 on my desktop, which is running a dhcp server with its wifi interface as the wan | 23:59:30 | |
| On the desktop:
| 23:59:58 | |
| 6 Jun 2021 | ||
| Woops, pi also has this:
| 00:00:33 | |
| Oh wait, apparently I can't read and you are using it as an AP 😐️ Then it should work and systemd-networkd was probably trying to bridge the interface before hostapd started | 00:00:34 | |
| Ah. How would I mess with the unit files to ensure proper ordering? | 00:00:59 | |
| I don't think there's a clean solution to this one unfortunately. You can keep it unbridged in networkd and add a service that runs brctl after hostapd has started | 00:02:27 | |
| Oh it's a long-standing known issue: https://github.com/systemd/systemd/issues/936 | 00:03:05 | |
| So yeah, no clean solution :/ | 00:03:26 | |
| Well darn | 00:05:21 | |
| ElvishJerricco: hostapd can put stuff into a bridge, not sure how it achieves that, but networkd can't | 00:08:32 | |
| have to read hostapd code for that I guess | 00:08:41 | |
| or yeah, might be a timing issue | 00:08:48 | |
| hexa: So I shouldn't have wlan0 in the br0.interfaces = [...] line? | 00:09:11 | |
A WIFI interface needs to be set in 4addr mode before it's added to a bridge. | 00:09:19 | |
| that's probably it | 00:09:23 | |
iw dev $name set 4addr on | 00:09:33 | |
| sadly networkd is free of hooks :) | 00:09:42 | |
| services.hostapd.serviceConfig.ExecStartPost = "systemctl restart systemd-networkd"; | 00:10:34 | |
| should probably hackfix your stuff :D | 00:10:42 | |
| Well, simply removing it from the br0.interfaces makes it "degraded" instead of "failed", and hostapd does seem to have added it to the bridge itself as the wifi still works | 00:13:37 | |
| For the degraded thing, use LinkLocalAddressing=no to make networkd not try to add addresses to it at all | 00:16:30 | |