Scaleway logo
Commands

Documentation for `scw vpc-gw`

The CLI documentation pages are currently under construction

The content is up to date. We're making improvements to the site over the next few weeks for a better experience.

This API allows you to manage your Public Gateways.

Public Gateway management

Public Gateways are building blocks for your infrastructure on Scaleway's shared public cloud. They provide a set of managed network services and features for Scaleway's Private Networks such NAT and PAT rules.

Create a Public Gateway

Create a new Public Gateway in the specified Scaleway Project, defining its name, type and other configuration details such as whether to enable SSH bastion.

Usage:

TerminalCode
scw vpc-gw gateway create [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
project-idProject ID to use. If none is passed the default project ID will be used
nameName for the gatewayDefault: <generated>
tags.{index}Tags for the gateway
typeGateway type (commercial offer type)Default: VPC-GW-S
ip-idExisting IP address to attach to the gateway
enable-smtpDefines whether SMTP traffic should be allowed pass through the gateway
enable-bastionDefines whether SSH bastion should be enabled the gateway
bastion-portPort of the SSH bastion
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, it-mil-1, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3

Delete a Public Gateway

Delete an existing Public Gateway, specified by its gateway ID. This action is irreversible.

Usage:

TerminalCode
scw vpc-gw gateway delete <gateway-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
gateway-idID of the gateway to deleteRequired
delete-ipDefines whether the PGW's IP should be deleted
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, it-mil-1, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3

Get a Public Gateway

Get details of a Public Gateway, specified by its gateway ID. The response object contains full details of the gateway, including its name, type, status and more.

Usage:

TerminalCode
scw vpc-gw gateway get <gateway-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
gateway-idID of the gateway to fetchRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, it-mil-1, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3

List Public Gateways

List Public Gateways in a given Scaleway Organization or Project. By default, results are displayed in ascending order of creation date.

Usage:

TerminalCode
scw vpc-gw gateway list [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
order-byOrder in which to return resultsOne of: created_at_asc, created_at_desc, name_asc, name_desc, type_asc, type_desc, status_asc, status_desc
project-idInclude only gateways in this Project
nameFilter for gateways which have this search term in their name
tags.{index}Filter for gateways with these tags
types.{index}Filter for gateways of these types
status.{index}Filter for gateways with these status. Use unknown to include all statusesOne of: unknown_status, stopped, allocating, configuring, running, stopping, failed, deleting, locked
private-network-ids.{index}Filter for gateways attached to these Private Networks
include-legacyInclude also legacy gateways
organization-idInclude only gateways in this Organization
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, it-mil-1, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, all

Refresh a Public Gateway's SSH keys

Refresh the SSH keys of a given Public Gateway, specified by its gateway ID. This adds any new SSH keys in the gateway's Scaleway Project to the gateway itself.

Usage:

TerminalCode
scw vpc-gw gateway refresh-ssh-keys <gateway-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
gateway-idID of the gateway to refresh SSH keys onRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, it-mil-1, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3

Update a Public Gateway

Update the parameters of an existing Public Gateway, for example, its name, tags, SSH bastion configuration, and DNS servers.

Usage:

TerminalCode
scw vpc-gw gateway update <gateway-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
gateway-idID of the gateway to updateRequired
nameName for the gateway
tags.{index}Tags for the gateway
enable-bastionDefines whether SSH bastion should be enabled the gateway
bastion-portPort of the SSH bastion
enable-smtpDefines whether SMTP traffic should be allowed to pass through the gateway
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, it-mil-1, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3

Upgrade a Public Gateway to the latest version and/or to a different commercial offer type

Upgrade a given Public Gateway to the newest software version or to a different commercial offer type. This applies the latest bugfixes and features to your Public Gateway. Note that gateway service will be interrupted during the update.

Usage:

TerminalCode
scw vpc-gw gateway upgrade <gateway-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
gateway-idID of the gateway to upgradeRequired
typeGateway type (commercial offer)
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, it-mil-1, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3

Gateway Networks management

A Gateway Network represents the connection of a Private Network to a Public Gateway.

Attach a Public Gateway to a Private Network

Attach a specific Public Gateway to a specific Private Network (create a GatewayNetwork). You can configure parameters for the connection including whether to enable masquerade (dynamic NAT), and more.

Usage:

TerminalCode
scw vpc-gw gateway-network create [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
gateway-idPublic Gateway to connect
private-network-idPrivate Network to connect
enable-masqueradeDefines whether to enable masquerade (dynamic NAT) on the GatewayNetwork.
push-default-routeEnabling the default route also enables masquerading
ipam-ip-idUse this IPAM-booked IP ID as the Gateway's IP in this Private Network
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, it-mil-1, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3

Detach a Public Gateway from a Private Network

Detach a given Public Gateway from a given Private Network, i.e. delete a GatewayNetwork specified by a gateway_network_id.

Usage:

TerminalCode
scw vpc-gw gateway-network delete <gateway-network-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
gateway-network-idID of the GatewayNetwork to deleteRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, it-mil-1, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3

Get a Public Gateway connection to a Private Network

Get details of a given connection between a Public Gateway and a Private Network (this connection = a GatewayNetwork), specified by its gateway_network_id. The response object contains details of the connection including the IDs of the Public Gateway and Private Network, the dates the connection was created/updated and its configuration settings.

Usage:

TerminalCode
scw vpc-gw gateway-network get <gateway-network-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
gateway-network-idID of the GatewayNetwork to fetchRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, it-mil-1, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3

List Public Gateway connections to Private Networks

List the connections between Public Gateways and Private Networks (a connection = a GatewayNetwork). You can choose to filter by gateway-id to list all Private Networks attached to the specified Public Gateway, or by private_network_id to list all Public Gateways attached to the specified Private Network. Other query parameters are also available. The result is an array of GatewayNetwork objects, each giving details of the connection between a given Public Gateway and a given Private Network.

Usage:

TerminalCode
scw vpc-gw gateway-network list [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
order-byOrder in which to return resultsOne of: created_at_asc, created_at_desc, status_asc, status_desc
status.{index}Filter for GatewayNetworks with these status. Use unknown to include all statusesOne of: unknown_status, created, attaching, configuring, ready, detaching
gateway-ids.{index}Filter for GatewayNetworks connected to these gateways
private-network-ids.{index}Filter for GatewayNetworks connected to these Private Networks
masquerade-enabledFilter for GatewayNetworks with this enable_masquerade setting
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, it-mil-1, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, all

Update a Public Gateway's connection to a Private Network

Update the configuration parameters of a connection between a given Public Gateway and Private Network (the connection = a GatewayNetwork). Updatable parameters include whether to enable traffic masquerade (dynamic NAT).

Usage:

TerminalCode
scw vpc-gw gateway-network update <gateway-network-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
gateway-network-idID of the GatewayNetwork to updateRequired
enable-masqueradeDefines whether to enable masquerade (dynamic NAT) on the GatewayNetwork.
push-default-routeEnabling the default route also enables masquerading
ipam-ip-idUse this IPAM-booked IP ID as the Gateway's IP in this Private Network
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, it-mil-1, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3

Gateway types information

Public Gateways come in various shapes, sizes and prices, which are described by gateway types. They represent the different commercial offer types for Public Gateways available at Scaleway.

List Public Gateway types

List the different Public Gateway commercial offer types available at Scaleway. The response is an array of objects describing the name and technical details of each available gateway type.

Usage:

TerminalCode
scw vpc-gw gateway-type list [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, it-mil-1, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3

IP address management

Public, flexible IP addresses for Public Gateways, allowing the gateway to reach the public internet, as well as forward (masquerade) traffic from member devices of attached Private Networks.

Reserve an IP

Create (reserve) a new flexible IP address that can be used for a Public Gateway in a specified Scaleway Project.

Usage:

TerminalCode
scw vpc-gw ip create [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
project-idProject ID to use. If none is passed the default project ID will be used
tags.{index}Tags to give to the IP address
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, it-mil-1, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3

Delete an IP

Delete a flexible IP address from your account. This action is irreversible.

Usage:

TerminalCode
scw vpc-gw ip delete <ip-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
ip-idID of the IP address to deleteRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, it-mil-1, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3

Get an IP

Get details of a Public Gateway flexible IP address, identified by its IP ID. The response object contains information including which (if any) Public Gateway using this IP address, the reverse and various other metadata.

Usage:

TerminalCode
scw vpc-gw ip get <ip-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
ip-idID of the IP address to getRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, it-mil-1, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3

List IPs

List Public Gateway flexible IP addresses. A number of filter options are available for limiting results in the response.

Usage:

TerminalCode
scw vpc-gw ip list [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
order-byOrder in which to return resultsOne of: created_at_asc, created_at_desc, address_asc, address_desc, reverse_asc, reverse_desc
project-idFilter for IP addresses in this Project
tags.{index}Filter for IP addresses with these tags
reverseFilter for IP addresses that have a reverse containing this string
is-freeFilter based on whether the IP is attached to a gateway or not
organization-idInclude only gateways in this Organization
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, it-mil-1, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, all

Update an IP

Update details of an existing flexible IP address, including its tags, reverse and the Public Gateway it is assigned to.

Usage:

TerminalCode
scw vpc-gw ip update <ip-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
ip-idID of the IP address to updateRequired
tags.{index}Tags to give to the IP address
reverseReverse to set on the address. Empty string to unset
gateway-idGateway to attach the IP address to. Empty string to detach
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, it-mil-1, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3

PAT rules management

PAT (Port Address Translation) rules, aka static NAT rules, belong to a specified Public Gateway. They define the forwarding of a public port to a specific device on a Private Network, enabling enables ingress traffic from the public Internet to reach the correct device in the Private Network.

Create a PAT rule

Create a new PAT rule on a specified Public Gateway, defining the protocol to use, public port to listen on, and private port / IP address to map to.

Usage:

TerminalCode
scw vpc-gw pat-rule create [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
gateway-idID of the Gateway on which to create the rule
public-portPublic port to listen on
private-ipPrivate IP to forward data to
private-portPrivate port to translate to
protocolProtocol the rule should apply toOne of: unknown_protocol, both, tcp, udp
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, it-mil-1, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3

Delete a PAT rule

Delete a PAT rule, identified by its PAT rule ID. This action is irreversible.

Usage:

TerminalCode
scw vpc-gw pat-rule delete <pat-rule-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
pat-rule-idID of the PAT rule to deleteRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, it-mil-1, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3

Edit all PAT rules of a Public Gateway

This command starts your default editor to edit a marshaled version of your resource Default editor will be taken from $VISUAL, then $EDITOR or an editor based on your system

Usage:

TerminalCode
scw vpc-gw pat-rule edit <gateway-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
gateway-idID of the PAT rules' Public GatewayRequired
modemarshaling used when editing dataDefault: yaml
One of: yaml, json
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1

Get a PAT rule

Get a PAT rule, specified by its PAT rule ID. The response object gives full details of the PAT rule, including the Public Gateway it belongs to and the configuration settings in terms of public / private ports, private IP and protocol.

Usage:

TerminalCode
scw vpc-gw pat-rule get <pat-rule-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
pat-rule-idID of the PAT rule to getRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, it-mil-1, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3

List PAT rules

List PAT rules. You can filter by gateway ID to list all PAT rules for a particular gateway, or filter for PAT rules targeting a specific IP address or using a specific protocol.

Usage:

TerminalCode
scw vpc-gw pat-rule list [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
order-byOrder in which to return resultsOne of: created_at_asc, created_at_desc, public_port_asc, public_port_desc
gateway-ids.{index}Filter for PAT rules on these gateways
private-ips.{index}Filter for PAT rules targeting these private ips
protocolFilter for PAT rules with this protocolOne of: unknown_protocol, both, tcp, udp
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, it-mil-1, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, all

Set all PAT rules

Set a definitive list of PAT rules attached to a Public Gateway. Each rule is identified by its public port and protocol. This will sync the current PAT rule list on the gateway with the new list, creating, updating or deleting PAT rules accordingly.

Usage:

TerminalCode
scw vpc-gw pat-rule set [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
gateway-idID of the gateway on which to set the PAT rules
pat-rules.{index}.public-portPublic port to listen on
pat-rules.{index}.private-ipPrivate IP to forward data to
pat-rules.{index}.private-portPrivate port to translate to
pat-rules.{index}.protocolProtocol the rule should apply toOne of: unknown_protocol, both, tcp, udp
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, it-mil-1, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3

Update a PAT rule

Update a PAT rule, specified by its PAT rule ID. Configuration settings including private/public port, private IP address and protocol can all be updated.

Usage:

TerminalCode
scw vpc-gw pat-rule update <pat-rule-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
pat-rule-idID of the PAT rule to updateRequired
public-portPublic port to listen on
private-ipPrivate IP to forward data to
private-portPrivate port to translate to
protocolProtocol the rule should apply toOne of: unknown_protocol, both, tcp, udp
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, it-mil-1, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3