wifi-config
CLI tool and Rust library for configuring Wi-Fi connections via NetworkManager over the system D-Bus. Supports both DHCP and static IPv4 configuration.
📦 Installation
Install the CLI tool from crates.io:
Or build from source:
🚀 CLI Usage
Connect using DHCP
Example:
This will:
- Connect to the system D-Bus
- Find the first Wi-Fi device (DeviceType == 2)
- Create a WPA-PSK connection profile
- Activate the connection via NetworkManager
Connect using Static IP
Example:
This will:
- Create a connection profile with UUID, ID, and type
802-11-wireless - Set
802-11-wirelesssection with SSID and modeinfrastructure - Set
802-11-wireless-securitysection with WPA-PSK password - Set
ipv4section with methodmanualand addresses[IP, prefix, gateway] - Add and activate the connection immediately via NetworkManager
🧰 Library Usage
Add to your Cargo.toml:
[]
= "0.1"
Example usage:
use ;
📄 License
Licensed under either of:
at your option.