Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


English


Panel
bgColor#F6F5F5
borderWidth0

You can create a NAT gateway in a subnet of a Virtual Private Cloud (VPC) to enable instances in this subnet to indirectly connect to the Internet. You can create one NAT gateway for each public subnet of the VPC.

To do so, you also need to:

  • Add a rule allowing outbound flows to the Internet to the security group used for the instances you want to connect to the Internet.
  • Add a route with the 0.0.0.0/0 CIDR block (or a smaller range of IP addresses) as destination and the ID of the newly created NAT gateway as target to the route table of the subnet containing your instances.


Table of Contents



Creating a NAT Gateway Using Cockpit

Before you begin: Allocate an External IP address (EIP) to your account. For more information, see Allocating an EIP to Your Account.


  1. Include Page
    INCL:_RC-FCU-SentPart-NavigationPanel
    INCL:_RC-FCU-SentPart-NavigationPanel
    click NAT Gateways
    Include Page
    INCL:_GRAPH-ico-Nav-NatGatewaysTab
    INCL:_GRAPH-ico-Nav-NatGatewaysTab
    .

  2. Click Create NAT Gateway
    Include Page
    INCL:_GRAPH-ico-Tools-Create
    INCL:_GRAPH-ico-Tools-Create
    .
    The
    Status
    colourBlue
    titleCreate NAT Gateway
    dialog box appears.

  3. Specify the following information for the NAT gateway to create:
    • From the VPC list, select the VPC for which you want to create the NAT gateway.
    • From the Subnet list, select the subnet in which you want to create the NAT gateway.
    • From the External IP list, select the EIP you want to associate with the NAT gateway.

  4. Click Create to validate.
    The NAT gateway is created and appears in the NAT Gateways tab.

Creating a NAT Gateway Using AWS CLI

Before you begin: Allocate an External IP address (EIP) to your account. For more information, see Allocating an EIP to Your Account.

 

  • To create a NAT gateway, use the create-nat-gateway command following this syntax:

    Code Block
    languagetext
    titleRequest sample
    $> aws ec2 create-nat-gateway \
    	--profile YOUR_PROFILE \
    	--subnet-id subnet-12345678 \
    	--allocation-id eipalloc-87654321 \
    	--endpoint https://fcu.eu-west-2.outscale.com

    Include Page
    INCL:_RC-General-SentPart-AWSCLIattributes
    INCL:_RC-General-SentPart-AWSCLIattributes

    • Include Page
      INCL:_RC-General-SentPart-AWSCLIProfile
      INCL:_RC-General-SentPart-AWSCLIProfile
    • subnet-id: The subnet in which you want to create the NAT gateway.  
    • allocation-id: The allocation ID of the EIP you want to associate with the NAT gateway.
    • Include Page
      INCL:_RC-General-SentPart-AWSCLIEndpoint
      INCL:_RC-General-SentPart-AWSCLIEndpoint


    The create-nat-gateway command returns the following elements:

    • NatGateway: Information about the newly created NAT gateway. This element contains the following information:

      • NatGatewayAddresses: Information about the EIP associated with the NAT gateway. This element contains the following information:
        • AllocationId: The ID of the allocation of the EIP.
        • PublicIp: The EIP associated with the NAT gateway.
    • VpcId: The ID of the VPC in which the NAT gateway is.

    • State: The state of the NAT gateway. For more information, see About NAT Devices.

    • NatGatewayId: The ID of the NAT gateway.

    • SubnetId: The ID of the subnet in which the NAT gateway is.

    • CreateTime: The date and time of creation of the NAT gateway.

    Code Block
    languagetext
    titleResult sample
     {
      "NatGateway": {
        "NatGatewayAddresses": [
          {
            "AllocationId": "eipalloc-87654321",
            "PublicIp": IP_ADDRESS
          }
        ],
        "VpcId": "vpc-1234abcd",
        "State": "pending",
        "NatGatewayId": "nat-4321dcba",
        "SubnetId": "subnet-12345678",
        "CreateTime": "2016-10-17T11:18:12.423Z"
      }
    }

    The NAT gateway is created.

 


French


Panel
bgColor#F6F5F5
borderWidth0

Vous pouvez créer une NAT gateway dans un subnet d'un Virtual Private Cloud (VPC) pour permettre aux instances de ce subnet de se connecter à internet de manière indirecte. Vous pouvez créer une NAT gateway pour chaque subnet public du VPC.

Pour cela, vous devez également :

  • Ajouter une règle autorisant les flux sortants vers internet aux security groups utilisés pour les instances que vous souhaitez connecter à internet.
  • Ajouter une route avec le bloc CIDR 0.0.0.0/0 (ou une plage d'adresses IP plus petite) en destination et l'ID de la NAT gateway nouvellement créée en target à la route table de ce subnet contenant vos instances.


Table of Contents



Créer une NAT gateway avec Cockpit

Avant de commencer : Allouez une External IP address (EIP) à votre compte. Pour en savoir plus, voir Allocating an EIP to Your Account.
  1.  

    Include Page
    INCL:_FR_RC-FCU-SentPart-NavigationPanel
    INCL:_FR_RC-FCU-SentPart-NavigationPanel
    click NAT Gateways
    Include Page
    INCL:_GRAPH-ico-Nav-NatGatewaysTab
    INCL:_GRAPH-ico-Nav-NatGatewaysTab
    .

  2. Cliquez sur Create NAT Gateway

    Include Page
    INCL:_GRAPH-ico-Tools-Create
    INCL:_GRAPH-ico-Tools-Create
    .
    La boîte de dialogue
    Status
    colourBlue
    titleCreate NAT
    gateway
    Gateway
    apparaît.

  3. Spécifiez les informations suivantes pour la NAT gateway à créer :

    1. Dans la liste VPC, sélectionnez le VPC pour lequel vous souhaitez créer une NAT gateway.

    2. Dans la liste Subnet, sélectionnez le subnet dans lequel vous souhaitez créer la NAT gateway.
    3. Dans la liste External IP, sélectionnez l'EIP que vous souhaitez associer à la NAT gateway.

  4. Cliquez sur Create pour valider.
    La NAT gateway est créée et apparaît dans l'onglet NAT Gateways.

Créer une NATgateway avec AWS CLI

Avant de commencer : Allouez une External IP address (EIP) à votre compte. Pour en savoir plus, voir Allocating an EIP to Your Account.

 

  • Pour créer une NAT gateway, utilisez la commande create-nat-gateway suivant cette syntaxe :

    Code Block
    languagetext
    titleExemple de requête
    $> aws ec2 create-nat-gateway \
    	--profile YOUR_PROFILE \
    	--subnet-id subnet-12345678 \
    	--allocation-id eipalloc-87654321 \
    	--endpoint https://fcu.eu-west-2.outscale.com

    Include Page
    INCL:_FR_RC-General-SentPart-AWSCLIattributes
    INCL:_FR_RC-General-SentPart-AWSCLIattributes

    • Include Page
      INCL:_FR_RC-General-SentPart-AWSCLIProfile
      INCL:_FR_RC-General-SentPart-AWSCLIProfile
    • subnet-id : Le subnet dans lequel vous souhaitez créer la NAT gateway. 
    • allocation-id : L'ID d'allocation de l'EIP que vous souhaitez associer à la NAT gateway.
    • Include Page
      INCL:_FR_RC-General-SentPart-AWSCLIEndpoint
      INCL:_FR_RC-General-SentPart-AWSCLIEndpoint


    La commande create-nat-gateway renvoie les éléments suivants :

    • NatGateway : Informations à propos de la NAT gateway nouvellement créée. Cet élément contient les informations suivantes :

      • NatGatewayAddresses : Informations à propos de l'EIP associée à la NAT gateway. Cet élément contient les informations suivantes : 
        • AllocationId : L'ID d'allocation de l'EIP.
        • PublicIp : L'EIP associée à la NAT gateway.
    • VpcId : L'ID du VPC dans lequel est la NAT gateway.

    • State : L'état de la NAT gateway. Pour en savoir plus, voir About NAT Devices.

    • NatGatewayId : L'ID de la NAT gateway.

    • SubnetId : L'ID du subnet dans lequel est la NAT gateway.

    • CreateTime : La date et l'heure de création de la NAT gateway.

    Code Block
    languagetext
    titleExemple de résultat
     {
      "NatGateway": {
        "NatGatewayAddresses": [
          {
            "AllocationId": "eipalloc-87654321",
            "PublicIp": IP_ADDRESS
          }
        ],
        "VpcId": "vpc-1234abcd",
        "State": "pending",
        "NatGatewayId": "nat-4321dcba",
        "SubnetId": "subnet-12345678",
        "CreateTime": "2016-10-17T11:18:12.423Z"
      }
    }

    La NAT gateway est créée.

 



English


Panel
borderColor#FFFFFF
bgColor#F6F5F5
borderWidth2
titleBGColor#E6E6E6
borderStylesolid
titleRelated Pages


Panel
borderColor#FFFFFF
bgColor#F6F5F5
borderWidth2
titleBGColor#E6E6E6
borderStylesolid
titleCorresponding API Method



French


Panel
borderColor#FFFFFF
bgColor#F6F5F5
borderWidth2
titleBGColor#E6E6E6
borderStylesolid
titlePages connexes


Panel
borderColor#FFFFFF
bgColor#F6F5F5
borderWidth2
titleBGColor#E6E6E6
borderStylesolid
titleMéthode API correspondante





Include Page
INCL:_RC-General-panel-LegalMentions
INCL:_RC-General-panel-LegalMentions