!tCyGickeVqkHsYjWnh:nixos.org

NixOS Networking

885 Members
on your Router! Declaratively manage your switching, routing, wireless, tunneling and more.259 Servers

Load older messages


SenderMessageTime
1 Nov 2025
@k900:0upti.meK900It's in /run/hostapd/<something>.conf21:53:46
@crushing-smite:matrix.orgcrushing-smite
╰─❯ cat /run/hostapd/wlp5s0.hostapd.conf
cat: /run/hostapd/wlp5s0.hostapd.conf: No such file or directory

╰─❯ ls /run/hostapd
ls: cannot access '/run/hostapd': No such file or directory
21:54:43
@crushing-smite:matrix.orgcrushing-smite

Here are the supposed config files which failed to produce the ones missing above:

╭─ ~ ······························································································································ 3s 
╰─❯ systemctl show hostapd.service | grep ExecStart
ExecStartPre={ path=/nix/store/4k91b9yj4kajw1naszj9rydijcw9cl6k-unit-script-hostapd-pre-start/bin/hostapd-pre-start ; argv[]=/nix/store/4k91b9yj4kajw1naszj9rydijcw9cl6k-unit-script-hostapd-pre-start/bin/hostapd-pre-start ; ignore_errors=no ; start_time=[Sat 2025-11-01 21:31:31 UTC] ; stop_time=[Sat 2025-11-01 21:31:31 UTC] ; pid=974 ; code=exited ; status=0 }
ExecStartPreEx={ path=/nix/store/4k91b9yj4kajw1naszj9rydijcw9cl6k-unit-script-hostapd-pre-start/bin/hostapd-pre-start ; argv[]=/nix/store/4k91b9yj4kajw1naszj9rydijcw9cl6k-unit-script-hostapd-pre-start/bin/hostapd-pre-start ; flags= ; start_time=[Sat 2025-11-01 21:31:31 UTC] ; stop_time=[Sat 2025-11-01 21:31:31 UTC] ; pid=974 ; code=exited ; status=0 }
ExecStart={ path=/nix/store/x9p8c0x9szf7wd91m07xa9wm532s07fh-hostapd-2.11/bin/hostapd ; argv[]=/nix/store/x9p8c0x9szf7wd91m07xa9wm532s07fh-hostapd-2.11/bin/hostapd /run/hostapd/wlp5s0.hostapd.conf ; ignore_errors=no ; start_time=[Sat 2025-11-01 21:31:31 UTC] ; stop_time=[Sat 2025-11-01 21:31:31 UTC] ; pid=986 ; code=exited ; status=1 }
ExecStartEx={ path=/nix/store/x9p8c0x9szf7wd91m07xa9wm532s07fh-hostapd-2.11/bin/hostapd ; argv[]=/nix/store/x9p8c0x9szf7wd91m07xa9wm532s07fh-hostapd-2.11/bin/hostapd /run/hostapd/wlp5s0.hostapd.conf ; flags= ; start_time=[Sat 2025-11-01 21:31:31 UTC] ; stop_time=[Sat 2025-11-01 21:31:31 UTC] ; pid=986 ; code=exited ; status=1 }

╭─ ~ ··································································································································
╰─❯ cat /nix/store/4k91b9yj4kajw1naszj9rydijcw9cl6k-unit-script-hostapd-pre-start/bin/hostapd-pre-start
#!/nix/store/cl2gkgnh26mmpka81pc2g5bzjfrili92-bash-5.3p3/bin/bash
set -e

/nix/store/xp4qhcx49n9a847c2jf9kdkhfacwyrki-make-hostapd-wlp5s0-files


╭─ ~ ··································································································································
╰─❯ cat /nix/store/xp4qhcx49n9a847c2jf9kdkhfacwyrki-make-hostapd-wlp5s0-files
#!/nix/store/cl2gkgnh26mmpka81pc2g5bzjfrili92-bash-5.3p3/bin/bash
set -euo pipefail

hostapd_config_file=/run/hostapd/wlp5s0.hostapd.conf
rm -f "$hostapd_config_file"
cat > "$hostapd_config_file" <<EOF
# Radio base configuration: wlp5s0
################################

EOF

cat /nix/store/0qb6bl6n8l8y4srv009nk72228j2yzfk-hostapd-radio-wlp5s0-extra.conf >> "$hostapd_config_file"


# BSS configuration: wlp5s0

mac_allow_file=/run/hostapd/wlp5s0.mac.allow
rm -f "$mac_allow_file"
touch "$mac_allow_file"

mac_deny_file=/run/hostapd/wlp5s0.mac.deny
rm -f "$mac_deny_file"
touch "$mac_deny_file"

cat /nix/store/39551igc1w77yy0ad0ivjywz6v92716g-hostapd-radio-wlp5s0-bss-wlp5s0.conf >> "$hostapd_config_file"
cat /nix/store/9xg1z67s9hyb92ns5jvh9ls3ca9mc1bw-hostapd-radio-wlp5s0-bss-wlp5s0-extra.conf >> "$hostapd_config_file"




╭─ ~ ··································································································································
╰─❯ cat /nix/store/0qb6bl6n8l8y4srv009nk72228j2yzfk-hostapd-radio-wlp5s0-extra.conf
channel=44
country_code=DE
driver=nl80211
ht_capab=[HT40][SHORT-GI-20][SHORT-GI-40]
hw_mode=a
ieee80211ac=1
ieee80211d=1
ieee80211h=1
ieee80211n=1
noscan=0
require_ht=0
require_vht=1
vht_capab=
vht_oper_chwidth=1

╭─ ~ ··································································································································
╰─❯ cat /nix/store/39551igc1w77yy0ad0ivjywz6v92716g-hostapd-radio-wlp5s0-bss-wlp5s0.conf


# BSS 0: wlp5s0
################################

interface=wlp5s0

╭─ ~ ··································································································································
╰─❯ cat /nix/store/9xg1z67s9hyb92ns5jvh9ls3ca9mc1bw-hostapd-radio-wlp5s0-bss-wlp5s0-extra.conf
ap_isolate=0
auth_algs=1
beacon_int=50
bridge=br0
ctrl_interface=/run/hostapd
ctrl_interface_group=wheel
ieee80211w=1
ignore_broadcast_ssid=0
logger_stdout=-1
logger_stdout_level=0
logger_syslog=-1
logger_syslog_level=0
macaddr_acl=0
rsn_pairwise=CCMP GCMP GCMP-256
sae_require_mfp=1
ssid=SsidName
utf8_ssid=1
wmm_enabled=1
wpa=2
wpa_key_mgmt=WPA-PSK-SHA256
wpa_pairwise=CCMP GCMP GCMP-256
wpa_passphrase=password
22:03:22
@k900:0upti.meK900 Can you also post your NixOS side config? 22:04:11
@crushing-smite:matrix.orgcrushing-smiteSure, but before that, may I have second opinion on some AI slop?22:04:32
@k900:0upti.meK900 No 22:04:47
@crushing-smite:matrix.orgcrushing-smiteOk, brb22:04:52
@k900:0upti.meK900 Not from me, anyway 22:04:53
@crushing-smite:matrix.orgcrushing-smite

Here:

{
    config,
    lib,
    pkgs,
    ...
}: {
    imports = [
        ./hardware-configuration.nix
        ./wireless.nix
    ];

    boot.kernelParams = [
        "console=ttyS0,115200"
        "console=tty1"
    ];

    networking.wireless = {
        enable = true;
        interfaces = [ "wlan0" ];
        networks = {
            "UpstreamRouter" = {
                psk = "UpstreamRouterPassword";
            };
        };
    };
    networking.networkmanager.enable = false;

    boot.loader.systemd-boot.enable = true;
    boot.loader.efi.canTouchEfiVariables = true;

    systemd.network.wait-online.enable = false;

    services.openssh = {
        enable = true;
        settings.PasswordAuthentication = true;
        settings.PermitRootLogin = "yes";
        settings.KbdInteractiveAuthentication = true;
        settings.X11Forwarding = true;
    };

    networking.firewall = {
        checkReversePath = "loose";
    };

    networking.firewall.interfaces.br0.allowedUDPPorts = [ 67 22 ];
    networking.firewall.interfaces.br0.allowedTCPPorts = [ 67 22 ];

    environment.systemPackages = with pkgs; [
        nmap
        wireguard-tools
        wget
        du-dust
        bat
        git
        curl
        vim
        htop
        tree
        xorg.xauth
        xclip
        wavemon
        nettools
    ];

    boot.kernel.sysctl."net.ipv4.ip_forward" = 1;
    boot.kernel.sysctl."net.ipv6.conf.all.forwarding" = 1;

    networking.nat = {
        enable = true;
        externalInterface = "wlp0s20f0u7i3";
        internalInterfaces = ["br0"];
    };

    systemd.network.enable = true;
    systemd.network = {
        netdevs = {
            "20-br0" = {
                netdevConfig = {
                    Kind = "bridge";
                    Name = "br0";
                };
            };
        };

        networks = {
            "05-wlan-usb" = {
                matchConfig.MACAddress = "00:c0:ca:b7:8c:b4";
                DHCP = "yes";
                dhcpV4Config = {
                    RouteMetric = 100;
                };
                networkConfig = {
                    IgnoreCarrierLoss = "10s";
                };
            };

            "10-enp1s0" = {
                matchConfig.Name = "enp1s0";
                linkConfig.RequiredForOnline = "no";
                DHCP = "yes";
                dhcpV4Config = {
                    RouteMetric = 200;
                };
            };

            "30-enp2s0" = {
                matchConfig.Name = "enp2s0";
                networkConfig.Bridge = "br0";
                linkConfig.RequiredForOnline = "no";
                DHCP = "no";
            };
            "30-enp3s0" = {
                matchConfig.Name = "enp3s0";
                networkConfig.Bridge = "br0";
                linkConfig.RequiredForOnline = "no";
                DHCP = "no";
            };
            "30-enp4s0" = {
                matchConfig.Name = "enp4s0";
                networkConfig.Bridge = "br0";
                linkConfig.RequiredForOnline = "no";
                DHCP = "no";
            };

            "40-br0" = {
                matchConfig.Name ="br0";
                networkConfig = {
                    DHCPServer = "yes";
                    IPMasquerade = "ipv4";
                };
                address = [ "192.168.200.1/24" ];
                dhcpServerConfig = {
                    EmitDNS = "yes";
                    DNS = "1.1.1.1";
                };
                bridgeConfig = {};
                linkConfig = {
                    RequiredForOnline = "no";
                };
            };
        };
    };

    system.stateVersion = "23.11";
}
22:07:06
@crushing-smite:matrix.orgcrushing-smite *

Here:

{
    config,
    lib,
    pkgs,
    ...
}: {
    imports = [
        ./hardware-configuration.nix
        ./wireless.nix
    ];

    boot.kernelParams = [
        "console=ttyS0,115200"
        "console=tty1"
    ];

    networking.wireless = {
        enable = true;
        interfaces = [ "wlan0" ];
        networks = {
            "UpstreamRouter" = {
                psk = "UpstreamRouterPassword";
            };
        };
    };
    networking.networkmanager.enable = false;

    boot.loader.systemd-boot.enable = true;
    boot.loader.efi.canTouchEfiVariables = true;

    systemd.network.wait-online.enable = false;

    services.openssh = {
        enable = true;
        settings.PasswordAuthentication = true;
        settings.PermitRootLogin = "yes";
        settings.KbdInteractiveAuthentication = true;
        settings.X11Forwarding = true;
    };

    networking.firewall = {
        checkReversePath = "loose";
    };

    networking.firewall.interfaces.br0.allowedUDPPorts = [ 67 22 ];
    networking.firewall.interfaces.br0.allowedTCPPorts = [ 67 22 ];

    environment.systemPackages = with pkgs; [
        nmap
        wireguard-tools
        wget
        du-dust
        bat
        git
        curl
        vim
        htop
        tree
        xorg.xauth
        xclip
        wavemon
        nettools
    ];

    boot.kernel.sysctl."net.ipv4.ip_forward" = 1;
    boot.kernel.sysctl."net.ipv6.conf.all.forwarding" = 1;

    networking.nat = {
        enable = true;
        externalInterface = "wlp0s20f0u7i3";
        internalInterfaces = ["br0"];
    };

    systemd.network.enable = true;
    systemd.network = {
        netdevs = {
            "20-br0" = {
                netdevConfig = {
                    Kind = "bridge";
                    Name = "br0";
                };
            };
        };

        networks = {
            "05-wlan-usb" = {
                matchConfig.MACAddress = "00:c0:ca:b7:8c:b4";
                DHCP = "yes";
                dhcpV4Config = {
                    RouteMetric = 100;
                };
                networkConfig = {
                    IgnoreCarrierLoss = "10s";
                };
            };

            "10-enp1s0" = {
                matchConfig.Name = "enp1s0";
                linkConfig.RequiredForOnline = "no";
                DHCP = "yes";
                dhcpV4Config = {
                    RouteMetric = 200;
                };
            };

            "30-enp2s0" = {
                matchConfig.Name = "enp2s0";
                networkConfig.Bridge = "br0";
                linkConfig.RequiredForOnline = "no";
                DHCP = "no";
            };
            "30-enp3s0" = {
                matchConfig.Name = "enp3s0";
                networkConfig.Bridge = "br0";
                linkConfig.RequiredForOnline = "no";
                DHCP = "no";
            };
            "30-enp4s0" = {
                matchConfig.Name = "enp4s0";
                networkConfig.Bridge = "br0";
                linkConfig.RequiredForOnline = "no";
                DHCP = "no";
            };

            "40-br0" = {
                matchConfig.Name ="br0";
                networkConfig = {
                    DHCPServer = "yes";
                    IPMasquerade = "ipv4";
                };
                address = [ "192.168.200.1/24" ];
                dhcpServerConfig = {
                    EmitDNS = "yes";
                    DNS = "1.1.1.1";
                };
                bridgeConfig = {};
                linkConfig = {
                    RequiredForOnline = "no";
                };
            };
        };
    };

    system.stateVersion = "23.11";
}
22:07:12
@k900:0upti.meK900 There's no hostapd config here? 22:07:49
@crushing-smite:matrix.orgcrushing-smite

It's in wireless.nix, which is above in the chat, reposting:

{
  config,
  lib,
  pkgs,
  ...
}: {
    boot.extraModprobeConfig = ''
        options cfg80211 ieee80211_regdom="DE"
    '';

    hardware.wirelessRegulatoryDatabase = true;

    services.hostapd = {
        enable = true;

        radios."wlp5s0" = {

            wifi5 = {
                enable = true;
                operatingChannelWidth = "80";
                require = true;
            };

            countryCode = "DE";
            channel = 44;
            band = "5g";

            networks.wlp5s0 = {
                logLevel = 0;
                ssid = "SsidName";
                authentication = {
                    mode = "wpa2-sha256";
                    wpaPassword = "password";
                    enableRecommendedPairwiseCiphers = true;
                };
                settings = {
                    bridge = "br0";
                    beacon_int = 50;
                };
            };
        };
    };
}
22:08:51
@k900:0upti.meK900 That does look fairly normal 22:09:30
@k900:0upti.meK900 I'm not entirely sure why it's rejecting that mode 22:09:50
@k900:0upti.meK900 Try setting log level to and running it again 22:09:52
@crushing-smite:matrix.orgcrushing-smiteIt's at lowest possible22:10:06
@k900:0upti.meK900 Anything in dmesg | grep mt76+ maybe? 22:11:00
@k900:0upti.meK900 * Anything in dmesg | grep mt7 maybe? 22:11:10
@crushing-smite:matrix.orgcrushing-smite
╰─❯ dmesg | grep mt7
[    4.692938] mt7921e 0000:05:00.0: ASIC revision: 79220010
[    4.768676] mt7921e 0000:05:00.0: HW/SW Version: 0x8a108a10, Build Time: 20250903123148a
[    4.785309] mt7921e 0000:05:00.0: WM Firmware Version: ____000000, Build Time: 20250903123243
[    4.997376] usbcore: registered new interface driver mt7921u
[    4.999834] mt7921u 1-7.1.1:1.3: HW/SW Version: 0x8a108a10, Build Time: 20250625153620a
[    5.015635] mt7921u 1-7.1.1:1.3: WM Firmware Version: ____010000, Build Time: 20250625153703
[    5.912608] mt7921e 0000:05:00.0 wlp5s0: renamed from wlan0
[   93.172491] mt7921e 0000:05:00.0 wlp5s0: entered allmulticast mode
[   93.172665] mt7921e 0000:05:00.0 wlp5s0: entered promiscuous mode
[   93.177269] mt7921e 0000:05:00.0 wlp5s0: left allmulticast mode
[   93.177303] mt7921e 0000:05:00.0 wlp5s0: left promiscuous mode
[   93.551527] mt7921e 0000:05:00.0 wlp5s0: entered allmulticast mode
[   93.552388] mt7921e 0000:05:00.0 wlp5s0: entered promiscuous mode
[   93.554463] mt7921e 0000:05:00.0 wlp5s0: left allmulticast mode
[   93.554486] mt7921e 0000:05:00.0 wlp5s0: left promiscuous mode
[   94.120763] mt7921e 0000:05:00.0 wlp5s0: entered allmulticast mode
[   94.121633] mt7921e 0000:05:00.0 wlp5s0: entered promiscuous mode
[   94.123950] mt7921e 0000:05:00.0 wlp5s0: left allmulticast mode
[   94.123972] mt7921e 0000:05:00.0 wlp5s0: left promiscuous mode
[   94.611620] mt7921e 0000:05:00.0 wlp5s0: entered allmulticast mode
[   94.612456] mt7921e 0000:05:00.0 wlp5s0: entered promiscuous mode
[   94.614752] mt7921e 0000:05:00.0 wlp5s0: left allmulticast mode
[   94.614777] mt7921e 0000:05:00.0 wlp5s0: left promiscuous mode
[   95.119282] mt7921e 0000:05:00.0 wlp5s0: entered allmulticast mode
[   95.120179] mt7921e 0000:05:00.0 wlp5s0: entered promiscuous mode
[   95.122213] mt7921e 0000:05:00.0 wlp5s0: left allmulticast mode
[   95.122234] mt7921e 0000:05:00.0 wlp5s0: left promiscuous mode
22:11:42
@crushing-smite:matrix.orgcrushing-smite(the wifi usb dongle which provides connectivity to internet is near the same (same?) chipset - u VS e difference)22:12:25
@k900:0upti.meK900 Well it working in STA mode is not surprising 22:14:19
@k900:0upti.meK900 What is surprising is it behaving this badly in AP mode 22:14:27
@k900:0upti.meK900 And seemingly not providing a reason 22:14:46
@k900:0upti.meK900 Actually, what kernel version is that? 22:15:09
@crushing-smite:matrix.orgcrushing-smite Linux nixos 6.12.53 22:15:33
@k900:0upti.meK900Try linuxPackages_latest22:16:37
@crushing-smite:matrix.orgcrushing-smite

There's also this warning each time I rebuild:

evaluation warning: The combination of `systemd.network.enable = true`, `networking.useDHCP = true` and `networking.useNetworkd = false` can cause both networkd and dhcpcd to manage the same interfaces. This can lead to loss of networking. It is recommended you choose only one of networkd (by also enabling `networking.useNetworkd`) or scripting (by disabling `systemd.network.enable`)
22:18:16
@crushing-smite:matrix.orgcrushing-smite *

There's also this warning each time I rebuild:

"""
evaluation warning: The combination of systemd.network.enable = true, networking.useDHCP = true and networking.useNetworkd = false can cause both networkd and dhcpcd to manage the same interfaces. This can lead to loss of networking. It is recommended you choose only one of networkd (by also enabling networking.useNetworkd) or scripting (by disabling systemd.network.enable)
"""

22:18:26
@k900:0upti.meK900 This is fine for your particular setup 22:18:37
@k900:0upti.meK900 Though you may want to fix it 22:18:41

Show newer messages


Back to Room ListRoom Version: 6