How to import WireGuard profile using nmcli on Linux

You can import a WireGuard profile using the nmcli command on Linux by following these steps:

  1. Create a new connection profile using the nmcli command:
nmcli connection import type wireguard file /path/to/profile.conf

This will import the WireGuard profile from the specified file and create a new connection profile with the same name as the file.

  1. Verify the imported profile by listing all the available connection profiles:
nmcli connection show

This will list all the available connection profiles, including the imported WireGuard profile.

  1. Enable the imported WireGuard profile:
nmcli connection up profile-name

This will activate the imported WireGuard profile and establish the connection.

  1. Verify the status of the connection
nmcli connection show profile-name

This will show the current status of the connection, including the IP address and other connection details.

  1. To delete the profile
nmcli connection delete profile-name

This will delete the profile you imported.

Please note that you need to have NetworkManager installed on your Linux system to use the nmcli command.

Leave a Comment