> For the complete documentation index, see [llms.txt](https://docs.islandrouter.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.islandrouter.com/island-router-cli-2.3.2/commands/vpn-key-exchange.md).

# vpn key-exchange

Exchange VPN keys and establish a VPN with a remote Island running the IslandExpress service.

## Syntax

```
vpn key-exchange <host> <secret>
```

## Syntax Description

<table><thead><tr><th width="203">Keyword</th><th>Description</th></tr></thead><tbody><tr><td>host</td><td>The name or IP address of the remote Island running the IslandExpress service.</td></tr><tr><td>secret</td><td>The shared secret configured with the <a href="https://docs.islandrouter.com/island-router-cli-2.3.2/commands/vpn-server/vpn-server-secret.md">vpn server secret</a> command on the remote Island.</td></tr></tbody></table>

## Defaults

None; all parameters must be specified.

## Usage Guidelines

Island supports an extention to the standard WireGuard protocol called IslandExpress that simplifies configuration of an Island-to-Island VPN. To use IslandExpress, one Island (typically the "hub" or "central" Island to which one or more remote Islands will be connecting) will configure and enable the IslandExpress service using the [vpn server](https://docs.islandrouter.com/island-router-cli-2.3.2/commands/vpn-server.md) commands, including a shared secret phrase.

Once IslandExpress has been configured on an Island, other Islands can establish a VPN to it using only the [vpn key-exchange](https://docs.islandrouter.com/island-router-cli-2.3.2/commands/vpn-key-exchange.md) command. Note that the IslandExpress service does not need to be configured on the Island on which the [vpn key-exchange](https://docs.islandrouter.com/island-router-cli-2.3.2/commands/vpn-key-exchange.md) command is run.

By default, a VPN created using the [vpn key-exchange](https://docs.islandrouter.com/island-router-cli-2.3.2/commands/vpn-key-exchange.md) command will be assigned a local IP address from a pool on the IslandExpress server to which it connects, and the IP address for traffic sent over the VPN will be translated to this address using NAT. However, once the VPN has been created, it can be modified as desired using the desired [vpn peer](https://docs.islandrouter.com/island-router-cli-2.3.2/commands/vpn-peer.md) commands.

A VPN created with this command will not be immediately available if the auto-trust option is enabled on the other Island. Refer to the [vpn server auto-trust](https://docs.islandrouter.com/island-router-cli-2.3.2/commands/vpn-server/vpn-server-auto-trust.md) command for more information.

## Examples

```
vpn key-exchange 198.51.100.28 mysecretpassword
```

## Related Commands

{% content-ref url="/pages/04CMOWdR0FTt4QxQ7pzD" %}
[vpn peer](https://docs.islandrouter.com/island-router-cli-2.3.2/commands/vpn-peer.md)
{% endcontent-ref %}

{% content-ref url="/pages/ZPVPrBGRPUnuTO1qawbS" %}
[vpn server](https://docs.islandrouter.com/island-router-cli-2.3.2/commands/vpn-server.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.islandrouter.com/island-router-cli-2.3.2/commands/vpn-key-exchange.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
