Syntax of the CLI command wireguard
Last adaption: 07.2024
New in the wiki:
notemptyThis article refers to a Resellerpreview
Example: wireguard peer set peer_id "3" peer_psk [ ]
Command | Parameter | Description | Example |
---|---|---|---|
wireguardwireguard updatewireguard update |
– | After each Wireguard CLI command, this must be entered so that these commands are saved | wireguard update |
wireguard getwireguard get |
– | Listing of all Wireguard connections | wireguard get |
wireguard interfacewireguard interface getwireguard interface get |
– | Listing of all wireguard interfaces | wireguard interface get |
wireguard interface newwireguard interface new |
Creates a new wireguard interface. Before that, a new interface must be created. |
interface new name "wg0" type WIREGUARD | |
interface_name | Name of the wireguard interface | wireguard interface new interface_name "wg0" interface_description "wg_server" interface_keyobj_id "689" interface_listen_port "51820" | |
interface_description | Connection name in the overview | ||
interface_keyobj_id | ID of the key for the wireguard connection | ||
interface_listen_port | Port on which the wireguard connection is accepted | ||
wireguard interface setwireguard interface set |
Editing a Wireguard interface | wireguard interface set interface_id "691" interface_listen_port "51820" interface_keyobj_id "689" interface_keyobj_name "Wireguard-Key" | |
interface_id | ID of the wireguard interface | ||
interface_listen_port | Port on which the wireguard connection is accepted | ||
interface_keyobj_id | ID of the key for the wireguard connection | ||
interface_keyobj_name | Name of the key for the wireguard connection | ||
wireguard interface deletewireguard interface delete |
Deletes the Wireguard interface | wireguard interface delete interface_id "691" | |
interface_id | ID of the wireguard interface | ||
wireguard peerwireguard peer getwireguard peer get |
– | Listing of all Wireguard peers | wireguard peer get |
wireguard peer newwireguard peer new |
Creates a new peer for the Wireguard | wireguard peer new peer_name "peer" peer_public_keyobj_id "690" peer_endpoint [ ] peer_keepalive "25" peer_address_list [ 192.168.10.1/24 ] peer_interface_name_list [ wg0 ] notempty Syntax corrected
| |
peer_name | Name of the peers | ||
peer_public_keyobj_id | ID of the public key of the peer | ||
peer_psk | Optional. Pre-Shared Key of the peers | ||
peer_endpoint | End point of the peer | ||
peer_keepalive | Time of the keepalive in seconds of the peer | ||
peer_address_list | IP addresses used by the peer | ||
peer_interface_name_list | List of interface names to the peer | ||
wireguard peer setwireguard peer set |
Editing a Wireguard Peer | wireguard peer set peer_name "peer1" peer_public_keyobj_id "706" peer_endpoint [ ] peer_address_list ["192.168.11.1/24"] peer_keepalive "25" peer_interface_id_list ["710"] peer_id "5" | |
peer_name | Name of the peers | ||
peer_public_keyobj_id | ID of the public key of the peer | ||
peer_endpoint | End point of the peer | ||
peer_address_list | IP addresses used by the peer | ||
peer_psk | Optional. Pre-Shared Key of the peers | ||
peer_keepalive | Time of the keepalive in seconds of the peer | ||
peer_interface_id_list | List of IDs of the interfaces | ||
peer_id | ID of the peers | ||
wireguard peer deletewireguard peer delete |
Deletes a peer | wireguard peer delete peer_id "5" | |
peer_id | ID of the peers | ||
wireguard exportwireguard export |
Exports a Wireguard connection | wireguard export | |
wireguard pingwireguard ping |
Pings all peers in a list | wireguard ping peer_id_list "1" | |
peer_id_list | List of peers to be pinged |