SagerNet / SagerNet/sing-box

wifi_bssid rule not working

Open
#3,998 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Go
Stars
38.2k
Forks
4.6k
Avg merge
19d 15h
Merged PRs (30d)
1

Description

Operating system

Windows

System version

10

Installation type

Original sing-box Command Line

If you are using a graphical client, please provide the version of the client.

No response

Version
sing-box version 1.13.5

Environment: go1.25.8 windows/amd64
Tags: with_gvisor,with_quic,with_dhcp,with_wireguard,with_utls,with_acme,with_clash_api,with_tailscale,with_ccm,with_ocm,with_naive_outbound,with_purego,badlinkname,tfogo_checklinkname0
Revision: 7ffdc48b49718d6aeee19ede523a31d1286724cf
CGO: disabled
Description

rule based on "wifi_bssid" not working, while rule "wifi_ssid" is.
while SSID and BSSID is actually detected upon start.
just for BSSID provided in logs without colons

Reproduction

you're connected to wifi with SSID "My Wifi" and BSSID "00:11:22:33:44:55"

create config with two outbounds: default-out and custom-out

create rule based on wifi_bssid

"route": {
    "final": "default-out",
    "auto_detect_interface": true,
     "rules": [
      { "wifi_bssid": "00:11:22:33:44:55" , "outbound": "custom-out" },

run

while rule "wifi_ssid" is working, the rule "wifi_bssid" is not...

Logs
+0300 2026-04-06 00:03:01 INFO network: updated default interface WiFi, index 7
+0300 2026-04-06 00:03:02 INFO inbound/tun[in]: started at sing-tun
+0300 2026-04-06 00:03:02 INFO network: WIFI state changed: SSID=My Wifi, BSSID=001122334455
+0300 2026-04-06 00:03:02 INFO sing-box started (0.67s)
Supporter
Integrity requirements
  • I confirm that I have read the documentation, understand the meaning of all the configuration items I wrote, and did not pile up seemingly useful options or default values.
  • I confirm that I have provided the server and client configuration files and process that can be reproduced locally, instead of a complicated client configuration file that has been stripped of sensitive data.
  • I confirm that I have provided the simplest configuration that can be used to reproduce the error I reported, instead of depending on remote servers, TUN, graphical interface clients, or other closed-source software.
  • I confirm that I have provided the complete configuration files and logs, rather than just providing parts I think are useful out of confidence in my own intelligence.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the route.rules wifi_bssid matcher and the WiFi state update shown in the logs, reproducing on Windows with the supplied minimal configuration. Trace how the logged BSSID 001122334455 is compared with the configured 00:11:22:33:44:55; done when the rule selects custom-out while wifi_ssid continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.