1 月 062024
 

Source: difference between nmcli connection reload and nmcli device reapply?

Let’s see what the reference manual says about these commands:

nmcli connection reload

Reload all connection files from disk. NetworkManager does not monitor changes to connection. So you need to use this command in order to tell NetworkManager to re-read the connection profiles from disk when a change was made to them.

nmcli device reapply {device}

Attempt to update device with changes to the currently active connection made since it was last applied.

From this, it seems the commands inherently do different things. The nmcli connection reload command reloads connection profiles from disk, while the nmcli device reapply {device} applies any new profile to the active connection.

1 月 092019
 

  • connect to WiFi AP
    • nmcli device wifi connect “XXXXX” password “12345678”
  • disconnect from WiFi
    • nmcli device disconnect wlanXXX
  • re-connect to WiFi
    • nmcli device connect wlanXXX
  • list conntions
    • nmcli connection show
    • nmcli –fields UUID con show
    • nmcli –fields UUID con show –active
  • rename connection name
    • nmcli c modify uuid UUIDXXX connection.id NAMEXXX
  • set connection automatically up
    • nmcli connection modify NAMEXXX connection.autoconnect yes
  • set static IP 192.168.100.50
    • nmcli connection modify NAMEXXX ipv4.method manual ipv4.address 192.168.100.50/24 ipv4.gateway 192.168.100.254 ipv4.dns 8.8.8.8
  • delete all connections:
    • for uuid in `nmcli –fields UUID con show | grep -v UUID`; do nmcli con delete uuid $uuid ; done
  • create wireless access point
    • nmcli con add type wifi ifname wlan0 con-name Hotspot autoconnect yes ssid “YOUR_SSID”
    • nmcli con modify Hotspot 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared
    • nmcli con modify Hotspot wifi-sec.key-mgmt wpa-psk
    • nmcli con modify Hotspot wifi-sec.psk “YOUR_PWD”
    • nmcli con up Hotspot

  • add a virtual wireless interface so you can run as a Wifi client (station) and access point (ap) from the single built-in wifi