Pre-requires

List available connections

nmcli con show

Show details of a specific connection

To show details by connection name, use:

nmcli con show "connection-name"

To show details by UUID, use:

nmcli con show uuid "connection-uuid"

Remove the connection

specifying its name or UUID. You can remove a connection using either its name or UUID. Here’s how to remove a connection by its name:

nmcli con delete "connection-name"

If you prefer to use the UUID, the command is similar:

nmcli con delete uuid "connection-uuid"

Set a static IP address

specific connection (replace placeholders with your actual data):

nmcli con mod "connection-name" ipv4.addresses "192.168.1.10/24" ipv4.gateway "192.168.1.1" ipv4.dns "8.8.8.8,8.8.4.4" ipv4.method manual

Restart the network connection to apply the changes:

nmcli con down "connection-name" && nmcli con up "connection-name"