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:
- Create a new connection profile using the
nmclicommand:
nmcli connection import type wireguard file /path/to/profile.confThis will import the WireGuard profile from the specified file and create a new connection profile with the same name as the file.
- Verify the imported profile by listing all the available connection profiles:
nmcli connection showThis will list all the available connection profiles, including the imported WireGuard profile.
- Enable the imported WireGuard profile:
nmcli connection up profile-nameThis will activate the imported WireGuard profile and establish the connection.
- Verify the status of the connection
nmcli connection show profile-nameThis will show the current status of the connection, including the IP address and other connection details.
- To delete the profile
nmcli connection delete profile-nameThis will delete the profile you imported.
Please note that you need to have NetworkManager installed on your Linux system to use the nmcli command.
