NavigationContentFooter
Jump toSuggest an edit

How to configure a Public Gateway

Reviewed on 25 June 2024Published on 26 May 2021

This page shows you how to attach a Public Gateway to a Private Network, how to configure NAT and how to enable SMTP.

Before you start

To complete the actions presented below, you must have:

  • A Scaleway account logged into the console
  • Owner status or IAM permissions allowing you to perform actions in the intended Organization
  • Created a Public Gateway

How to attach a Public Gateway to a Private Network

  1. Click Public Gateways in the Network section of the side menu.

  2. Click the Public Gateway that you want to attach to a Private Network. You are taken to the Overview page for that Public Gateway.

  3. Click the Private Networks tab. A list of Private Networks attached to the Public Gateway displays. If no Private Networks are attached, the list will be empty.

  4. Click Attach to a Private Network to attach a new Private Network to the Public Gateway.

  5. Choose to attach an existing or a new Private Network.

    • If you want to attach an existing Private Network, select Attach to an existing Private Network and choose the desired network from the drop-down list.
      Note

      Only Private Networks which are in the same region as the Public Gateway are displayed in this list.

    • If you want to create and attach a new Private Network, select Attach to a new Private Network. The Private Network will be created with default configuration (a CIDR block will be automatically defined), in your default VPC for the region. A name for the Private Network will be suggested for you, but feel free to overwrite this with a new name of your choice. Dynamic NAT will be automatically activated on the Public Gateway for the Private Network.
  6. Choose whether to auto-allocate an available IP from the pool (the CIDR block defined at the time of creating the Private Network), or use a reserved IP address for the attachment.

  7. Use the toggle to select whether to Advertise the default route. Find out more about this setting in our concepts documentation.

  8. Click Attach to Private Network to finish. You are taken back to the Private Networks tab, where the network you attached now appears, along with the services configured and the IP address of the Public Gateway.

Your Private Network is now attached to your Public Gateway. You can repeat the steps above to attach more Private Networks to the same Public Gateway if you wish.

How to review and configure NAT

Dynamic NAT is automatically activated. However, you can review and (if you wish) modify the NAT configuration of an existing Public Gateway as follows:

  1. Click Public Gateways in the Network section of the side menu.

  2. Click the Public Gateway whose configuration you wish to modify. You are taken to the Overview page for that Public Gateway.

  3. Click the NAT tab.

  4. Use the toggle to deactivate dynamic NAT if desired. To add a new static NAT configuration for any Private Network attached to this gateway, click Add Static NAT. The following screen displays:

  5. Add the following information for your new static NAT configuration:

    • Protocol: Choose TCP, UDP or Both from the drop-down menu
    • Public Port: Choose the Public Gateway port you want to use for this mapping
    • Private IP address: Enter the Private IP address of the Instance you want to map to. This should be included within one of the configured subnets of an attached Private Network. Usually, a static DHCP association is used too, to make sure this address does not change.
    • Private Port: Choose which of the Instance’s ports you want to map to.
  6. Click «Validate Icon» to save your configuration changes, or «Cancel Icon» to cancel.

    Your new NAT configuration is now saved, and displays on the NAT panel. You can repeat steps 4-6 to add new static NAT configurations as you wish.

How to enable SMTP

By default, the SMTP ports (25, 465, 587 and 2525) on your Public Gateway are blocked to avoid spam. If you wish to send emails from resources located behind your Public Gateway, make sure those resources have also enabled SMTP and then enable SMTP on your Public Gateway as follows:

  1. Click Public Gateways in the Network section of the side menu.
  2. Click the Public Gateway whose configuration you wish to modify. You are taken to the Overview page for that Public Gateway.
  3. Scroll down to the SMTP panel, and use the toggle «Toogle Icon» to enable SMTP.
Important

See our troubleshooting documentation if you have any problems configuring your Public Gateway.

See also
How to create a Public GatewayHow to upgrade a Public Gateway
Docs APIScaleway consoleDedibox consoleScaleway LearningScaleway.comPricingBlogCarreer
© 2023-2024 – Scaleway