---
title: How to configure a Public Gateway
description: Learn how to configure a Public Gateway with the Scaleway console. Follow our step-by-step guide to set up routing, internet access, and SSH bastion for secure, scalable network connectivity.
tags: public-gateway public gateway dhcp nat smtp
dates:
  validation: 2025-11-21
  posted: 2021-05-26
---
import Requirements from '@macros/iam/requirements.mdx'

import image from './assets/scaleway-nat-add-static.webp'


This page shows you how to attach a [Public Gateway](/public-gateways/concepts/#public-gateway) to a Private Network, how to configure NAT and how to enable SMTP.

<Requirements />

- A Scaleway account logged into the [console](https://console.scaleway.com)
- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization
- [Created a Public Gateway](/public-gateways/how-to/create-a-public-gateway/)

## How to attach a Public Gateway to a Private Network

1. Click **Public Gateways** in the **Network** section of the [Scaleway console](https://console.scaleway.com) side menu. A listing of your Public Gateways displays.

2. Use the **region selector** at the top of the page to filter for the region of the Public Gateway you want to configure, then click the Public Gateway in the listing. The Public Gateway's **Overview** page displays.

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 the desired network from the drop-down list.
      <Message type="note">
        Only Private Networks which are in the same region as the Public Gateway are displayed in this list.
      </Message>
    - If you want to create and attach a new Private Network, select **Create a new Private Network**. You are prompted to enter a name and tags for the Private Network, and to select the VPC it should be created in. The Private Network will be created with default configuration, meaning its [CIDR block](/vpc/concepts#cidr-block) will be automatically defined. 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](/vpc/concepts/#cidr-block) defined at the time of creating the Private Network), or use a **[reserved IP address](/ipam/concepts/#reserved-ip-address)** for the attachment.
7. Use the toggle to select whether to tell the gateway whether or not it should [advertise the default route](/public-gateways/concepts/#default-route) to the internet for attached resources. When activated, other resources on this Private Network will learn the default route through the Public Gateway via DHCP. The route will also be installed in the VPC’s route table, and other Private Networks can [opt in](/vpc/how-to/manage-routing/#how-to-manage-default-route-scope) to receive it. 
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 [Scaleway console](https://console.scaleway.com) side menu. A listing of your Public Gateways displays.
2. Use the **region selector** at the top of the page to filter for the region of the Public Gateway you want to configure, then click the Public Gateway in the listing. The Public Gateway's **Overview** page displays.
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:
    <Lightbox image={image} alt="" />
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 <Icon name="validate" /> to save your configuration changes, or <Icon name="cancel" /> 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](/instances/how-to/send-emails-from-your-instance/) and then enable SMTP on your Public Gateway as follows:

1. Click **Public Gateways** in the **Network** section of the [Scaleway console](https://console.scaleway.com) side menu. A listing of your Public Gateways displays.
2. Use the **region selector** at the top of the page to filter for the region of the Public Gateway you want to configure, then click the Public Gateway in the listing. The Public Gateway's **Overview** page displays.
3. Click the **Settings** tab, scroll down to the **SMTP** panel, and use the toggle <Icon name="toggle" /> to enable SMTP.

<Message type="important">
  See our [troubleshooting](/public-gateways/troubleshooting/cant-connect-to-instance-with-pn-gateway/) documentation if you have any problems configuring your Public Gateway.
</Message>

## How to enable or disable default route advertisement

You can enable or disable [default route advertisement](/public-gateways/concepts/#default-route) at any time.

1. Click **Public Gateways** in the **Network** section of the [Scaleway console](https://console.scaleway.com) side menu. A listing of your Public Gateways displays.
2. Use the **region selector** at the top of the page to filter for the region of the Public Gateway you want to configure, then click the Public Gateway in the listing. The Public Gateway's **Overview** page displays.
3. Click the **Private Networks** tab, then use the toggle <Icon name="toggle" /> to enable or disable default route advertisement on this network.

<Message type="important">
If you disable advertisement of a default route, any other Private Networks that were [receiving this default route](/vpc/how-to/manage-routing/#how-to-manage-default-route-scope) will no longer be able to route traffic to this Public Gateway.
</Message>