The VPC Public Gateway is a building block for your infrastructure on Scaleway's shared public cloud. It provides a set of managed network services and features for Scaleway's Private Networks such as DHCP, NAT and routing.
You need to have an HTTP client such as curl
to use Scaleway API. It is
also a good idea to have jq
which will help you to read and parse
JSON output. Make sure you have these two tools before you begin. Otherwise, use your package manager
to install them.
To call Scaleway API, you need an X-Auth-Token
. If you don't have one yet, refer to our
doc about generating API keys.
Next, you will need your Project ID to create VPC resources in. If you don't have it, refer to our doc about creating a Project.
Finally, you will need to choose the Availability Zone in which to create your VPC Public Gateways. Keep in mind that VPC Public Gateways are per zone and not per region, thus you will only be able to connect instances to networks from the same Availability Zone.
VPC Public Gateways come in multiple shapes and size, with various network capabilities, scale and features. You can find out all about them with the following command:
Keep the name
field from the response, as it contains information will need for the call to create your VPC Public Gateway.
You can customize the name, tags and project ID for the created VPC Public Gateway. There are other options, but they are out of the scope of this quickstart.
Keep the id
field from the response: it is your VPC Public Gateway ID, and will be used in
subsequent calls to the API. We will put it in a variable for the sake of readability:
To delete your VPC Public Gateway, you can use the following call:
Please note that the VPC Public Gateway takes some time to start up, and actions on it are
impossible unless it is in the running
state. To check the current state of a VPC Public Gateway,
use the following command:
A gateway is useless unless attached to one or more Private Networks. With a gateway, services like DHCP are available to the attached Private Networks. If you don't already have Private Networks to attach to your gateway, please follow the Private Networks quickstart guide to create at least one Private Network and attach instances to it.
For the sake of readability, we will put the Private Network ID in a variable:
Then, use the following call to attach the VPC Public Gateway to your Private Network using a pretty standard DHCP configuration
Keep the id
field of the response: it is your Gateway Network ID, which represents the association
between a VPC Public Gateway and a Private Network. It will allow you to manage such associations
and to unplug the gateway from the Private Network.
You may also notice the DHCP object in the query. A DHCP configuration is a separate resource from the Gateway Network since it is optional, and as such is managed separately.
This configuration will setup the gateway as a NAT gateway, masquerading traffic sent to it to the
outer internet to provide internet access to member instances of the Private Network, and serving
IP addresses through DHCP to said instances, in the subnet 192.168.1.0/24
.
To delete your Gateway Network, which equates to unplugging your VPC Public Gateway from the Private Network, you can use the following call:
As this is only a quickstart guide, we won't go much deeper into the usage of the gateway. Please refer to our API documentation to learn how to tweak your DHCP server, create static DHCP reservations, create PAT rules and more.
The VPC Public Gateway is a building block for your infrastructure on Scaleway's shared public cloud. It provides a set of managed network services and features for Scaleway's Private Networks such as DHCP, NAT and routing.
created_at_asc
, created_at_desc
, name_asc
, name_desc
, type_asc
, type_desc
, status_asc
and status_desc
. The default value is created_at_asc
.unknown
, stopped
, allocating
, configuring
, running
, stopping
, failed
, deleting
, deleted
and locked
. The default value is unknown
.unknown
, stopped
, allocating
, configuring
, running
, stopping
, failed
, deleting
, deleted
and locked
. The default value is unknown
.unknown
, stopped
, allocating
, configuring
, running
, stopping
, failed
, deleting
, deleted
and locked
. The default value is unknown
.unknown
, stopped
, allocating
, configuring
, running
, stopping
, failed
, deleting
, deleted
and locked
. The default value is unknown
.unknown
, stopped
, allocating
, configuring
, running
, stopping
, failed
, deleting
, deleted
and locked
. The default value is unknown
.A Gateway Network represents the connection of a Private Network to a VPC Public Gateway. It holds configuration options relative to this specific connection, such as the DHCP configuration.
created_at_asc
, created_at_desc
, status_asc
and status_desc
. The default value is created_at_asc
.dhcp_id
and address
may be set.unknown
, created
, attaching
, configuring
, ready
, detaching
and deleted
. The default value is unknown
.unknown
, created
, attaching
, configuring
, ready
, detaching
and deleted
. The default value is unknown
.unknown
, created
, attaching
, configuring
, ready
, detaching
and deleted
. The default value is unknown
.DHCP configuration allows you to set parameters for assignment of IP addresses to devices on a Private Network attached to a VPC Public Gateway (subnet, lease time etc).
created_at_asc
, created_at_desc
, subnet_asc
and subnet_desc
. The default value is created_at_asc
.DHCP entries hold both dynamic DHCP leases (IP addresses dynamically assigned by the gateway to instances) and static user-created DHCP reservations.
created_at_asc
, created_at_desc
, ip_address_asc
, ip_address_desc
, hostname_asc
and hostname_desc
. The default value is created_at_asc
.unknown
, reservation
and lease
. The default value is unknown
.Set the list of DHCP reservations attached to a Gateway Network. Reservations are identified by their MAC address, and will sync the current DHCP entry list to the given list, creating, updating or deleting DHCP entries.
unknown
, reservation
and lease
. The default value is unknown
.unknown
, reservation
and lease
. The default value is unknown
.PAT (Port Address Translation) rules are global to a gateway. They define the forwarding of a public port to a specific instance on a Private Network.
created_at_asc
, created_at_desc
, public_port_asc
and public_port_desc
. The default value is created_at_asc
.unknown
, both
, tcp
and udp
. The default value is unknown
.Set the list of PAT rules attached to a Gateway. Rules are identified by their public port and protocol. This will sync the current PAT rule list with the givent list, creating, updating or deleting PAT rules.
unknown
, both
, tcp
and udp
. The default value is unknown
.unknown
, both
, tcp
and udp
. The default value is unknown
.A VPC Public Gateway has a public IP address, allowing it to reach the public internet, as well as forward (masquerade) traffic from member instances of attached Private Networks.
created_at_asc
, created_at_desc
, ip_asc
, ip_desc
, reverse_asc
and reverse_desc
. The default value is created_at_asc
.Gateways come in multiple shapes and size, which are described by the various gateway types.
MISC methods
unknown
, stopped
, allocating
, configuring
, running
, stopping
, failed
, deleting
, deleted
and locked
. The default value is unknown
.