惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
A
About on SuperTechFans
Apple Machine Learning Research
Apple Machine Learning Research
The Register - Security
The Register - Security
Vercel News
Vercel News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
人人都是产品经理
人人都是产品经理
MyScale Blog
MyScale Blog
云风的 BLOG
云风的 BLOG
博客园_首页
U
Unit 42
T
Tailwind CSS Blog
G
GRAHAM CLULEY
F
Full Disclosure
V
Vulnerabilities – Threatpost
T
Tenable Blog
月光博客
月光博客
P
Privacy & Cybersecurity Law Blog
P
Privacy International News Feed
K
Kaspersky official blog
Scott Helme
Scott Helme
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
N
News and Events Feed by Topic
T
The Exploit Database - CXSecurity.com
N
News and Events Feed by Topic
有赞技术团队
有赞技术团队
Recent Commits to openclaw:main
Recent Commits to openclaw:main
L
LINUX DO - 最新话题
Recorded Future
Recorded Future
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Help Net Security
Help Net Security
The GitHub Blog
The GitHub Blog
Cisco Talos Blog
Cisco Talos Blog
SecWiki News
SecWiki News
P
Proofpoint News Feed
Security Latest
Security Latest
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
罗磊的独立博客
S
Security Affairs
M
MIT News - Artificial intelligence
L
LINUX DO - 热门话题
美团技术团队
Simon Willison's Weblog
Simon Willison's Weblog
T
Threat Research - Cisco Blogs
Stack Overflow Blog
Stack Overflow Blog
Forbes - Security
Forbes - Security
Hugging Face - Blog
Hugging Face - Blog
博客园 - Franky
V
Visual Studio Blog

NetworkManager

NetworkManager 1.58 NetworkManager 1.54 NetworkManager 1.52 Protect your VPN from TunnelVision attacks NetworkManager 1.50 Addressing hostname assignment in NetworkManager 1.40 Help NetworkManager project to triage issues NetworkManager 1.48 NetworkManager 1.46 NetworkManager 1.44 NetworkManager 1.42 Set up NMCI on Fedora Linux VM Using Python and NetworkManager to control the network [link] Notes on D-Bus NetworkManager 1.40 NetworkManager 1.38 From ifcfg to keyfiles [link] NetworkManager 1.36 NetworkManager 1.34 NetworkManager 1.32 NetworkManager 1.30 Initscripts’ ifcfg-rh Format in NetworkManager and its Future [link] How to set up your NetworkManager environment [link] NetworkManager 1.28 [link] Looking forward to Linux network configuration in the initial ramdisk (initrd) [link] NetworkManager 1.26 [link] Internet connection sharing with NetworkManager [link] Why NetworkManager? [link] Please welcome: NetworkManager 1.20 [link] Becoming friends with NetworkManager [link] WireGuard in NetworkManager [link] MAC Address Spoofing in NetworkManager 1.4.0 [link] NetworkManager for administrators Resources for developers man pages Video tutorials VPN support
RFKill
2001-01-01 · via NetworkManager

The rfkill subsystem in Linux provides a mechanism to disable radio transmitters, as Wi-Fi, Bluetooth cards or WWAN modems installed in the system.

From the kernel point of view, such devices typically have a associated rfkill device (also called killswitch) that is visible in the output of the rfkill utility.

$ rfkill
ID TYPE      DEVICE                 SOFT      HARD
 0 bluetooth tpacpi_bluetooth_sw blocked unblocked
 2 wlan      phy0                blocked unblocked

Each rfkill device has a type (bluetooth, wlan, wwan) and two flags to indicate whether the killswitch is hard-blocked (when radio transmission is blocked via a hardware switch) or soft-blocked (when radio is disabled but can be re-enabled in software).

Support in NetworkManager

NetworkManager can manage the global rfkill state for Wi-Fi and WWAN devices.

It uses udev to discover (at startup, but also at runtime) the available killswitches. For each of them, NetworkManager keeps track of the current state (unblocked, soft-blocked, hard-blocked).

Each killswitch can be a platform one or a non-platform (or device) one. Platform killswitches are those belonging to the “platform” or “acpi” udev subsystem. Device switches, if hard-killed typically cannot be changed except by a physical hardware switch. Also it is common that platform killswitches control device killswitches. That is, a hard-blocked device switch can often be unblocked by a platform switch.

Therefore, when determining the global killswitch state for a given hardware type (Wi-Fi or WWAN), blocked platform switches have higher priority. If all platform switches are unblocked, then the global state is the maximum blocked state of device switches.

The global killswitch state for a hardware type is “unavailable” when no killswitches of that kind were found on the system and there are no compatible devices.

D-Bus API

The rkfill state is exposed on D-Bus via the following boolean properties of the org.freedesktop.NetworkManager interface on the /org/freedesktop/NetworkManager object:

  • WirelessEnabled (read-write)
  • WirelessHardwareEnabled (read-only)
  • WwanEnabled (read-write)
  • WwanHardwareEnabled (read-only)

‘Hardware’ properties cannot be written as they refer to the hardware-blocked state. The other two properties refer to the software-blocked state.

Since version 1.38, NetworkManager also exposes a RadioFlags property on the same interface. It currently supports two flags:

  • NM_RADIO_FLAG_WLAN_AVAILABLE = 0x1
  • NM_RADIO_FLAG_WWAN_AVAILABLE = 0x2

indicating whether any Wi-fi or WWAN hardware is present in the system.

When WirelessEnabled (or WwanEnabled) gets written, NetworkManager updates the soft-blocked state of all Wi-Fi (or WWAN) killswitches in kernel; in addition, it enables or disables any NetworkManager device of type ‘wifi’ (or ‘gsm’).

The soft-blocked state set via D-Bus is also saved in a persistent state file (/var/lib/NetworkManager/NetworkManager.state) that is reloaded at the next restart.

nmcli

nmcli implements the radio subcommand to control the rfkill state.

$ nmcli radio
WIFI-HW  WIFI      WWAN-HW  WWAN
enabled  disabled  enabled  enabled

For Wi-Fi and WWAN, bot the hardware and software killswitch states are displayed.

The soft-blocked states can be changed via

nmcli radio {all | wifi | wwan} [on | off]

and this basically controls the soft-blocked D-Bus properties as described in the previous section.

Note that since version 1.38 nmcli displays missing in the *-HW column when there are no killswitches or compatible devices.