Creating a VPN Connection Route

You can create a static route for a VPN connection.

This enables you to route traffic between the virtual gateway and the client gateway. You then need to update the route table with the new route. For more information, see About Routing Configuration for VPN Connections and Enabling Route Propagation.

This action is for static routing only. If your VPN connection uses dynamic routing, you do not need to create routes.

For more information about your existing VPN connection routes, see Getting Information About Your VPN Connections.

Creating a VPN Connection Route Using Cockpit v2

Before you begin: Create a VPN connection. For more information, see Creating a VPN Connection.

  1. In the VPN Connections dashboard, click the ID of the VPN connection you want to create a route for.
    The VPN connection details panel appears.

  2. On the VPN Route tab, click IconAddFull Create VPN Route.
    The CREATE VPN CONNECTION ROUTE dialog box appears.

  3. In the Destination IP Range, type the range of IPs of your corporate network, in CIDR notation.

  4. Click Create.
    A static VPN connection route is created for the selected VPN connection.

Creating a VPN Connection Route Using OSC CLI

Before you begin: Create a VPN connection. For more information, see Creating a VPN Connection.

The CreateVpnConnectionRoute command creates a static route to a VPN connection.
This enables you to select the network flows sent by the virtual gateway to the target VPN connection.

Request sample
$ osc-cli api CreateVpnConnectionRoute --profile "default" \
    --VpnConnectionId "vpn-12345678" \
    --DestinationIpRange "10.0.0.0/16"

This command contains the following attributes that you need to specify:

  • DestinationIpRange: The network prefix of the route, in CIDR notation (for example, 10.12.0.0/16).

  • DryRun: (optional) If true, checks whether you have the required permissions to perform the action.

  • VpnConnectionId: The ID of the target VPN connection of the static route.

The CreateVpnConnectionRoute command returns the following elements:

  • ResponseContext: Information about the context of the response.

Result sample
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  }
}

Creating a VPN Connection Route Using AWS CLI

Before you begin: Create a VPN connection. For more information, see Creating a VPN Connection.

To create a VPN connection route, use the create-vpn-connection-route command following this syntax:

Request sample
$ aws ec2 create-vpn-connection-route \
    --profile YOUR_PROFILE \
    --vpn-connection-id vpn-c750ea06 \
    --destination-cidr-block 172.0.0.0/24 \
    --endpoint https://fcu.eu-west-2.outscale.com

This command contains the following attributes that you need to specify:

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • vpn-connection-id: The ID of the VPN connection for which you want to create a route.

  • destination-cidr-block: The range of IPs of your corporate network, in CIDR notation.

  • endpoint: The endpoint corresponding to the Region you want to send the request to.

A static VPN connection route is created for the specified VPN connection.

Related Pages

Corresponding API Methods

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.