nmcli
"nmcli - command-line tool for controlling NetworkManager" - man nmcli
Examples
Disable mac address randomization on a configured network
Static IP address assignments sometimes require a static MAC address. DHCP servers that service multiple SSIDs may assign different addresses when the same client connects to different SSIDs when MAC randomization is turned on.
nmcli connection show
Find the NAME of the profile you want to configure and run:
sudo nmcli connection modify "The Lan Before Time" 802-11-wireless.mac-address-randomization never
Set up a local DHCP server and WiFi access point
#!/usr/bin/env bash
set -x
SSID="some-ssid"
NETWORK_NAME="test_net"
nmcli con delete "${NETWORK_NAME}"
nmcli con add type wifi ifname wlan0 mode ap con-name "${NETWORK_NAME}" ssid "${SSID}" autoconnect false
nmcli con modify "${NETWORK_NAME}" wifi.band bg
nmcli con modify "${NETWORK_NAME}" wifi.channel 3
nmcli con modify "${NETWORK_NAME}" wifi.cloned-mac-address 00:12:34:56:78:9a
nmcli con modify "${NETWORK_NAME}" wifi-sec.key-mgmt wpa-psk
nmcli con modify "${NETWORK_NAME}" wifi-sec.proto rsn
nmcli con modify "${NETWORK_NAME}" wifi-sec.group ccmp
nmcli con modify "${NETWORK_NAME}" wifi-sec.pairwise ccmp
nmcli con modify "${NETWORK_NAME}" wifi-sec.psk "minecraft"
nmcli con modify "${NETWORK_NAME}" ipv4.addresses 192.168.4.1/24
nmcli con modify "${NETWORK_NAME}" ipv4.gateway 192.168.4.1
nmcli con modify "${NETWORK_NAME}" ipv4.dns 192.168.4.1
nmcli con modify "${NETWORK_NAME}" ipv4.method manual
nmcli con modify "${NETWORK_NAME}" ipv6.method ignore