In Fedora (at least), the preferred way to interact with NetworkManager is through DBus.
While cordless tools, etc. will work - even direct kernel calls, if necessary - there are several problems:
- You will probably need superuser privileges.
- NetworkManager is likely to receive a panic attack and will run into you if you donβt stop serving it.
- Custom network controls (such as desktop icons) are almost certainly configured to use NetworkManager.
You can send and receive DBus messages for all the tasks you specify, for Wi-Fi, as well as for any other types of network interfaces. The API is published here for version 0.8 .
For newer operating systems, there are apparently changes to the API with migration guidance .
Their wiki should be really helpful.
I know that Fedora and Ubuntu use NetworkManager by default; I believe that many other systems, too, but do not have an exhaustive list.
Of course, if you use an embedded system, a custom distribution, or something else, then your mileage may vary.
source share