# vpn peer public-key

## Syntax

```
[no] vpn peer <id> public-key <key>
```

## Syntax Description

<table><thead><tr><th width="203">Keyword</th><th>Description</th></tr></thead><tbody><tr><td><code>no</code></td><td>(Optional) Removes the peer public key from the VPN.</td></tr><tr><td>id</td><td>The VPN identifier. Must be a number in the range 0-1022 or the keyword "auto".</td></tr><tr><td>key</td><td>The peer's public key</td></tr></tbody></table>

## Defaults

None; a peer's public key must be defined before communcations can take place.

## Usage Guidelines

Each end of a WireGuard VPN has a public/private key pair. The private key is known only to that end, while the public key is shared with the VPN's peer(s).

This command provides Island with a VPN peer's public key.

If a VPN exists with the specified identifier, the existing VPN will be modified; otherwise, a new VPN with the specified identifier will be created. If "auto" is specified for the identifier, a new VPN will be created using the next available identifier.

## Examples

```
vpn peer auto public-key 7cNt7EEQVVWVWh+63xY5+dU7uDGZk2IRKENcchJPuS0=
```

## Related Commands
