id
stringlengths 8
78
| source
stringclasses 743
values | chunk_id
int64 1
5.05k
| text
stringlengths 593
49.7k
|
---|---|---|---|
vpc-ug-004 | vpc-ug.pdf | 4 | AWS Command Line Interface. • AWS SDKs — Provides language-specific APIs and takes care of many of the connection details, such as calculating signatures, handling request retries, and error handling. For more information, see AWS SDKs. • Query API — Provides low-level API actions that you call using HTTPS requests. Using the Query API is the most direct way to access Amazon VPC, but it requires that your application handle low-level details such as generating the hash to sign the request, and error handling. For more information, see Amazon VPC actions in the Amazon EC2 API Reference. Pricing for Amazon VPC There's no additional charge for using a VPC. There are, however, charges for some VPC components, such as NAT gateways, IP Address Manager, traffic mirroring, Reachability Analyzer, and Network Access Analyzer. For more information, see Amazon VPC Pricing. Nearly all resources that you launch in your virtual private cloud (VPC) provide you with an IP address for connectivity. The vast majority of resources in your VPC use private IPv4 addresses. Resources that require direct access to the internet over IPv4, however, use public IPv4 addresses. Amazon VPC enables you to launch managed services, such as Elastic Load Balancing, Amazon RDS, and Amazon EMR, without having a VPC set up beforehand. It does this by using the default Getting started with Amazon VPC 3 Amazon Virtual Private Cloud User Guide VPC in your account if you have one. Any public IPv4 addresses provisioned to your account by the managed service will be charged. These charges will be associated with Amazon VPC service in your AWS Cost and Usage Report. Pricing for public IPv4 addresses A public IPv4 address is an IPv4 address that is routable from the internet. A public IPv4 address is necessary for a resource to be directly reachable from the internet over IPv4. If you are an existing or new AWS Free Tier customer, you get 750 hours of public IPv4 address usage with the EC2 service at no charge. If you are not using the EC2 service in the AWS Free Tier, Public IPv4 addresses are charged. For specific pricing information, see the Public IPv4 address tab in Amazon VPC Pricing. Private IPv4 addresses (RFC 1918) are not charged. For more information about how public IPv4 addresses are charged for shared VPCs, see Billing and metering for the owner and participants. Public IPv4 addresses have the following types: • Elastic IP addresses (EIPs): Static, public IPv4 addresses provided by Amazon that you can associate with an EC2 instance, elastic network interface, or AWS resource. • EC2 public IPv4 addresses: Public IPv4 addresses assigned to an EC2 instance by Amazon (if the EC2 instance is launched into a default subnet or if the instance is launched into a subnet that’s been configured to automatically assign a public IPv4 address). • BYOIPv4 addresses: Public IPv4 addresses in the IPv4 address range that you’ve brought to AWS using Bring your own IP addresses (BYOIP). • Service-managed IPv4 addresses: Public IPv4 addresses automatically provisioned on AWS resources and managed by an AWS service. For example, public IPv4 addresses on Amazon ECS, Amazon RDS, or Amazon WorkSpaces. The following list shows the most common AWS services that can use public IPv4 addresses. • Amazon AppStream 2.0 • AWS Client VPN • AWS Database Migration Service • Amazon EC2 • Amazon Elastic Container Service Pricing for Amazon VPC 4 User Guide Amazon Virtual Private Cloud • Amazon EKS • Amazon EMR • Amazon GameLift Servers • AWS Global Accelerator • AWS Mainframe Modernization • Amazon Managed Streaming for Apache Kafka • Amazon MQ • Amazon RDS • Amazon Redshift • AWS Site-to-Site VPN • Amazon VPC NAT gateway • Amazon WorkSpaces • Elastic Load Balancing Pricing for Amazon VPC 5 Amazon Virtual Private Cloud User Guide How Amazon VPC works With Amazon Virtual Private Cloud (Amazon VPC), you can launch AWS resources in a logically isolated virtual network that you've defined. This virtual network closely resembles a traditional network that you'd operate in your own data center, with the benefits of using the scalable infrastructure of AWS. The following is a visual representation of a VPC and its resources from the Preview pane shown when you create a VPC using the AWS Management Console. For an existing VPC, you can access this visualization on the Resource map tab. This example shows the resources that are initially selected on the Create VPC page when you choose to create the VPC plus other networking resources. This VPC is configured with an IPv4 CIDR and an Amazon-provided IPv6 CIDR, subnets in two Availability Zones, three route tables, an internet gateway, and a gateway endpoint. Because we've selected the internet gateway, the visualization indicates that traffic from the public subnets is routed to the internet because |
vpc-ug-005 | vpc-ug.pdf | 5 | pane shown when you create a VPC using the AWS Management Console. For an existing VPC, you can access this visualization on the Resource map tab. This example shows the resources that are initially selected on the Create VPC page when you choose to create the VPC plus other networking resources. This VPC is configured with an IPv4 CIDR and an Amazon-provided IPv6 CIDR, subnets in two Availability Zones, three route tables, an internet gateway, and a gateway endpoint. Because we've selected the internet gateway, the visualization indicates that traffic from the public subnets is routed to the internet because the corresponding route table sends the traffic to the internet gateway. Concepts • VPCs and subnets • Default and nondefault VPCs • Route tables • Access the internet • Access a corporate or home network • Connect VPCs and networks 6 Amazon Virtual Private Cloud • AWS private global network VPCs and subnets User Guide A virtual private cloud (VPC) is a virtual network dedicated to your AWS account. It is logically isolated from other virtual networks in the AWS Cloud. You can specify an IP address range for the VPC, add subnets, add gateways, and associate security groups. A subnet is a range of IP addresses in your VPC. You launch AWS resources, such as Amazon EC2 instances, into your subnets. You can connect a subnet to the internet, other VPCs, and your own data centers, and route traffic to and from your subnets using route tables. Learn more • IP addressing • Virtual private clouds • Subnets Default and nondefault VPCs If your account was created after December 4, 2013, it comes with a default VPC in each Region. A default VPC is configured and ready for you to use. For example, it has a default subnet in each Availability Zone in the Region, an attached internet gateway, a route in the main route table that sends all traffic to the internet gateway, and DNS settings that automatically assign public DNS hostnames to instances with public IP addresses and enable DNS resolution through the Amazon- provided DNS server (see DNS attributes for your VPC). Therefore, an EC2 instance that is launched in a default subnet automatically has access to the internet. If you have a default VPC in a Region and you don't specify a subnet when you launch an EC2 instance into that Region, we choose one of the default subnets and launch the instance into that subnet. You can also create your own VPC, and configure it as you need. This is known as a nondefault VPC. Subnets that you create in your nondefault VPC and additional subnets that you create in your default VPC are called nondefault subnets. Learn more • the section called “Default VPCs” VPCs and subnets 7 Amazon Virtual Private Cloud User Guide • the section called “Create a VPC” Route tables A route table contains a set of rules, called routes, that are used to determine where network traffic from your VPC is directed. You can explicitly associate a subnet with a particular route table. Otherwise, the subnet is implicitly associated with the main route table. Each route in a route table specifies the range of IP addresses where you want the traffic to go (the destination) and the gateway, network interface, or connection through which to send the traffic (the target). Learn more • Configure route tables Access the internet You control how the instances that you launch into a VPC access resources outside the VPC. A default VPC includes an internet gateway, and each default subnet is a public subnet. Each instance that you launch into a default subnet has a private IPv4 address and a public IPv4 address. These instances can communicate with the internet through the internet gateway. An internet gateway enables your instances to connect to the internet through the Amazon EC2 network edge. By default, each instance that you launch into a nondefault subnet has a private IPv4 address, but no public IPv4 address, unless you specifically assign one at launch, or you modify the subnet's public IP address attribute. These instances can communicate with each other, but can't access the internet. You can enable internet access for an instance launched into a nondefault subnet by attaching an internet gateway to its VPC (if its VPC is not a default VPC) and associating an Elastic IP address with the instance. Alternatively, to allow an instance in your VPC to initiate outbound connections to the internet but prevent unsolicited inbound connections from the internet, you can use a network address translation (NAT) device. NAT maps multiple private IPv4 addresses to a single public IPv4 address. You can configure the NAT device with an Elastic IP address and connect it to the internet through an internet gateway. |
vpc-ug-006 | vpc-ug.pdf | 6 | internet access for an instance launched into a nondefault subnet by attaching an internet gateway to its VPC (if its VPC is not a default VPC) and associating an Elastic IP address with the instance. Alternatively, to allow an instance in your VPC to initiate outbound connections to the internet but prevent unsolicited inbound connections from the internet, you can use a network address translation (NAT) device. NAT maps multiple private IPv4 addresses to a single public IPv4 address. You can configure the NAT device with an Elastic IP address and connect it to the internet through an internet gateway. This makes it possible for an instance in a private subnet to connect to the Route tables 8 Amazon Virtual Private Cloud User Guide internet through the NAT device, routing traffic from the instance to the internet gateway and any responses to the instance. If you associate an IPv6 CIDR block with your VPC and assign IPv6 addresses to your instances, instances can connect to the internet over IPv6 through an internet gateway. Alternatively, instances can initiate outbound connections to the internet over IPv6 using an egress-only internet gateway. IPv6 traffic is separate from IPv4 traffic; your route tables must include separate routes for IPv6 traffic. Learn more • Enable internet access for a VPC using an internet gateway • Enable outbound IPv6 traffic using an egress-only internet gateway • Connect to the internet or other networks using NAT devices Access a corporate or home network You can optionally connect your VPC to your own corporate data center using an IPsec AWS Site- to-Site VPN connection, making the AWS Cloud an extension of your data center. A Site-to-Site VPN connection consists of two VPN tunnels between a virtual private gateway or transit gateway on the AWS side, and a customer gateway device located in your data center. A customer gateway device is a physical device or software appliance that you configure on your side of the Site-to-Site VPN connection. Learn more • AWS Site-to-Site VPN User Guide • Amazon VPC Transit Gateways Connect VPCs and networks You can create a VPC peering connection between two VPCs that enables you to route traffic between them privately. Instances in either VPC can communicate with each other as if they are within the same network. You can also create a transit gateway and use it to interconnect your VPCs and on-premises networks. The transit gateway acts as a Regional virtual router for traffic flowing between its Access a corporate or home network 9 Amazon Virtual Private Cloud User Guide attachments, which can include VPCs, VPN connections, AWS Direct Connect gateways, and transit gateway peering connections. Learn more • Amazon VPC Peering Guide • Amazon VPC Transit Gateways AWS private global network AWS provides a high-performance, and low-latency private global network that delivers a secure cloud computing environment to support your networking needs. AWS Regions are connected to multiple Internet Service Providers (ISPs) as well as to a private global network backbone, which provides improved network performance for cross-Region traffic sent by customers. Packets that originate in the private global network with a destination in the private global network stay in the private global network and do not traverse the public internet. This is true whether the destination is a private IP address or a public IP address. For example, if EC2 instances in two VPCs communicate using public IP addresses, the traffic stays in the private global network. The destination can be in the same Availability Zone, a different Availability Zone in the same Region, or a different Region, except for the China Regions. Network packet loss can be caused by a number of factors, including network flow collisions, lower level (Layer 2) errors, and other network failures. We engineer and operate our networks to minimize packet loss. We measure packet-loss rate (PLR) across the global backbone that connects the AWS Regions. We operate our backbone network to target a p99 of the hourly PLR of less than 0.0001%. AWS private global network 10 Amazon Virtual Private Cloud User Guide Plan your VPC Complete the following tasks to prepare to create and connect your VPCs. When you are finished, you will be ready to deploy your application on AWS. Tasks • Sign up for an AWS account • Verify permissions • Determine your IP address ranges • Select your Availability Zones • Plan your internet connectivity • Create your VPC • Deploy your application Sign up for an AWS account If you do not have an AWS account, complete the following steps to create one. To sign up for an AWS account 1. Open https://portal.aws.amazon.com/billing/signup. 2. Follow the online instructions. Part of the sign-up procedure involves receiving a phone call and entering a verification code on the phone keypad. When you sign up |
vpc-ug-007 | vpc-ug.pdf | 7 | to deploy your application on AWS. Tasks • Sign up for an AWS account • Verify permissions • Determine your IP address ranges • Select your Availability Zones • Plan your internet connectivity • Create your VPC • Deploy your application Sign up for an AWS account If you do not have an AWS account, complete the following steps to create one. To sign up for an AWS account 1. Open https://portal.aws.amazon.com/billing/signup. 2. Follow the online instructions. Part of the sign-up procedure involves receiving a phone call and entering a verification code on the phone keypad. When you sign up for an AWS account, an AWS account root user is created. The root user has access to all AWS services and resources in the account. As a security best practice, assign administrative access to a user, and use only the root user to perform tasks that require root user access. AWS sends you a confirmation email after the sign-up process is complete. At any time, you can view your current account activity and manage your account by going to https://aws.amazon.com/ and choosing My Account. Sign up for an AWS account 11 Amazon Virtual Private Cloud Verify permissions User Guide Before you can use Amazon VPC, you must have the required permissions. For more information, see Identity and access management for Amazon VPC and Amazon VPC policy examples. Determine your IP address ranges The resources in your VPC communicate with each other and with resources over the internet using IP addresses. When you create VPCs and subnets, you can select their IP address ranges. When you deploy resources in a subnet, such as EC2 instances, they receive IP addresses from the IP address range of the subnet. For more information, see IP addressing. As you choose a size for your VPC, consider how many IP addresses you'll need across your AWS accounts and VPCs. Ensure that the IP address ranges for your VPCs don't overlap with the IP address ranges for your own network. If you need connectivity between multiple VPCs, you must ensure that they have no overlapping IP addresses. IP Address Manager (IPAM) makes it easier to plan, track, and monitor the IP addresses for your application. For more information, see the IP Address Manager Guide. Select your Availability Zones An AWS Region is a physical location where we cluster data centers, known as Availability Zones. Each Availability Zone has independent power, cooling, and physical security, with redundant power, networking, and connectivity. The Availability Zones in a Region are physically separated by a meaningful distance, and interconnected through high-bandwidth, low-latency networking. You can design your application to run in multiple Availability Zones to achieve even greater fault tolerance. Production environment For a production environment, we recommend that you select at least two Availability Zones and deploy your AWS resources evenly in each active Availability Zone. Development or test environment For a development or test environment, you might choose to save money by deploying your resources in only one Availability Zone. Verify permissions 12 Amazon Virtual Private Cloud User Guide Plan your internet connectivity Plan to divide each VPC into subnets based on your connectivity requirements. For example: • If you have web servers that will receive traffic from clients on the internet, create a subnet for these servers in each Availability Zone. • If you also have servers that will receive traffic only from other servers in the VPC, create a separate subnet for these servers in each Availability Zone. • If you have servers that will receive traffic only through a VPN connection to your network, create a separate subnet for these servers in each Availability Zone. If your application will receive traffic from the internet, the VPC must have an internet gateway. Attaching an internet gateway to a VPC does not automatically make your instances accessible from the internet. In addition to attaching the internet gateway, you must update the subnet route table with a route to the internet gateway. You must also ensure that the instances have public IP addresses and an associated security group that allows traffic from the internet over specific ports and protocols required by your application. Alternatively, register your instances with an internet-facing load balancer. The load balancer receives traffic from the clients and distributes it across the registered instances in one or more Availability Zones. For more information, see Elastic Load Balancing. To allow instances in a private subnet to access the internet (for example, to download updates) without allowing unsolicited inbound connections from the internet, add a public NAT gateway in each active Availability Zone and update the route table to send internet traffic to the NAT gateway. For more information, see the section called “Access the internet from a private subnet”. Create your VPC After you've determined the number |
vpc-ug-008 | vpc-ug.pdf | 8 | internet-facing load balancer. The load balancer receives traffic from the clients and distributes it across the registered instances in one or more Availability Zones. For more information, see Elastic Load Balancing. To allow instances in a private subnet to access the internet (for example, to download updates) without allowing unsolicited inbound connections from the internet, add a public NAT gateway in each active Availability Zone and update the route table to send internet traffic to the NAT gateway. For more information, see the section called “Access the internet from a private subnet”. Create your VPC After you've determined the number of VPCs and subnets that you need, what CIDR blocks to assign to your VPCs and subnets, and how to connect your VPC to the internet, you are ready to create your VPC. If you create your VPC using the AWS Management Console and include public subnets in your configuration, we create a route table for the subnet and add the routes required for direct access to the internet. For more information, see the section called “Create a VPC”. Deploy your application After you've created your VPC, you can deploy your application. Plan your internet connectivity 13 Amazon Virtual Private Cloud Production environment User Guide For a production environment, you can use one of the following services to deploy servers in multiple Availability Zones, to configure scaling so that you maintain the minimum number of servers required by your application, and to register your servers with a load balancer to distribute traffic evenly across your servers. • Amazon EC2 Auto Scaling • EC2 Fleet • Amazon Elastic Container Service (Amazon ECS) Development or test environment For a development or test environment, you might choose to launch a single EC2 instance. For more information, see Get started with Amazon EC2 in the Amazon EC2 User Guide. Deploy your application 14 Amazon Virtual Private Cloud User Guide IP addressing for your VPCs and subnets IP addresses enable resources in your VPC to communicate with each other, and with resources over the internet. Classless Inter-Domain Routing (CIDR) notation is a way to represent an IP address and its network mask. The format of these addresses is as follows: • An individual IPv4 address is 32 bits, with 4 groups of up to 3 decimal digits. For example, 10.0.1.0. • An IPv4 CIDR block has four groups of up to three decimal digits, 0-255, separated by periods, followed by a slash and a number from 0 to 32. For example, 10.0.0.0/16. • An individual IPv6 address is 128 bits, with 8 groups of 4 hexadecimal digits. For example, 2001:0db8:85a3:0000:0000:8a2e:0370:7334. • An IPv6 CIDR block has four groups of up to four hexadecimal digits, separated by colons, followed by a double colon, followed by a slash and a number from 1 to 128. For example, 2001:db8:1234:1a00::/56. For more information, see What is CIDR? Contents • Private IPv4 addresses • Public IPv4 addresses • IPv6 addresses • Use your own IP addresses • Use Amazon VPC IP Address Manager • VPC CIDR blocks • Subnet CIDR blocks • Compare IPv4 and IPv6 • Consolidate and manage network CIDR blocks with managed prefix lists • AWS IP address ranges • IPv6 support for your VPC 15 Amazon Virtual Private Cloud • AWS services that support IPv6 Private IPv4 addresses User Guide Private IPv4 addresses (also referred to as private IP addresses in this topic) are not reachable over the internet, and can be used for communication between the instances in your VPC. When you launch an instance into a VPC, a primary private IP address from the IPv4 address range of the subnet is assigned to the primary network interface (for example, eth0) of the instance. Each instance is also given a private (internal) DNS hostname that resolves to the private IP address of the instance. The hostname can be of two types: resource-based or IP-based. For more information, see EC2 instance naming. If you don't specify a primary private IP address, we select an available IP address in the subnet range for you. For more information about network interfaces, see Elastic Network Interfaces in the Amazon EC2 User Guide. You can assign additional private IP addresses, known as secondary private IP addresses, to instances that are running in a VPC. Unlike a primary private IP address, you can reassign a secondary private IP address from one network interface to another. A private IP address remains associated with the network interface when the instance is stopped and restarted, and is released when the instance is terminated. For more information about primary and secondary IP addresses, see Multiple IP Addresses in the Amazon EC2 User Guide. We refer to private IP addresses as the IP addresses that are within the IPv4 CIDR range of the VPC. Most VPC |
vpc-ug-009 | vpc-ug.pdf | 9 | known as secondary private IP addresses, to instances that are running in a VPC. Unlike a primary private IP address, you can reassign a secondary private IP address from one network interface to another. A private IP address remains associated with the network interface when the instance is stopped and restarted, and is released when the instance is terminated. For more information about primary and secondary IP addresses, see Multiple IP Addresses in the Amazon EC2 User Guide. We refer to private IP addresses as the IP addresses that are within the IPv4 CIDR range of the VPC. Most VPC IP address ranges fall within the private (non-publicly routable) IP address ranges specified in RFC 1918; however, you can use publicly routable CIDR blocks for your VPC. Regardless of the IP address range of your VPC, we do not support direct access to the internet from your VPC's CIDR block, including a publicly-routable CIDR block. You must set up internet access through a gateway; for example, an internet gateway, virtual private gateway, a AWS Site-to-Site VPN connection, or AWS Direct Connect. We never advertise the IPv4 address range of a subnet to the internet. Public IPv4 addresses All subnets have an attribute that determines whether a network interface created in the subnet automatically receives a public IPv4 address (also referred to as a public IP address in this topic). Therefore, when you launch an instance into a subnet that has this attribute enabled, a public IP address is assigned to the primary network interface that's created for the instance. A public IP address is mapped to the primary private IP address through network address translation (NAT). Private IPv4 addresses 16 Amazon Virtual Private Cloud User Guide Note AWS charges for all public IPv4 addresses, including public IPv4 addresses associated with running instances and Elastic IP addresses. For more information, see the Public IPv4 Address tab on the Amazon VPC pricing page. You can control whether your instance receives a public IP address by doing the following: • Modifying the public IP addressing attribute of your subnet. For more information, see Modify the IP addressing attributes of your subnet. • Enabling or disabling the public IP addressing feature during instance launch, which overrides the subnet's public IP addressing attribute. • You can unassign a public IP address from your instance after launch by managing the IP addresses associated with a network interface. For more information, see Manage IP addresses in the Amazon EC2 User Guide. A public IP address is assigned from Amazon's pool of public IP addresses; it's not associated with your account. When a public IP address is disassociated from your instance, it's released back into the pool, and is no longer available for you to use. In certain cases, we release the public IP address from your instance, or assign it a new one. For more information, see Public IP addresses in the Amazon EC2 User Guide. If you require a persistent public IP address allocated to your account that can be assigned to and removed from instances as you require, use an Elastic IP address instead. For more information, see Associate Elastic IP addresses with resources in your VPC. If your VPC is enabled to support DNS hostnames, each instance that receives a public IP address or an Elastic IP address is also given a public DNS hostname. We resolve a public DNS hostname to the public IP address of the instance outside the instance network, and to the private IP address of the instance from within the instance network. For more information, see DNS attributes for your VPC. If you are using Amazon VPC IP Address Manager (IPAM), you can get a contiguous block of public IPv4 addresses from AWS and use it to allocate sequential Elastic IP addresses to AWS resources. Using contiguous IPv4 address blocks can significantly reduce management overhead for security access control lists and simplify IP address allocation and tracking for enterprises scaling on AWS. For more information, see Allocate sequential Elastic IP addresses from an IPAM pool in the Amazon VPC IPAM User Guide. Public IPv4 addresses 17 Amazon Virtual Private Cloud IPv6 addresses User Guide As the internet continues to grow, so does the need for IP addresses. The most common format for IP addresses is IPv4. The new format for IP addresses is IPv6, which provides a larger address space than IPv4. IPv6 resolves the IPv4 address exhaustion issue and enables you to connect more devices to the internet. The transition is gradual, but as IPv6 adoption grows, you can simplify your networks and take advantage of IPv6 advanced capabilities for better connectivity, performance, and security. Many AWS services, such as Amazon EC2, Amazon S3, and Amazon CloudFront, offer either dual- stack (IPv4 and IPv6) or IPv6-only support, allowing |
vpc-ug-010 | vpc-ug.pdf | 10 | grow, so does the need for IP addresses. The most common format for IP addresses is IPv4. The new format for IP addresses is IPv6, which provides a larger address space than IPv4. IPv6 resolves the IPv4 address exhaustion issue and enables you to connect more devices to the internet. The transition is gradual, but as IPv6 adoption grows, you can simplify your networks and take advantage of IPv6 advanced capabilities for better connectivity, performance, and security. Many AWS services, such as Amazon EC2, Amazon S3, and Amazon CloudFront, offer either dual- stack (IPv4 and IPv6) or IPv6-only support, allowing resources to be assigned IPv6 addresses and accessed over the IPv6 protocol and simplifying network configuration and management for those customers adopting IPv6. Other services offer limited or partial dual-stack and IPv6-only support. For more information about services that support IPv6, see AWS services that support IPv6. Note that some IPv6 addresses are reserved by the Internet Engineering Task Force. For more information about reserved IPv6 address ranges, see IANA IPv6 Special-Purpose Address Registry and RFC4291. Note Both public and private IPv6 addressing is available in AWS. AWS considers public IP addresses those advertised on the internet from AWS, while private IP addresses are not and cannot be advertised on the internet from AWS. Contents • Public IPv6 addresses • Private IPv6 addresses Public IPv6 addresses Public IPv6 addresses are IPv6 addresses that can be configured to remain private or configured to be reachable over the Internet. These are some of the ways you can prepare to use public IPv6 addresses for your workloads: IPv6 addresses 18 Amazon Virtual Private Cloud User Guide • Create an IPAM with Amazon VPC IP Address Manager and provision an Amazon-owned public IPv6 address range to an IPAM address pool. For more information, see Create IPv6 pools in the Amazon VPC IPAM User Guide. • If you have an IPAM and you own a public IPv6 address range, bring some or all of the public IPv6 address range to IPAM and provision the public IPv6 address range to an IPAM address pool. For more information, see Tutorial: Bring your IP addresses to IPAM in the Amazon VPC IPAM User Guide. • If you don't have an IPAM but you own a public IPv6 address range, bring some or all of the public IPv6 address range to AWS. For more information, see Bring your own IP addresses (BYOIP) to Amazon EC2 in the Amazon EC2 User Guide. Once you are prepared to use public IPv6 addresses, you can assign public IPv6 addresses to instances (see IPv6 addresses in the Amazon EC2 User Guide), you can allocate a public IPv6 CIDR block to your VPC (see Add or remove a CIDR block from your VPC) and associate the IPv6 CIDR block with your subnets (see Modify the IP addressing attributes of your subnet). Private IPv6 addresses Private IPv6 addresses are IPv6 addresses that are not advertised and cannot be advertised on the Internet from AWS. You can use a private IPv6 address if you want your private networks to support IPv6 and you have no intention of routing traffic from these addresses to the Internet. If you want to connect to the internet from a resource that has a private IPv6 address, you can, but you must route traffic through a resource in another subnet with a public IPv6 address to do so. There are two types of private IPv6 addresses: • IPv6 ULA ranges: IPv6 addresses as defined in RFC4193. These address ranges always start with “fc” or “fd”, which makes them easily identifiable. Valid IPv6 ULA space is anything under fd00::/8 that does not overlap with the Amazon reserved range fd00::/16. • IPv6 GUA ranges: IPv6 addresses as defined in RFC3587. The option to use IPv6 GUA ranges as private IPv6 addresses is disabled by default and must be enabled before you can use it. For more information, see Enable provisioning private IPv6 GUA CIDRs in the Amazon VPC IPAM User Guide. Note the following: Private IPv6 addresses 19 Amazon Virtual Private Cloud User Guide • Private IPv6 addresses are only available through Amazon VPC IP Address Manager (IPAM). IPAM discovers resources with IPv6 ULA and GUA addresses and monitors pools for overlapping IPv6 ULA and GUA address space. • When you use private IPv6 GUA ranges, we require that you use IPv6 GUA ranges owned by you. • Private IPv6 addresses are not and cannot be advertised on the internet by AWS. AWS does not allow direct egress to the public internet from a private IPv6 range even if there is an internet gateway or egress only internet gateway in the VPC. Private IPv6 addresses are automatically dropped at the internet gateway edge ensuring that they are not routed publicly. • AWS reserves |
vpc-ug-011 | vpc-ug.pdf | 11 | ULA and GUA addresses and monitors pools for overlapping IPv6 ULA and GUA address space. • When you use private IPv6 GUA ranges, we require that you use IPv6 GUA ranges owned by you. • Private IPv6 addresses are not and cannot be advertised on the internet by AWS. AWS does not allow direct egress to the public internet from a private IPv6 range even if there is an internet gateway or egress only internet gateway in the VPC. Private IPv6 addresses are automatically dropped at the internet gateway edge ensuring that they are not routed publicly. • AWS reserves the first 4 subnet private IPv6 addresses and the last one. • Valid ranges for private IPv6 ULA are /9 to /60 starting with fd80::/9. • If you have a private IPv6 GUA range allocated to a VPC, you cannot use public IPv6 GUA space that overlaps the private IPv6 GUA space in the same VPC. • Communication between resources with private IPv6 ULA and GUA address ranges is supported (such as across Direct Connect, VPC peering, transit gateway, or VPN connections). • You can use private IPv6 addresses with IPv6-only and dual-stack VPC subnets, elastic load balancers and AWS Global Accelerator endpoints. • There is no charge for private IPv6 addresses. These are some of the ways you can prepare to use private IPv6 addresses for your workloads: • Create an IPAM with Amazon VPC IP Address Manager and provision a private IPv6 ULA range to an IPAM address pool. For more information, see Create IPv6 pools in the Amazon VPC IPAM User Guide. • Create an IPAM with Amazon VPC IP Address Manager and provision a private IPv6 GUA range to an IPAM address pool. The option to use IPv6 GUA ranges as private IPv6 addresses is disabled by default and must be enabled on your IPAM before you can use it. For more information, see Enable provisioning private IPv6 GUA CIDRs in the Amazon VPC IPAM User Guide. Once you are prepared to use private IPv6 addresses, you can allocate a private IPv6 CIDR block from an IPAM pool to your VPC (see Add or remove a CIDR block from your VPC) and associate the IPv6 CIDR block with your subnets (see Modify the IP addressing attributes of your subnet). Private IPv6 addresses 20 Amazon Virtual Private Cloud User Guide Use your own IP addresses You can bring part or all of your own public IPv4 address range or IPv6 address range to your AWS account. You continue to own the address range, but AWS advertises it on the internet by default. After you bring the address range to AWS, it appears in your account as an address pool. You can create an Elastic IP address from your IPv4 address pool, and you can associate an IPv6 CIDR block from your IPv6 address pool with a VPC. For more information, see Bring your own IP addresses (BYOIP) in the Amazon EC2 User Guide. Use Amazon VPC IP Address Manager Amazon VPC IP Address Manager (IPAM) is a VPC feature that makes it easier for you to plan, track, and monitor IP addresses for your AWS workloads. You can use IPAM to allocate IP address CIDRs to VPCs using specific business rules. For more information, see What is IPAM? in the Amazon VPC IPAM User Guide. VPC CIDR blocks The IP addresses for your virtual private cloud (VPC) are represented using Classless Inter-Domain Routing (CIDR) notation. A VPC must have an associated IPv4 CIDR block. You can optionally associate additional IPv4 CIDR blocks and one or more IPv6 CIDR blocks. For more information, see IP addressing for your VPCs and subnets. Contents • IPv4 VPC CIDR blocks • Manage IPv4 CIDR blocks for a VPC • IPv4 CIDR block association restrictions • IPv6 VPC CIDR blocks IPv4 VPC CIDR blocks When you create a VPC, you must specify an IPv4 CIDR block for the VPC. The allowed block size is between a /16 netmask (65,536 IP addresses) and /28 netmask (16 IP addresses). After Use your own IP addresses 21 Amazon Virtual Private Cloud User Guide you've created your VPC, you can associate additional IPv4 CIDR blocks with the VPC. For more information, see Add or remove a CIDR block from your VPC. When you create a VPC, we recommend that you specify a CIDR block from the private IPv4 address ranges as specified in RFC 1918. RFC 1918 range Example CIDR block 10.0.0.0 - 10.255.255.255 (10/8 prefix) 10.0.0.0/16 172.16.0.0 - 172.31.255.255 (172.16/12 prefix) 172.31.0.0/16 192.168.0.0 - 192.168.255.255 (192.168/16 prefix) 192.168.0.0/20 Important Some AWS services use the 172.17.0.0/16 CIDR range. Services can experience IP address conflicts if the IP address range is already in use anywhere in your network. For example, AWS Cloud9 and Amazon SageMaker AI use |
vpc-ug-012 | vpc-ug.pdf | 12 | the VPC. For more information, see Add or remove a CIDR block from your VPC. When you create a VPC, we recommend that you specify a CIDR block from the private IPv4 address ranges as specified in RFC 1918. RFC 1918 range Example CIDR block 10.0.0.0 - 10.255.255.255 (10/8 prefix) 10.0.0.0/16 172.16.0.0 - 172.31.255.255 (172.16/12 prefix) 172.31.0.0/16 192.168.0.0 - 192.168.255.255 (192.168/16 prefix) 192.168.0.0/20 Important Some AWS services use the 172.17.0.0/16 CIDR range. Services can experience IP address conflicts if the IP address range is already in use anywhere in your network. For example, AWS Cloud9 and Amazon SageMaker AI use 172.17.0.0/16. To avoid conflicts, don’t use this range when creating your VPC. For more information, see Can't connect to EC2 environment because VPC's IP addresses are used by Docker in the AWS Cloud9 User Guide. You can create a VPC with a publicly routable CIDR block that falls outside of the private IPv4 address ranges specified in RFC 1918. However, for the purposes of this documentation, we refer to private IP addresses as the IPv4 addresses that are within the CIDR range of your VPC. When you create a VPC for use with an AWS service, check the service documentation to verify if there are specific requirements for its configuration. If you create a VPC using a command line tool or the Amazon EC2 API, the CIDR block is automatically modified to its canonical form. For example, if you specify 100.68.0.18/18 for the CIDR block, we create a CIDR block of 100.68.0.0/18. IPv4 VPC CIDR blocks 22 Amazon Virtual Private Cloud User Guide Manage IPv4 CIDR blocks for a VPC You can associate secondary IPv4 CIDR blocks with your VPC. When you associate a CIDR block with your VPC, a route is automatically added to your VPC route tables to enable routing within the VPC (the destination is the CIDR block and the target is local). In the following example, the VPC has both a primary and a secondary CIDR block. The CIDR blocks for Subnet A and Subnet B are from the primary VPC CIDR block. The CIDR block for Subnet C is from the secondary VPC CIDR block. The following route table shows the local routes for the VPC. Destination 10.0.0.0/16 10.2.0.0/16 Target Local Local Manage IPv4 CIDR blocks for a VPC 23 Amazon Virtual Private Cloud User Guide To add a CIDR block to your VPC, the following rules apply: • The allowed block size is between a /28 netmask and /16 netmask. • The CIDR block must not overlap with any existing CIDR block that's associated with the VPC. • There are restrictions on the ranges of IPv4 addresses you can use. For more information, see IPv4 CIDR block association restrictions. • You cannot increase or decrease the size of an existing CIDR block. • You have a quota on the number of CIDR blocks you can associate with a VPC and the number of routes you can add to a route table. You cannot associate a CIDR block if this results in you exceeding your quotas. For more information, see Amazon VPC quotas. • The CIDR block must not be the same or larger than a destination CIDR range in a route in any of the VPC route tables. For example, in a VPC where the primary CIDR block is 10.2.0.0/16, you have an existing route in a route table with a destination of 10.0.0.0/24 to a virtual private gateway. You want to associate a secondary CIDR block in the 10.0.0.0/16 range. Because of the existing route, you cannot associate a CIDR block of 10.0.0.0/24 or larger. However, you can associate a secondary CIDR block of 10.0.0.0/25 or smaller. • The following rules apply when you add IPv4 CIDR blocks to a VPC that's part of a VPC peering connection: • If the VPC peering connection is active, you can add CIDR blocks to a VPC provided they do not overlap with a CIDR block of the peer VPC. • If the VPC peering connection is pending-acceptance, the owner of the requester VPC cannot add any CIDR block to the VPC, regardless of whether it overlaps with the CIDR block of the accepter VPC. Either the owner of the accepter VPC must accept the peering connection, or the owner of the requester VPC must delete the VPC peering connection request, add the CIDR block, and then request a new VPC peering connection. • If the VPC peering connection is pending-acceptance, the owner of the accepter VPC can add CIDR blocks to the VPC. If a secondary CIDR block overlaps with a CIDR block of the requester VPC, the VPC peering connection request fails and cannot be accepted. • If you're using AWS Direct Connect to connect to multiple VPCs through a Direct Connect gateway, the |
vpc-ug-013 | vpc-ug.pdf | 13 | the owner of the accepter VPC must accept the peering connection, or the owner of the requester VPC must delete the VPC peering connection request, add the CIDR block, and then request a new VPC peering connection. • If the VPC peering connection is pending-acceptance, the owner of the accepter VPC can add CIDR blocks to the VPC. If a secondary CIDR block overlaps with a CIDR block of the requester VPC, the VPC peering connection request fails and cannot be accepted. • If you're using AWS Direct Connect to connect to multiple VPCs through a Direct Connect gateway, the VPCs that are associated with the Direct Connect gateway must not have overlapping CIDR blocks. If you add a CIDR block to one of the VPCs that's associated with the Direct Connect gateway, ensure that the new CIDR block does not overlap with an existing CIDR block of any other associated VPC. For more information, see Direct Connect gateways in the AWS Direct Connect User Guide. Manage IPv4 CIDR blocks for a VPC 24 Amazon Virtual Private Cloud User Guide • When you add or remove a CIDR block, it can go through various states: associating | associated | disassociating | disassociated | failing | failed. The CIDR block is ready for you to use when it's in the associated state. You can disassociate a CIDR block that you've associated with your VPC; however, you cannot disassociate the CIDR block with which you originally created the VPC (the primary CIDR block). To view the primary CIDR for your VPC in the Amazon VPC console, choose Your VPCs, select the checkbox for your VPC, and choose the CIDRs tab. To view the primary CIDR using the AWS CLI, use the describe-vpcs command as follows. The primary CIDR is returned in the top-level CidrBlock element. aws ec2 describe-vpcs --vpc-id vpc-1a2b3c4d --query Vpcs[*].CidrBlock --output text The following is example output. 10.0.0.0/16 IPv4 CIDR block association restrictions The following table provides an overview of permitted and restricted VPC CIDR block associations. The reason for restrictions is that some AWS services make use of cross-VPC and cross-account features that require non-conflicting CIDR blocks on the AWS service side. IP address range 10.0.0.0/8 Restricted associations Permitted associations CIDR blocks from other RFC 1918* ranges (172.16.0.0/12 and 192.168.0.0/16). If any of the CIDR blocks associated with the VPC are from the 10.0.0.0/ 15 range (10.0.0.0 to 10.1.255.255), Any other CIDR block from the 10.0.0.0/8 range between a /16 netmask and /28 netmask that's not restricted. Any publicly routable IPv4 CIDR block (non-RFC 1918) between you cannot add a CIDR block from a /16 netmask and /28 netmask or a the 10.0.0.0/16 range (10.0.0.0 to CIDR block between a /16 netmask 10.0.255.255). and /28 netmask from the 100.64.0. 0/10 range. IPv4 CIDR block association restrictions 25 Amazon Virtual Private Cloud User Guide IP address range 169.254.0.0/16 Restricted associations Permitted associations CIDR blocks from the 198.19.0.0/16 range. CIDR blocks from the "link local" block are reserved as described in RFC 5735 and cannot be assigned to VPCs. 172.16.0.0/12 CIDR blocks from other RFC 1918* ranges (10.0.0.0/8 and 192.168.0 Any other CIDR block from the 172.16.0.0/12 range between a /16 .0/16). CIDR blocks from the 172.31.0.0/16 range. CIDR blocks from the 198.19.0.0/16 range. netmask and /28 netmask that's not restricted. Any publicly routable IPv4 CIDR block (non-RFC 1918) between a /16 netmask and /28 netmask or a CIDR block between a /16 netmask and /28 netmask from the 100.64.0. 0/10 range. 192.168.0.0/16 CIDR blocks from other RFC 1918* ranges (10.0.0.0/8 and 172.16.0. Any other CIDR block from the 192.168.0.0/16 range between 0/12). a /16 netmask and /28 netmask. CIDR blocks from the 198.19.0.0/16 Any publicly routable IPv4 CIDR range. block (non-RFC 1918) between a /16 netmask and /28 netmask or a CIDR block from the 100.64.0.0/10 range between a /16 netmask and /28 netmask. IPv4 CIDR block association restrictions 26 Amazon Virtual Private Cloud User Guide IP address range 198.19.0.0/16 Restricted associations Permitted associations CIDR blocks from the RFC 1918* ranges. Any publicly routable IPv4 CIDR block (non-RFC 1918) between a /16 netmask and /28 netmask or a CIDR block from the 100.64.0.0/10 range between a /16 netmask and /28 netmask. Publicly routable CIDR block (non- CIDR blocks from the RFC 1918* ranges. Any other publicly routable IPv4 CIDR block (non-RFC 1918) between RFC 1918), or a CIDR block from the 100.64.0. 0/10 range CIDR blocks from the 198.19.0.0/16 range. a /16 netmask and /28 netmask or a CIDR block between a /16 netmask and /28 netmask from the 100.64.0. 0/10 range. You can also associate a CIDR in one of the RFC 1918 ranges, but to do this you have to add that CIDR first when you create the VPC and then add the non-RFC 1918 CIDR. * RFC |
vpc-ug-014 | vpc-ug.pdf | 14 | netmask. Publicly routable CIDR block (non- CIDR blocks from the RFC 1918* ranges. Any other publicly routable IPv4 CIDR block (non-RFC 1918) between RFC 1918), or a CIDR block from the 100.64.0. 0/10 range CIDR blocks from the 198.19.0.0/16 range. a /16 netmask and /28 netmask or a CIDR block between a /16 netmask and /28 netmask from the 100.64.0. 0/10 range. You can also associate a CIDR in one of the RFC 1918 ranges, but to do this you have to add that CIDR first when you create the VPC and then add the non-RFC 1918 CIDR. * RFC 1918 ranges are the private IPv4 address ranges specified in RFC 1918. IPv6 VPC CIDR blocks You can associate a single IPv6 CIDR block when you create a new VPC or you can associate up to five IPv6 CIDR blocks from /44 to /60 in increments of /4. You can request an IPv6 CIDR block from Amazon's pool of IPv6 addresses. For more information, see Add or remove a CIDR block from your VPC. If you've associated an IPv6 CIDR block with your VPC, you can associate an IPv6 CIDR block with an existing subnet in your VPC or when you create a new subnet. For more information, see the section called “Subnet sizing for IPv6”. For example, you create a VPC and specify that you want to associate an Amazon-provided IPv6 CIDR block with the VPC. Amazon assigns the following IPv6 CIDR block to your VPC: IPv6 VPC CIDR blocks 27 Amazon Virtual Private Cloud User Guide 2001:db8:1234:1a00::/56. You cannot choose the range of IP addresses yourself. You can create a subnet and associate an IPv6 CIDR block from this range; for example, 2001:db8:1234:1a00::/64. You can disassociate an IPv6 CIDR block from a VPC. After you've disassociated an IPv6 CIDR block from a VPC, you cannot expect to receive the same CIDR if you associate an IPv6 CIDR block with your VPC again later. Subnet CIDR blocks The IP addresses for your subnets are represented using Classless Inter-Domain Routing (CIDR) notation. The CIDR block of a subnet can be the same as the CIDR block for the VPC (to create a single subnet in the VPC), or a subset of the CIDR block for the VPC (to create multiple subnets in the VPC). If you create more than one subnet in a VPC, the CIDR blocks of the subnets cannot overlap. For example, if you create a VPC with CIDR block 10.0.0.0/24, it supports 256 IP addresses. You can break this CIDR block into two subnets, each supporting 128 IP addresses. One subnet uses CIDR block 10.0.0.0/25 (for addresses 10.0.0.0 - 10.0.0.127) and the other uses CIDR block 10.0.0.128/25 (for addresses 10.0.0.128 - 10.0.0.255). There are tools available on the internet to help you calculate and create IPv4 and IPv6 subnet CIDR blocks. You can find tools that suit your needs by searching for terms such as 'subnet calculator' or 'CIDR calculator'. Your network engineering group can also help you determine the IPv4 and IPv6 CIDR blocks to specify for your subnets. Subnet CIDR blocks 28 Amazon Virtual Private Cloud Subnet sizing for IPv4 User Guide The allowed IPv4 CIDR block size for a subnet is between a /28 netmask and /16 netmask. The first four IP addresses and the last IP address in each subnet CIDR block are not available for your use, and they cannot be assigned to a resource, such as an EC2 instance. For example, in a subnet with CIDR block 10.0.0.0/24, the following five IP addresses are reserved: • 10.0.0.0: Network address. • 10.0.0.1: Reserved by AWS for the VPC router. • 10.0.0.2: Reserved by AWS. The IP address of the DNS server is the base of the VPC network range plus two. For VPCs with multiple CIDR blocks, the IP address of the DNS server is located in the primary CIDR. We also reserve the base of each subnet range plus two for all CIDR blocks in the VPC. For more information, see Amazon DNS server. • 10.0.0.3: Reserved by AWS for future use. • 10.0.0.255: Network broadcast address. We do not support broadcast in a VPC, therefore we reserve this address. If you create a subnet using a command line tool or the Amazon EC2 API, the CIDR block is automatically modified to its canonical form. For example, if you specify 100.68.0.18/18 for the CIDR block, we create a CIDR block of 100.68.0.0/18. If you bring an IPv4 address range to AWS using BYOIP, you can use all of the IP addresses in the range, including the first address (the network address) and the last address (the broadcast address). Subnet sizing for IPv6 If you've associated an IPv6 CIDR block with your VPC, you can associate an IPv6 CIDR block with an |
vpc-ug-015 | vpc-ug.pdf | 15 | you create a subnet using a command line tool or the Amazon EC2 API, the CIDR block is automatically modified to its canonical form. For example, if you specify 100.68.0.18/18 for the CIDR block, we create a CIDR block of 100.68.0.0/18. If you bring an IPv4 address range to AWS using BYOIP, you can use all of the IP addresses in the range, including the first address (the network address) and the last address (the broadcast address). Subnet sizing for IPv6 If you've associated an IPv6 CIDR block with your VPC, you can associate an IPv6 CIDR block with an existing subnet in your VPC, or when you create a new subnet. Possible IPv6 netmask lengths are between /44 and /64 in increments of /4. There are tools available on the internet to help you calculate and create IPv6 subnet CIDR blocks. You can find tools that suit your needs by searching for terms such as 'IPv6 subnet calculator' or 'IPv6 CIDR calculator'. Your network engineering group can also help you determine the IPv6 CIDR blocks to specify for your subnets. Subnet sizing for IPv4 29 Amazon Virtual Private Cloud User Guide The first four IPv6 addresses and the last IPv6 address in each subnet CIDR block are not available for your use, and they cannot be assigned to an EC2 instance. For example, in a subnet with CIDR block 2001:db8:1234:1a00/64, the following five IP addresses are reserved: • 2001:db8:1234:1a00:: • 2001:db8:1234:1a00::1: Reserved by AWS for the VPC router. • 2001:db8:1234:1a00::2 • 2001:db8:1234:1a00::3 • 2001:db8:1234:1a00:ffff:ffff:ffff:ffff In addition to the IP address reserved by AWS for the VPC router in the example above, the following IPv6 addresses are reserved for the default VPC router: • A link-local IPv6 address in the FE80::/10 range generated using EUI-64. For more information about link-local addresses, see Link-local address. • The link-local IPv6 address FE80:ec2::1. If you need to communicate with the VPC router over IPv6, you can configure your applications to communicate with whichever address best fits your need. Compare IPv4 and IPv6 The following table summarizes the differences between IPv4 and IPv6 in Amazon EC2 and Amazon VPC. For a list of AWS services that support dual-stack configuration (IPv4 and IPv6) and IPv6-only configurations, see Services that support IPv6. Characteristic IPv4 IPv6 VPC size Up to 5 CIDRs from /16 to /28. This quota is adjustable. Up to 5 CIDRs from /44 to /60 in increments of /4. This quota is adjustable. Subnet size From /16 to /28. From /44 to /64 in increments of /4. Compare IPv4 and IPv6 30 Amazon Virtual Private Cloud User Guide Characteristic IPv4 IPv6 Address selection You can choose the IPv4 CIDR block for your VPC or you can allocate a You can bring your own IPv6 CIDR block to AWS for your VPC, choose CIDR block from Amazon VPC IP an Amazon-provided IPv6 CIDR Address Manager (IPAM). For more block, or you can allocate a CIDR information, see What is IPAM? in block from Amazon VPC IP Address the Amazon VPC IPAM User Guide. Manager (IPAM). For more informati Internet access Requires an internet gateway. on, see What is IPAM? in the Amazon VPC IPAM User Guide. Requires an internet gateway. Supports outbound-only communica tion using an egress-only internet gateway. Elastic IP addresses Supported. Gives an EC2 instance a permanent, static public IPv4 Not supported. EIPs keep the public IPv4 address of an instance static on address. instance restart. IPv6 addresses are static by default. NAT gateways Supported. Instances in private subnets can connect to the internet Supported. You can use a NAT gateway with NAT64 to enable using a public NAT gateway or to instances in IPv6-only subnets resources in other VPCs using a to communicate with IPv4-only private NAT gateway. resources within VPCs, between VPCs, in your on-premises networks, or over the internet. DNS names Instances receive Amazon-provided IPBN or RBN-based DNS names. The DNS name resolves to the DNS records selected for the instance. Instance receive Amazon-provided IPBN or RBN-based DNS names. The DNS name resolves to the DNS records selected for the instance. Compare IPv4 and IPv6 31 Amazon Virtual Private Cloud User Guide Consolidate and manage network CIDR blocks with managed prefix lists A managed prefix list is a set of one or more CIDR blocks. You can use prefix lists to make it easier to configure and maintain your security groups and route tables. You can create a prefix list from the IP addresses that you frequently use, and reference them as a set in security group rules and routes instead of referencing them individually. For example, you can consolidate security group rules with different CIDR blocks but the same port and protocol into a single rule that uses a prefix list. If you scale your network and need to |
vpc-ug-016 | vpc-ug.pdf | 16 | prefix lists A managed prefix list is a set of one or more CIDR blocks. You can use prefix lists to make it easier to configure and maintain your security groups and route tables. You can create a prefix list from the IP addresses that you frequently use, and reference them as a set in security group rules and routes instead of referencing them individually. For example, you can consolidate security group rules with different CIDR blocks but the same port and protocol into a single rule that uses a prefix list. If you scale your network and need to allow traffic from another CIDR block, you can update the relevant prefix list and all security groups that use the prefix list are updated. You can also use managed prefix lists with other AWS accounts using Resource Access Manager (RAM). There are two types of prefix lists: • Customer-managed prefix lists — Sets of IP address ranges that you define and manage. You can share your prefix list with other AWS accounts, enabling those accounts to reference the prefix list in their own resources. • AWS-managed prefix lists — Sets of IP address ranges for AWS services. You cannot create, modify, share, or delete an AWS-managed prefix list. Contents • Prefix lists concepts and rules • Identity and access management for prefix lists • Customer-managed prefix lists • AWS-managed prefix lists • Optimize AWS infrastructure management with prefix lists Prefix lists concepts and rules A prefix list consists of entries. Each entry consists of a CIDR block and, optionally, a description for the CIDR block. Customer-managed prefix lists The following rules apply to customer-managed prefix lists: Managed prefix lists 32 Amazon Virtual Private Cloud User Guide • A prefix list supports a single type of IP addressing only (IPv4 or IPv6). You cannot combine IPv4 and IPv6 CIDR blocks in a single prefix list. • A prefix list applies only to the Region where you created it. • When you create a prefix list, you must specify the maximum number of entries that the prefix list can support. • When you reference a prefix list in a resource, the maximum number of entries for the prefix lists counts against the quota for the number of entries for the resource. For example, if you create a prefix list with 20 maximum entries and you reference that prefix list in a security group rule, this counts as 20 security group rules. • When you reference a prefix list in a route table, route priority rules apply. For more information, see Route priority for prefix lists. • You can modify a prefix list. When you add or remove entries, we create a new version of the prefix list. Resources that reference the prefix always use the current (latest) version. You can restore the entries from a previous version of the prefix list, which also creates a new version. • There are quotas related to prefix lists. For more information, see Customer-managed prefix lists. • Customer-managed prefix lists are available in all commercial AWS Regions (including GovCloud (US) and China Regions). AWS-managed prefix lists The following rules apply to AWS-managed prefix lists: • You cannot create, modify, share, or delete an AWS-managed prefix list. • Different AWS-managed prefix lists have a different weight when you use them. For more information, see AWS-managed prefix list weight. • You cannot view the version number of an AWS-managed prefix list. Identity and access management for prefix lists By default, users do not have permission to create, view, modify, or delete prefix lists. You can create an IAM policy and attach it to a role that allows users to work with prefix lists. To see a list of Amazon VPC actions and the resources and condition keys that you can use in an IAM policy, see Actions, resources, and condition keys for Amazon EC2 in the Service Authorization Reference. Identity and access management for prefix lists 33 Amazon Virtual Private Cloud User Guide The following example policy allows users to view and work with prefix list pl-123456abcde123456 only. Users cannot create or delete prefix lists. { "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": [ "ec2:GetManagedPrefixListAssociations", "ec2:GetManagedPrefixListEntries", "ec2:ModifyManagedPrefixList", "ec2:RestoreManagedPrefixListVersion" ], "Resource": "arn:aws:ec2:region:account:prefix-list/pl-123456abcde123456" }, { "Effect": "Allow", "Action": "ec2:DescribeManagedPrefixLists", "Resource": "*" } ] } For more information about working with IAM in Amazon VPC, see Identity and access management for Amazon VPC. Customer-managed prefix lists Customer-managed prefix lists allow you to define and maintain your own sets of IP address ranges, known as prefixes, within AWS. Instead of hardcoding these IP addresses into your various resources, you can create a centralized prefix list and reference it wherever needed. This not only simplifies the management of your IP addresses but also promotes consistency and reusability across your AWS landscape. One of |
vpc-ug-017 | vpc-ug.pdf | 17 | ], "Resource": "arn:aws:ec2:region:account:prefix-list/pl-123456abcde123456" }, { "Effect": "Allow", "Action": "ec2:DescribeManagedPrefixLists", "Resource": "*" } ] } For more information about working with IAM in Amazon VPC, see Identity and access management for Amazon VPC. Customer-managed prefix lists Customer-managed prefix lists allow you to define and maintain your own sets of IP address ranges, known as prefixes, within AWS. Instead of hardcoding these IP addresses into your various resources, you can create a centralized prefix list and reference it wherever needed. This not only simplifies the management of your IP addresses but also promotes consistency and reusability across your AWS landscape. One of the standout features of customer-managed prefix lists is the ability to share them with other AWS accounts. By granting access to your prefix lists, you can enable other teams or organizations to leverage your defined IP address ranges in their own resources. This collaborative approach fosters a more cohesive and efficient cloud experience, where IP address management is shared and synchronized. Customer-managed prefix lists 34 Amazon Virtual Private Cloud User Guide In the sections that follow, we'll dive deeper into the practical aspects of working with customer- managed prefix lists, including step-by-step guidance on creating, managing, and sharing your IP address ranges. Tasks • Work with customer-managed prefix lists Work with customer-managed prefix lists This section describes how to work with customer-managed prefix lists. Contents • Create a prefix list • View prefix lists • View the entries for a prefix list • View associations (references) for your prefix list • Modify a prefix list • Resize a prefix list • Restore a previous version of a prefix list • Delete a prefix list • Share customer-managed prefix lists Create a prefix list When you create a prefix list, you must specify the maximum number of entries that the prefix list can support. Limitation You can't add a prefix list to a security group rule if the number of rules plus the max entries for the prefix list exceeds the quota for rules per security group for your account. To create a prefix list using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. In the navigation pane, choose Managed Prefix Lists. Customer-managed prefix lists 35 Amazon Virtual Private Cloud 3. Choose Create prefix list. User Guide 4. 5. 6. 7. For Prefix list name, enter a name for the prefix list. For Max entries, enter the maximum number of entries for the prefix list. For Address family, choose whether the prefix list supports IPv4 or IPv6 entries. For Prefix list entries, choose Add new entry, and enter the CIDR block and a description for the entry. Repeat this step for each entry. 8. (Optional) For Tags, add tags to the prefix list to help you identify it later. 9. Choose Create prefix list. To create a prefix list using the AWS CLI Use the create-managed-prefix-list command. View prefix lists You can view your prefix lists, prefix lists that are shared with you, and AWS-managed prefix lists. To view prefix lists using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. In the navigation pane, choose Managed Prefix Lists. The Owner ID column shows the AWS account ID of the prefix list owner. For AWS-managed prefix lists, the Owner ID is AWS. To view prefix lists using the AWS CLI Use the describe-managed-prefix-lists command. View the entries for a prefix list You can view the entries for your prefix lists, prefix lists that are shared with you, and AWS- managed prefix lists. To view the entries for a prefix list using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. In the navigation pane, choose Managed Prefix Lists. Customer-managed prefix lists 36 Amazon Virtual Private Cloud User Guide 3. 4. Select the checkbox for the prefix list. In the lower pane, choose Entries to view the entries for the prefix list. To view the entries for a prefix list using the AWS CLI Use the get-managed-prefix-list-entries command. View associations (references) for your prefix list You can view the IDs and owners of the resources that are associated with your prefix list. Associated resources are resources that reference your prefix list in their entries or rules. Limitation You cannot view associated resources for an AWS-managed prefix list. To view prefix list associations using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. 4. In the navigation pane, choose Managed Prefix Lists. Select the checkbox for the prefix list. In the lower pane, choose Associations to view the resources that are referencing the prefix list. To view prefix list associations using the AWS CLI Use the get-managed-prefix-list-associations command. Modify a prefix list You can modify the name of your prefix list, and you can add or remove entries. To modify the maximum |
vpc-ug-018 | vpc-ug.pdf | 18 | or rules. Limitation You cannot view associated resources for an AWS-managed prefix list. To view prefix list associations using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. 4. In the navigation pane, choose Managed Prefix Lists. Select the checkbox for the prefix list. In the lower pane, choose Associations to view the resources that are referencing the prefix list. To view prefix list associations using the AWS CLI Use the get-managed-prefix-list-associations command. Modify a prefix list You can modify the name of your prefix list, and you can add or remove entries. To modify the maximum number of entries, see Resize a prefix list. Updating the entries of a prefix list creates a new version of the prefix list. Updating the name or maximum number of entries for a prefix list does not create a new version of the prefix list. Considerations • You cannot modify an AWS-managed prefix list. Customer-managed prefix lists 37 Amazon Virtual Private Cloud User Guide • When you increase the maximum number of entries in a prefix list, the increased maximum size is applied to the quota of entries for the resources that reference the prefix list. If any of these resources can't support the increased maximum size, the modify operation fails and the previous maximum size is restored. To modify a prefix list using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. 4. 5. In the navigation pane, choose Managed Prefix Lists. Select the checkbox for prefix list, and choose Actions, Modify prefix list. For Prefix list name, enter a new name for the prefix list. For Prefix list entries, choose Remove to remove an existing entry. To add a new entry, choose Add new entry and enter the CIDR block and a description for the entry. 6. Choose Save prefix list. To modify a prefix list using the AWS CLI Use the modify-managed-prefix-list command. Resize a prefix list You can resize a prefix list and modify the maximum number of entries for the prefix list up to 1000. For more information about customer-managed prefix list quotas, see Customer-managed prefix lists. To resize a prefix list using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. 4. In the navigation pane, choose Managed Prefix Lists. Select the checkbox for the prefix list, and choose Actions, Resize prefix list. For New max entries, enter a value. 5. Choose Resize. To resize a prefix list using the AWS CLI Use the modify-managed-prefix-list command. Customer-managed prefix lists 38 Amazon Virtual Private Cloud User Guide Restore a previous version of a prefix list You can restore the entries from a previous version of your prefix list. This creates a new version of the prefix list. If you decreased the size of the prefix list, you must ensure that the prefix list is large enough to contain the entries from the previous version. To restore a previous version of a prefix list using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. 4. In the navigation pane, choose Managed Prefix Lists. Select the checkbox for the prefix list, and choose Actions, Restore prefix list. For Select prefix list version, choose a previous version. The entries for the selected version are displayed in Prefix list entries. 5. Choose Restore prefix list. To restore a previous version of a prefix list using the AWS CLI Use the restore-managed-prefix-list-version command. Delete a prefix list To delete a prefix list, you must first remove any references to it in your resources (such as in your route tables). If you've shared the prefix list using AWS RAM, any references in consumer-owned resources must first be removed. Limitation You cannot delete an AWS-managed prefix list. To delete a prefix list using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. 4. In the navigation pane, choose Managed Prefix Lists. Select the prefix list, and choose Actions, Delete prefix list. In the confirmation dialog box, enter delete, and choose Delete. To delete a prefix list using the AWS CLI Customer-managed prefix lists 39 Amazon Virtual Private Cloud User Guide Use the delete-managed-prefix-list command. Share customer-managed prefix lists With AWS Resource Access Manager (AWS RAM), the owner of a customer-managed prefix list can share the prefix list with the following: • Specific AWS accounts inside or outside of its organization in AWS Organizations • An organizational unit inside its organization in AWS Organizations • An entire organization in AWS Organizations Consumers with whom a prefix list has been shared can view the prefix list and its entries, and they can reference the prefix list in their AWS resources. For more information about AWS RAM, see the AWS RAM User Guide. For more information quotas, see Service quotas in the AWS |
vpc-ug-019 | vpc-ug.pdf | 19 | Resource Access Manager (AWS RAM), the owner of a customer-managed prefix list can share the prefix list with the following: • Specific AWS accounts inside or outside of its organization in AWS Organizations • An organizational unit inside its organization in AWS Organizations • An entire organization in AWS Organizations Consumers with whom a prefix list has been shared can view the prefix list and its entries, and they can reference the prefix list in their AWS resources. For more information about AWS RAM, see the AWS RAM User Guide. For more information quotas, see Service quotas in the AWS RAM User Guide. Important There are no additional charges for sharing prefix lists. Contents • Shared prefix list permissions • Work with shared prefix lists Shared prefix list permissions Permissions for owners Owners are responsible for managing a shared prefix list and its entries. Owners can view the IDs of the AWS resources that reference the prefix list. However, they cannot add or remove references to a prefix list in AWS resources that are owned by consumers. Owners cannot delete a prefix list if the prefix list is referenced in a resource that's owned by a consumer. Permissions for consumers Customer-managed prefix lists 40 Amazon Virtual Private Cloud User Guide Consumers can view the entries in a shared prefix list, and they can reference a shared prefix list in their AWS resources. However, consumers can't modify, restore, or delete a shared prefix list. Work with shared prefix lists AWS prefix lists provide a convenient way to manage and reference the IP address ranges used by various AWS services. In addition to the AWS-managed prefix lists, you also can create and share your own customer-managed prefix lists with other AWS accounts. Sharing prefix lists can be particularly useful for organizations with complex networking requirements or those that need to coordinate IP address usage across multiple AWS workloads. By sharing a prefix list, you can ensure consistent IP address management and simplify networking configurations for your collaborators. This section describes and how to share prefix lists and how to identify and use prefix lists that have been shared with your account. Contents • Share a prefix list • Unshare a shared prefix list • Identify a shared prefix list • Identify references to a shared prefix list Share a prefix list To share a prefix list, you must add it to a resource share. If you do not have a resource share, you must first create one using the AWS RAM console. If you are part of an organization in AWS Organizations, and sharing within your organization is enabled, consumers in your organization are automatically granted access to the shared prefix list. Otherwise, consumers receive an invitation to join the resource share and are granted access to the shared prefix list after accepting the invitation. You can create a resource share and share a prefix list that you own using the AWS RAM console, or the AWS CLI. Customer-managed prefix lists 41 Amazon Virtual Private Cloud User Guide Important • To share a prefix list, you must own it. You cannot share a prefix list that has been shared with you. You cannot share an AWS-managed prefix list. • To share a prefix list with your organization or an organizational unit in AWS Organizations, you must enable sharing with AWS Organizations. For more information, see Enable sharing with AWS Organizations in the AWS RAM User Guide. To create a resource share and share a prefix list using the AWS RAM console Follow the steps in Create a resource share in the AWS RAM User Guide. For Select resource type, choose Prefix Lists, and then select the check box for your prefix list. To add a prefix list to an existing resource share using the AWS RAM console To add a managed prefix that you own to an existing resource share, follow the steps in Updating a resource share in the AWS RAM User Guide. For Select resource type, choose Prefix Lists, and then select the check box for your prefix list. To share a prefix list that you own using the AWS CLI Use the following commands to create and update a resource share: • create-resource-share • associate-resource-share • update-resource-share Unshare a shared prefix list When you unshare a prefix list, consumers can no longer view the prefix list or its entries in their account, and they cannot reference the prefix list in their resources. If the prefix list is already referenced in the consumer's resources, those references continue to function as normal, and you can continue to view those references. If you update the prefix list to a new version, the references use the latest version. To unshare a shared prefix list that you own, you must remove it from the |
vpc-ug-020 | vpc-ug.pdf | 20 | resource share: • create-resource-share • associate-resource-share • update-resource-share Unshare a shared prefix list When you unshare a prefix list, consumers can no longer view the prefix list or its entries in their account, and they cannot reference the prefix list in their resources. If the prefix list is already referenced in the consumer's resources, those references continue to function as normal, and you can continue to view those references. If you update the prefix list to a new version, the references use the latest version. To unshare a shared prefix list that you own, you must remove it from the resource share using AWS RAM. Customer-managed prefix lists 42 Amazon Virtual Private Cloud User Guide To unshare a shared prefix list that you own using the AWS RAM console See Updating a resource share in the AWS RAM User Guide. To unshare a shared prefix list that you own using the AWS CLI Use the disassociate-resource-share command. Identify a shared prefix list Owners and consumers can identify shared prefix lists using the Amazon VPC console and AWS CLI. To identify a shared prefix list using the Amazon VPC console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. 4. In the navigation pane, choose Managed Prefix Lists. The page displays the prefix lists that you own and the prefix lists that are shared with you. The Owner ID column shows the AWS account ID of the prefix list owner. To view the resource share information for a prefix list, select the prefix list and choose Sharing in the lower pane. To identify a shared prefix list using the AWS CLI Use the describe-managed-prefix-lists command. The command returns the prefix lists that you own and the prefix lists that are shared with you. OwnerId shows the AWS account ID of the prefix list owner. Identify references to a shared prefix list Owners can identify the consumer-owned resources that are referencing a shared prefix list. To identify references to a shared prefix list using the Amazon VPC console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. 4. In the navigation pane, choose Managed Prefix Lists. Select the prefix list and choose Associations in the lower pane. The IDs of the resources that are referencing the prefix list are listed in the Resource ID column. The owners of the resources are listed in the Resource Owner column. To identify references to a shared prefix list using the AWS CLI Customer-managed prefix lists 43 Amazon Virtual Private Cloud User Guide Use the get-managed-prefix-list-associations command. AWS-managed prefix lists AWS-managed prefix lists are sets of IP address ranges for AWS services. These prefix lists are maintained by Amazon Web Services and provide a way to reference the IP addresses used by various AWS offerings. This can be particularly useful when configuring security groups or other network-level controls within a VPC. The prefix lists cover a wide range of AWS services, including S3 and DynamoDB, and many others. By using the managed prefix lists, you can ensure that your network configurations are up-to-date and properly account for the IP addresses used by the AWS services you depend on. This can help simplify networking tasks and reduce the administrative overhead of manually maintaining lists of IP addresses. In addition to the practical benefits, using the managed prefix lists also aligns with AWS security best practices. By relying on the authoritative IP address information provided by AWS, you can minimize the risk of misconfiguration or unexpected connectivity issues. This can be especially important for mission-critical applications or workloads with strict compliance requirements. Contents • Available AWS-managed prefix lists • AWS-managed prefix list weight • Use an AWS-managed prefix list Available AWS-managed prefix lists The following services provide AWS-managed prefix lists. AWS service Prefix list name Weight Amazon CloudFront com.amazonaws.global.cloudfront.origin- facing Amazon DynamoDB com.amazonaws.region.dynamodb Amazon EC2 Instance Connect com.amazonaws.region.ec2-instance-conn ect 55 1 2 AWS-managed prefix lists 44 Amazon Virtual Private Cloud AWS service Prefix list name User Guide Weight com.amazonaws.region.ipv6.ec2-instance- connect AWS Ground Station com.amazonaws.global.groundstation Amazon Route 53 com.amazonaws.region.ipv6.route53-heal thchecks com.amazonaws.region.route53-healthche cks Amazon S3 com.amazonaws.region.s3 Amazon S3 Express One Zone com.amazonaws.region.s3express Amazon VPC Lattice com.amazonaws.region.vpc-lattice com.amazonaws.region.ipv6.vpc-lattice 2 5 25 25 1 6 10 10 To view the AWS-managed prefix lists using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. In the navigation pane, choose Managed Prefix Lists. In the search field, add the Owner ID: AWS filter. To view the AWS-managed prefix lists using the AWS CLI Use the describe-managed-prefix-lists command as follows. aws ec2 describe-managed-prefix-lists --filters Name=owner-id,Values=AWS AWS-managed prefix list weight The weight of an AWS-managed prefix list refers to the number of entries that it takes up in a resource. AWS-managed prefix lists 45 Amazon Virtual Private Cloud User Guide For example, the weight of a Amazon CloudFront managed prefix list |
vpc-ug-021 | vpc-ug.pdf | 21 | AWS-managed prefix lists using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. In the navigation pane, choose Managed Prefix Lists. In the search field, add the Owner ID: AWS filter. To view the AWS-managed prefix lists using the AWS CLI Use the describe-managed-prefix-lists command as follows. aws ec2 describe-managed-prefix-lists --filters Name=owner-id,Values=AWS AWS-managed prefix list weight The weight of an AWS-managed prefix list refers to the number of entries that it takes up in a resource. AWS-managed prefix lists 45 Amazon Virtual Private Cloud User Guide For example, the weight of a Amazon CloudFront managed prefix list is 55. Here's how the this affects your Amazon VPC quotas: • Security groups – The default quota is 60 rules, leaving room for only 5 additional rules in a security group. You can request a quota increase for this quota. • Route tables – The default quota is 50 routes, so you must request a quota increase before you can add the prefix list to a route table. Use an AWS-managed prefix list AWS-managed prefix lists are created and maintained by AWS and can be used by anyone with an AWS account. You cannot create, modify, share, or delete an AWS-managed prefix list. As with customer-managed prefix lists, you can use AWS-managed prefix lists with AWS resources such as security groups and route tables. For more information, see Optimize AWS infrastructure management with prefix lists. Optimize AWS infrastructure management with prefix lists You can reference a prefix list in the following AWS resources. Resources • VPC security groups • Subnet route tables • Transit gateway route tables • AWS Network Firewall rule groups • Amazon Managed Grafana network access control • AWS Outposts rack local gateways VPC security groups You can specify a prefix list as the source for an inbound rule, or as the destination for an outbound rule. For more information, see Security groups. Optimize AWS infrastructure management with prefix lists 46 Amazon Virtual Private Cloud User Guide Important You can't modify an existing rule to use a prefix list. You have to create a new rule to use a prefix list. To reference a prefix list in a security group rule using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. In the navigation pane, choose Security Groups. Select the security group to update. 4. Choose Actions, Edit inbound rules or Actions, Edit outbound rules. 5. Choose Add rule. For Type, select the traffic type. For Source (inbound rules) or Destination (outbound rules), choose Custom. Then, in the next field, under Prefix lists, choose the ID of the prefix list. 6. Choose Save rules. To reference a prefix list in a security group rule using the AWS CLI Use the authorize-security-group-ingress and authorize-security-group-egress commands. For the --ip-permissions parameter, specify the ID of the prefix list using PrefixListIds. Subnet route tables You can specify a prefix list as the destination for route table entry. You cannot reference a prefix list in a gateway route table. For more information about route tables, see Configure route tables. To reference a prefix list in a route table using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. In the navigation pane, choose Route Tables, and select the route table. 3. Choose Actions, Edit routes. 4. 5. 6. To add a route, choose Add route. For Destination enter the ID of a prefix list. For Target, choose a target. Optimize AWS infrastructure management with prefix lists 47 Amazon Virtual Private Cloud 7. Choose Save changes. User Guide To reference a prefix list in a route table using the AWS CLI Use the create-route (AWS CLI) command. Use the --destination-prefix-list-id parameter to specify the ID of a prefix list. Transit gateway route tables You can specify a prefix list as the destination for a route. For more information, see Prefix list references in Amazon VPC Transit Gateways. AWS Network Firewall rule groups An AWS Network Firewall rule group is a reusable set of criteria for inspecting and handling network traffic. If you create Suricata-compatible stateful rule groups in AWS Network Firewall, you can reference a prefix list from the rule group. For more information, see Referencing Amazon VPC prefix lists and Creating a stateful rule group in the AWS Network Firewall Developer Guide. Amazon Managed Grafana network access control You can specify one or more prefix lists as an inbound rule for requests to Amazon Managed Grafana workspaces. For more information about Grafana workspace network access control, including how to reference prefix lists, see Managing network access in the Amazon Managed Grafana User Guide. AWS Outposts rack local gateways Each AWS Outposts rack provides a local gateway that allows you to connect your Outpost resources with your on-premises networks. You can group CIDRs that you frequently use |
vpc-ug-022 | vpc-ug.pdf | 22 | VPC prefix lists and Creating a stateful rule group in the AWS Network Firewall Developer Guide. Amazon Managed Grafana network access control You can specify one or more prefix lists as an inbound rule for requests to Amazon Managed Grafana workspaces. For more information about Grafana workspace network access control, including how to reference prefix lists, see Managing network access in the Amazon Managed Grafana User Guide. AWS Outposts rack local gateways Each AWS Outposts rack provides a local gateway that allows you to connect your Outpost resources with your on-premises networks. You can group CIDRs that you frequently use in a prefix list and reference this list as a route target in your local gateway route table. For more information, see Manage local gateway route table routes in the AWS Outposts User Guide for racks. AWS IP address ranges AWS publishes its current IP address ranges in JSON format. With this information, you can identify traffic from AWS. You can also use this information to allow or deny traffic to or from some AWS services. AWS IP address ranges 48 Amazon Virtual Private Cloud Considerations User Guide • We publish the IP address ranges for services that customers commonly use to perform egress filtering. We don't publish the IP address ranges for all services. • Services use their IP address ranges to communicate with other services or to communicate with a customer network. • The IP address ranges that you bring to AWS through bring your own IP addresses (BYOIP) are not included in the .json file. For more information, see Advertise your address range through AWS in the Amazon EC2 User Guide. Some services publish their address ranges using AWS-managed prefix lists. For more information, see the section called “Available AWS-managed prefix lists”. Contents • Download the JSON file • Egress control • Geolocation feed • Find the IP address ranges for AWS services • Syntax for AWS IP address range JSON • AWS IP address ranges notifications Download the JSON file To view the current address ranges, download ip-ranges.json. To maintain history, save successive versions of the JSON file on your own computer. To determine whether there have been changes since the last time that you saved the file, check the publication time in the current file and compare it to the publication time in the last file that you saved. The following is an example curl command that saves the JSON file to the current directory. curl -O https://ip-ranges.amazonaws.com/ip-ranges.json If you access this file programmatically, it is your responsibility to ensure that the application downloads the file only after successfully verifying the TLS certificate presented by the server. To receive notifications of updates to the JSON file, see AWS IP address ranges notifications. Download 49 Amazon Virtual Private Cloud Egress control User Guide To allow resources you've created with one AWS service to only access other AWS services, you can use the IP address range information in the ip-ranges.json file to perform egress filtering. Ensure that the security group rules allow outbound traffic to the CIDR blocks in the AMAZON list. There are quotas for security groups. Depending on the number of IP address ranges in each Region, you might need multiple security groups per Region. Note Some AWS services are built on EC2 and use EC2 IP address space. If you block traffic to EC2 IP address space, you block traffic to these non-EC2 services as well. Geolocation feed The IP address ranges in ip-ranges.json are by AWS Region. However, a Local Zone is not in the same physical location as its parent Region. The geolocation data published in geo-ip-feed.csv accounts for Local Zones. The data follows RFC 8805. Find the IP address ranges for AWS services The AWS IP address range JSON file provided by AWS can be a valuable resource for finding the IP addresses of various AWS services and leveraging that information to enhance your network security and access control. By parsing the detailed data contained within this JSON file, you can precisely identify the IP address ranges associated with specific AWS services and Regions. For example, you can utilize the IP address ranges to configure robust network security policies, setting up granular firewall rules to allow or deny access to certain AWS resources. This information can also be useful for a variety of AWS Network Firewall tasks. This level of control is crucial for protecting your applications and data, ensuring that only authorized traffic can reach the necessary AWS services. Additionally, having this IP intelligence can help you ensure your applications are properly configured to communicate with the right AWS endpoints, improving overall reliability and performance. Beyond just firewall rules, the ip-ranges.json file can also be leveraged to configure sophisticated egress filtering on your network infrastructure. By understanding the destination IP |
vpc-ug-023 | vpc-ug.pdf | 23 | granular firewall rules to allow or deny access to certain AWS resources. This information can also be useful for a variety of AWS Network Firewall tasks. This level of control is crucial for protecting your applications and data, ensuring that only authorized traffic can reach the necessary AWS services. Additionally, having this IP intelligence can help you ensure your applications are properly configured to communicate with the right AWS endpoints, improving overall reliability and performance. Beyond just firewall rules, the ip-ranges.json file can also be leveraged to configure sophisticated egress filtering on your network infrastructure. By understanding the destination IP address ranges for different AWS services, you can set up routing policies or leverage advanced Egress control 50 Amazon Virtual Private Cloud User Guide network security solutions like to selectively permit or block outbound traffic based on its intended destination. This egress control is essential for mitigating the risk of data leakage and unauthorized access. It's important to note that the ip-ranges.json file is regularly updated, so maintaining an up- to-date local copy is crucial to ensure you have the most accurate and current information. By continuously leveraging the contents of this file, you can efficiently manage network access and security for your AWS-based applications, strengthening your overall cloud security posture. The following examples can help you filter the AWS IP address ranges to just what you are looking for. On Linux, you can download and use the the jq tool to parse a local copy of the JSON file. The AWS Tools for Windows PowerShell includes a cmdlet, Get-AWSPublicIpAddressRange, that you can use to parse this JSON file. For more information, see the following blog: Querying the Public IP Address Ranges for AWS. To get the JSON file, see the section called “Download”. For more information about the syntax of the JSON file, see the section called “Syntax”. Examples • Get the file creation date • Get the IP addresses for a specific Region • Get all IPv4 addresses • Get all IPv4 addresses for a specific service • Get all IPv4 addresses for a specific service in a specific Region • Get all IPv6 addresses • Get all IPv6 addresses for a specific service • Get all IP addresses for a specific border group Get the file creation date The following example gets the creation date of ip-ranges.json. jq $ jq .createDate < ip-ranges.json Find address ranges 51 Amazon Virtual Private Cloud "2024-08-01-17-22-15" PowerShell User Guide PS C:\> Get-AWSPublicIpAddressRange -OutputPublicationDate Thursday, August 1, 2024 9:22:35 PM Get the IP addresses for a specific Region The following example filters the JSON file for the IP addresses for the specified Region. jq $ jq '.prefixes[] | select(.region=="us-east-1")' < ip-ranges.json { "ip_prefix": "23.20.0.0/14", "region": "us-east-1", "network_border_group": "us-east-1", "service": "AMAZON" }, { "ip_prefix": "50.16.0.0/15", "region": "us-east-1", "network_border_group": "us-east-1", "service": "AMAZON" }, { "ip_prefix": "50.19.0.0/16", "region": "us-east-1", "network_border_group": "us-east-1", "service": "AMAZON" }, ... PowerShell PS C:\> Get-AWSPublicIpAddressRange -Region us-east-1 IpPrefix Region NetworkBorderGroup Service Find address ranges 52 Amazon Virtual Private Cloud User Guide -------- ------ ------- ------- 23.20.0.0/14 us-east-1 us-east-1 AMAZON 50.16.0.0/15 us-east-1 us-east-1 AMAZON 50.19.0.0/16 us-east-1 us-east-1 AMAZON ... Get all IPv4 addresses The following example filters the JSON file for the IPv4 addresses. jq $ jq -r '.prefixes | .[].ip_prefix' < ip-ranges.json 23.20.0.0/14 27.0.0.0/22 43.250.192.0/24 ... PowerShell PS C:\> Get-AWSPublicIpAddressRange | where {$_.IpAddressFormat -eq "Ipv4"} | select IpPrefix IpPrefix -------- 23.20.0.0/14 27.0.0.0/22 43.250.192.0/24 ... Get all IPv4 addresses for a specific service The following example filters the JSON file for the IPv4 addresses for the specified service. jq $ jq -r '.prefixes[] | select(.service=="GLOBALACCELERATOR") | .ip_prefix' < ip- ranges.json Find address ranges 53 Amazon Virtual Private Cloud 13.248.117.0/24 15.197.34.0/23 15.197.36.0/22 ... PowerShell User Guide PS C:\> Get-AWSPublicIpAddressRange -ServiceKey GLOBALACCELERATOR | where {$_.IpAddressFormat -eq "Ipv4"} | select IpPrefix IpPrefix -------- 13.248.117.0/24 15.197.34.0/23 15.197.36.0/22 ... Get all IPv4 addresses for a specific service in a specific Region The following example filters the JSON file for the IPv4 addresses for the specified service in the specified Region. jq $ jq -r '.prefixes[] | select(.region=="us-east-1") | select(.service=="GLOBALACCELERATOR") | .ip_prefix' < ip-ranges.json 13.248.124.0/24 99.82.166.0/24 99.82.171.0/24 ... PowerShell PS C:\> Get-AWSPublicIpAddressRange -Region us-east-1 -ServiceKey GLOBALACCELERATOR | where {$_.IpAddressFormat -eq "Ipv4"} | select IpPrefix IpPrefix -------- 13.248.117.0/24 99.82.166.0/24 Find address ranges 54 User Guide Amazon Virtual Private Cloud 99.82.171.0/24 ... Get all IPv6 addresses The following example filters the JSON file for the IPv6 addresses. jq $ jq -r '.ipv6_prefixes | .[].ipv6_prefix' < ip-ranges.json 2a05:d07c:2000::/40 2a05:d000:8000::/40 2406:dafe:2000::/40 ... PowerShell PS C:\> Get-AWSPublicIpAddressRange | where {$_.IpAddressFormat -eq "Ipv6"} | select IpPrefix IpPrefix -------- 2a05:d07c:2000::/40 2a05:d000:8000::/40 2406:dafe:2000::/40 ... Get all IPv6 addresses for a specific service The following example filters the JSON file for the IPv6 addresses for the specified service. jq $ jq -r '.ipv6_prefixes[] | select(.service=="GLOBALACCELERATOR") | .ipv6_prefix' < ip-ranges.json 2600:1f01:4874::/47 2600:1f01:4802::/47 2600:1f01:4860::/47 Find address ranges 55 Amazon |
vpc-ug-024 | vpc-ug.pdf | 24 | Find address ranges 54 User Guide Amazon Virtual Private Cloud 99.82.171.0/24 ... Get all IPv6 addresses The following example filters the JSON file for the IPv6 addresses. jq $ jq -r '.ipv6_prefixes | .[].ipv6_prefix' < ip-ranges.json 2a05:d07c:2000::/40 2a05:d000:8000::/40 2406:dafe:2000::/40 ... PowerShell PS C:\> Get-AWSPublicIpAddressRange | where {$_.IpAddressFormat -eq "Ipv6"} | select IpPrefix IpPrefix -------- 2a05:d07c:2000::/40 2a05:d000:8000::/40 2406:dafe:2000::/40 ... Get all IPv6 addresses for a specific service The following example filters the JSON file for the IPv6 addresses for the specified service. jq $ jq -r '.ipv6_prefixes[] | select(.service=="GLOBALACCELERATOR") | .ipv6_prefix' < ip-ranges.json 2600:1f01:4874::/47 2600:1f01:4802::/47 2600:1f01:4860::/47 Find address ranges 55 Amazon Virtual Private Cloud 2600:9000:a800::/40 ... PowerShell User Guide PS C:\> Get-AWSPublicIpAddressRange -ServiceKey GLOBALACCELERATOR | where {$_.IpAddressFormat -eq "Ipv6"} | select IpPrefix IpPrefix -------- 2600:1f01:4874::/47 2600:1f01:4802::/47 2600:1f01:4860::/47 2600:9000:a800::/40 ... Get all IP addresses for a specific border group The following example filters the JSON file for all IP addresses for the specified border group. jq $ jq -r '.prefixes[] | select(.network_border_group=="us-west-2-lax-1") | .ip_prefix' < ip-ranges.json 70.224.192.0/18 52.95.230.0/24 15.253.0.0/16 ... PowerShell PS C:\> Get-AWSPublicIpAddressRange | where {$_.NetworkBorderGroup -eq "us-west-2- lax-1"} | select IpPrefix IpPrefix -------- 70.224.192.0/18 52.95.230.0/24 15.253.0.0/16 ... Find address ranges 56 Amazon Virtual Private Cloud User Guide Syntax for AWS IP address range JSON AWS publishes its current IP address ranges in JSON format. To get the JSON file, see the section called “Download”. The syntax of the JSON file is as follows. { "syncToken": "0123456789", "createDate": "yyyy-mm-dd-hh-mm-ss", "prefixes": [ { "ip_prefix": "cidr", "region": "region", "network_border_group": "network_border_group", "service": "subset" } ], "ipv6_prefixes": [ { "ipv6_prefix": "cidr", "region": "region", "network_border_group": "network_border_group", "service": "subset" } ] } syncToken The publication time, in Unix epoch time format. Type: String Example: "syncToken": "1416435608" createDate The publication date and time, in UTC YY-MM-DD-hh-mm-ss format. Type: String Example: "createDate": "2014-11-19-23-29-02" prefixes The IP prefixes for the IPv4 address ranges. Syntax 57 Amazon Virtual Private Cloud Type: Array ipv6_prefixes The IP prefixes for the IPv6 address ranges. Type: Array ip_prefix User Guide The public IPv4 address range, in CIDR notation. Note that AWS may advertise a prefix in more specific ranges. For example, prefix 96.127.0.0/17 in the file may be advertised as 96.127.0.0/21, 96.127.8.0/21, 96.127.32.0/19, and 96.127.64.0/18. Type: String Example: "ip_prefix": "198.51.100.2/24" ipv6_prefix The public IPv6 address range, in CIDR notation. Note that AWS may advertise a prefix in more specific ranges. Type: String Example: "ipv6_prefix": "2001:db8:1234::/64" network_border_group The name of the network border group, which is a unique set of Availability Zones or Local Zones from which AWS advertises IP addresses, or GLOBAL. Traffic for GLOBAL services can be attracted to or originate from multiple (up to all) Availability Zones or Local Zones from which AWS advertises IP addresses. Type: String Example: "network_border_group": "us-west-2-lax-1" region The AWS Region or GLOBAL. Traffic for GLOBAL services can be attracted to or originate from multiple (up to all) AWS Regions. Type: String Valid values: af-south-1 | ap-east-1 | ap-northeast-1 | ap-northeast-2 | ap- northeast-3 | ap-south-1 | ap-south-2 | ap-southeast-1 | ap-southeast-2 | ap- Syntax 58 Amazon Virtual Private Cloud User Guide southeast-3 | ap-southeast-4 | ap-southeast-5 | ap-southeast-7 ca-central-1 | ca-west-1 | cn-north-1 | cn-northwest-1 | eu-central-1 | eu-central-2 | eu- north-1 | eu-south-1 | eu-south-2 | eu-west-1 | eu-west-2 | eu-west-3 | il- central-1 | mx-central-1 | me-central-1 | me-south-1 | sa-east-1 | us-east-1 | us- east-2 | us-gov-east-1 | us-gov-west-1 | us-west-1 | us-west-2 | GLOBAL Example: "region": "us-east-1" service The subset of IP address ranges. The addresses listed for API_GATEWAY are egress only. Specify AMAZON to get all IP address ranges (meaning that every subset is also in the AMAZON subset). However, some IP address ranges are only in the AMAZON subset (meaning that they are not also available in another subset). Type: String Valid values: AMAZON | AMAZON_APPFLOW | AMAZON_CONNECT | API_GATEWAY | AURORA_DSQL | CHIME_MEETINGS | CHIME_VOICECONNECTOR | CLOUD9 | CLOUDFRONT | CLOUDFRONT_ORIGIN_FACING | CODEBUILD | DYNAMODB | EBS | EC2 | EC2_INSTANCE_CONNECT | GLOBALACCELERATOR | IVS_REALTIME | KINESIS_VIDEO_STREAMS | MEDIA_PACKAGE_V2 | ROUTE53 | ROUTE53_HEALTHCHECKS | ROUTE53_HEALTHCHECKS_PUBLISHING | ROUTE53_RESOLVER | S3 | WORKSPACES_GATEWAYS Example: "service": "AMAZON" Range overlaps The IP address ranges returned by any service code are also returned by the AMAZON service code. For example, all IP address ranges that are returned by the S3 service code are also returned by the AMAZON service code. When service A uses resources from service B, there are IP address ranges that are returned by the service codes for both service A and service B. However, these IP address ranges are used exclusively by service A, and can't be used by service B. For example, Amazon S3 uses resources from Amazon EC2, so there are IP address ranges that are returned by both the S3 and EC2 service codes. However these IP address ranges are used exclusively by Amazon S3. Therefore, the S3 service |
vpc-ug-025 | vpc-ug.pdf | 25 | returned by the S3 service code are also returned by the AMAZON service code. When service A uses resources from service B, there are IP address ranges that are returned by the service codes for both service A and service B. However, these IP address ranges are used exclusively by service A, and can't be used by service B. For example, Amazon S3 uses resources from Amazon EC2, so there are IP address ranges that are returned by both the S3 and EC2 service codes. However these IP address ranges are used exclusively by Amazon S3. Therefore, the S3 service code returns all IP address ranges that are used exclusively by Amazon S3. To identify the IP address ranges that are used exclusively by Amazon EC2, find the IP address ranges that are returned by the EC2 service code but not the S3 service code. Syntax 59 Amazon Virtual Private Cloud Learn more User Guide This section provides links to additional information for different service codes. • AMAZON_APPFLOW – IP address ranges • AMAZON_CONNECT – Set up your network • CHIME_MEETINGS – Configuring for media and signaling • CLOUDFRONT – Locations and IP address ranges of CloudFront edge servers • DYNAMODB – IP address ranges • EC2 – Public IPV4 addresses • EC2_INSTANCE_CONNECT – EC2 Instance Connect prerequisites • GLOBALACCELERATOR – Location and IP address ranges of Global Accelerator edge servers • ROUTE53 – IP address ranges of Amazon Route 53 servers • ROUTE53_HEALTHCHECKS – IP address ranges of Amazon Route 53 servers • ROUTE53_HEALTHCHECKS_PUBLISHING – IP address ranges of Amazon Route 53 servers • WORKSPACES_GATEWAYS – PCoIP gateway servers Release notes The following table describes updates to the syntax of ip-ranges.json. We also add new Region codes with each Region launch. Description Release date Added the AURORA_DSQL service code. May 21, 2025 Added the IVS_REALTIME service code. June 11, 2024 Added the MEDIA_PACKAGE_V2 service code. May 9, 2023 Added the CLOUDFRONT_ORIGIN_FACING service code. October 12, 2021 Added the ROUTE53_RESOLVER service code. June 24, 2021 Added the EBS service code. May 12, 2021 Syntax 60 User Guide Amazon Virtual Private Cloud Description Added the KINESIS_VIDEO_STREAMS service code. Release date November 19, 2020 Added the CHIME_MEETINGS and CHIME_VOICECONNECTOR service codes. June 19, 2020 Added the AMAZON_APPFLOW service code. June 9, 2020 Add support for the network border group. April 7, 2020 Added the WORKSPACES_GATEWAYS code. service March 30, 2020 Added the ROUTE53_HEALTHCHEC January 30, 2020 K_PUBLISHING service code. Added the API_GATEWAY service code. September 26, 2019 Added the EC2_INSTANCE_CONNECT service code. June 26, 2019 Added the DYNAMODB service code. April 25, 2019 Added the GLOBALACCELERATOR service code. December 20, 2018 Added the AMAZON_CONNECT service code. June 20, 2018 Added the CLOUD9 service code. June 20, 2018 Added the CODEBUILD service code. April 19, 2018 Added the S3 service code. February 28, 2017 Added support for IPv6 address ranges. August 22, 2016 Initial release November 19, 2014 Syntax 61 Amazon Virtual Private Cloud User Guide AWS IP address ranges notifications AWS publishes its current IP address ranges in JSON format. Whenever there is a change to the AWS IP address ranges, we send notifications to subscribers of the Amazon SNS topic named AmazonIpSpaceChanged. For more information about the syntax of the JSON file, see the section called “Syntax”. The payload of the notification contains information in the following format. { "create-time":"yyyy-mm-ddThh:mm:ss+00:00", "synctoken":"0123456789", "md5":"6a45316e8bc9463c9e926d5d37836d33", "url":"https://ip-ranges.amazonaws.com/ip-ranges.json" } create-time The creation date and time. Notifications could be delivered out of order. Therefore, we recommend that you check the timestamps to ensure the correct order. synctoken The publication time, in Unix epoch time format. md5 The cryptographic hash value of the ip-ranges.json file. You can use this value to check whether the downloaded file is corrupted. url The location of the ip-ranges.json file. For more information, see the section called “Download”. You can subscribe to receive notifications as follows. To subscribe to AWS IP address range notifications 1. Open the Amazon SNS console at https://console.aws.amazon.com/sns/v3/home. Subscribe to notifications 62 Amazon Virtual Private Cloud User Guide 2. In the navigation bar, change the Region to US East (N. Virginia), if necessary. You must select this Region because the SNS notifications that you are subscribing to were created in this Region. 3. In the navigation pane, choose Subscriptions. 4. Choose Create subscription. 5. In the Create subscription dialog box, do the following: a. For Topic ARN, copy the following Amazon Resource Name (ARN): arn:aws:sns:us-east-1:806199016981:AmazonIpSpaceChanged b. c. For Protocol, choose the protocol to use (for example, Email). For Endpoint, type the endpoint to receive the notification (for example, your email address). d. Choose Create subscription. 6. You'll be contacted on the endpoint that you specified and asked to confirm your subscription. For example, if you specified an email address, you'll receive an email message with the subject line AWS |
vpc-ug-026 | vpc-ug.pdf | 26 | in this Region. 3. In the navigation pane, choose Subscriptions. 4. Choose Create subscription. 5. In the Create subscription dialog box, do the following: a. For Topic ARN, copy the following Amazon Resource Name (ARN): arn:aws:sns:us-east-1:806199016981:AmazonIpSpaceChanged b. c. For Protocol, choose the protocol to use (for example, Email). For Endpoint, type the endpoint to receive the notification (for example, your email address). d. Choose Create subscription. 6. You'll be contacted on the endpoint that you specified and asked to confirm your subscription. For example, if you specified an email address, you'll receive an email message with the subject line AWS Notification - Subscription Confirmation. Follow the directions to confirm your subscription. Notifications are subject to the availability of the endpoint. Therefore, you might want to check the JSON file periodically to ensure that you've got the latest ranges. For more information about Amazon SNS reliability, see https://aws.amazon.com/sns/faqs/#Reliability. If you no longer want to receive these notifications, use the following procedure to unsubscribe. To unsubscribe from AWS IP address ranges notifications 1. Open the Amazon SNS console at https://console.aws.amazon.com/sns/v3/home. 2. 3. In the navigation pane, choose Subscriptions. Select the check box for the subscription. 4. Choose Actions, Delete subscriptions. 5. When prompted for confirmation, choose Delete. For more information about Amazon SNS, see the Amazon Simple Notification Service Developer Guide. Subscribe to notifications 63 Amazon Virtual Private Cloud User Guide IPv6 support for your VPC If you have an existing VPC that supports IPv4 only, and resources in your subnet that are configured to use IPv4 only, you can add IPv6 support for your VPC and resources. Your VPC can operate in dual-stack mode — your resources can communicate over IPv4, or IPv6, or both. IPv4 and IPv6 communication are independent of each other. You cannot disable IPv4 support for your VPC and subnets; this is the default IP addressing system for Amazon VPC and Amazon EC2. Considerations • There is no migration path from IPv4-only subnets to IPv6-only subnets. • This example assumes that you have an existing VPC with public and private subnets. For information about creating a new VPC for use with IPv6, see the section called “Create a VPC”. • Before you begin using IPv6, ensure that you have read the features of IPv6 addressing for Amazon VPC: Compare IPv4 and IPv6. Contents • Add IPv6 support for your VPC • Example dual-stack VPC configuration Add IPv6 support for your VPC The following table provides an overview of the process to enable IPv6 for your VPC. Contents • Step 1: Associate an IPv6 CIDR block with your VPC and subnets • Step 2: Update your route tables • Step 3: Update your security group rules • Step 4: Assign IPv6 addresses to your instances IPv6 support for your VPC 64 Amazon Virtual Private Cloud User Guide Step Notes Step 1: Associate an IPv6 CIDR block with your VPC and subnets Associate an Amazon-provided or BYOIP IPv6 CIDR block with your VPC and with your Step 2: Update your route tables Step 3: Update your security group rules subnets. Update your route tables to route your IPv6 traffic. For a public subnet, create a route that routes all IPv6 traffic from the subnet to the internet gateway. For a private subnet, create a route that routes all internet-bound IPv6 traffic from the subnet to an egress-only internet gateway. Update your security group rules to include rules for IPv6 addresses. This enables IPv6 traffic to flow to and from your instances. If you've created custom network ACL rules to control the flow of traffic to and from your subnet, you must include rules for IPv6 traffic. Step 4: Assign IPv6 addresses to your instances Assign IPv6 addresses to your instances from the IPv6 address range of your subnet. Step 1: Associate an IPv6 CIDR block with your VPC and subnets You can associate an IPv6 CIDR block with your VPC, and then associate a /64 CIDR block from that range with each subnet. To associate an IPv6 CIDR block with a VPC 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. In the navigation pane, choose Your VPCs. Select your VPC. 4. Choose Actions, Edit CIDRs and then choose Add new IPv6 CIDR. 5. Select one of the following options, and then choose Select CIDR: Add IPv6 support for your VPC 65 Amazon Virtual Private Cloud User Guide • Amazon-provided IPv6 CIDR block – Use an IPv6 CIDR block from Amazon's pool of IPv6 addresses. For Network Border Group, choose the group from which AWS advertises IP addresses. • IPAM-allocated IPv6 CIDR block – Use an IPv6 CIDR block from an IPAM pool. Choose the IPAM pool and the IPv6 CIDR block. • IPv6 CIDR owned by me – Use an IPv6 CIDR block from your IPv6 address |
vpc-ug-027 | vpc-ug.pdf | 27 | choose Add new IPv6 CIDR. 5. Select one of the following options, and then choose Select CIDR: Add IPv6 support for your VPC 65 Amazon Virtual Private Cloud User Guide • Amazon-provided IPv6 CIDR block – Use an IPv6 CIDR block from Amazon's pool of IPv6 addresses. For Network Border Group, choose the group from which AWS advertises IP addresses. • IPAM-allocated IPv6 CIDR block – Use an IPv6 CIDR block from an IPAM pool. Choose the IPAM pool and the IPv6 CIDR block. • IPv6 CIDR owned by me – Use an IPv6 CIDR block from your IPv6 address pool (BYOIP). Choose the IPv6 address pool and the IPv6 CIDR block. 6. Choose Close. To associate an IPv6 CIDR block with a subnet 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. In the navigation pane, choose Subnets. Select a subnet. 4. Choose Actions, Edit IPv6 CIDRs and then choose Add IPv6 CIDR. 5. Edit the CIDR block as needed (for example, replace the 00). 6. Choose Save. 7. Repeat this procedure for any other subnets in your VPC. For more information, see IPv6 VPC CIDR blocks. Step 2: Update your route tables When you associate an IPv6 CIDR block with your VPC, we automatically add a local route to each route table for the VPC to allow IPv6 traffic within the VPC. You must update the route tables for your public subnets to enable instances (such as web servers) to use the internet gateway for IPv6 traffic. You must also update the route tables for your private subnets to enable instances (such as database instances) to use an egress-only internet gateway for IPv6 traffic, because NAT gateways do not support IPv6. To update the route table for a public subnet 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. Add IPv6 support for your VPC 66 Amazon Virtual Private Cloud User Guide 2. In the navigation pane, choose Subnets. Select the public subnet. On the Route table tab, choose the route table ID to open the details page for the route table. 3. Select the route table. On the Routes tab, choose Edit routes. 4. Choose Add route. Choose ::/0 for Destination. Choose the ID of the internet gateway for Target. 5. Choose Save changes. To update the route table for a private subnet 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. In the navigation pane, choose Egress-only internet gateways. Choose Create egress only internet gateway. Choose your VPC from VPC, and then choose Create egress only internet gateway. For more information, see Enable outbound IPv6 traffic using an egress-only internet gateway. 3. In the navigation pane, choose Subnets. Select the private subnet. On the Route table tab, choose the route table ID to open the details page for the route table. 4. Select the route table. On the Routes tab, choose Edit routes. 5. Choose Add route. Choose ::/0 for Destination. Choose the ID of the egress-only internet gateway for Target. 6. Choose Save changes. Note A route table cannot have the same destination (::/0) pointing to both an internet gateway and an egress-only internet gateway simultaneously. If you receive an error message stating "There are existing ipv6 routes with next hop as internet Gateway" when configuring an egress-only internet gateway, you must first remove the existing IPv6 route to the internet gateway before adding the route to the egress-only internet gateway. For more information, see Example routing options. Add IPv6 support for your VPC 67 Amazon Virtual Private Cloud User Guide Step 3: Update your security group rules To enable your instances to send and receive traffic over IPv6, you must update your security group rules to include rules for IPv6 addresses. For example, in the example above, you can update the web server security group (sg-11aa22bb11aa22bb1) to add rules that allow inbound HTTP, HTTPS, and SSH access from IPv6 addresses. You don't need to make any changes to the inbound rules for your database security group; the rule that allows all communication from sg-11aa22bb11aa22bb1 includes IPv6 communication. To update your inbound security group rules 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. 4. In the navigation pane, choose Security groups and select your web server security group. In the Inbound rules tab, choose Edit inbound rules. For each rule that allows IPv4 traffic, choose Add rule and configure the rule to allow the corresponding IPv6 traffic. For example, to add a rule that allows all HTTP traffic over IPv6, choose HTTP for Type and ::/0 for Source. 5. When you are finished adding rules, choose Save rules. Update your outbound security group rules When you associate an IPv6 CIDR block with your VPC, we automatically add an outbound rule to the security groups for the VPC that allows all IPv6 traffic. However, |
vpc-ug-028 | vpc-ug.pdf | 28 | your web server security group. In the Inbound rules tab, choose Edit inbound rules. For each rule that allows IPv4 traffic, choose Add rule and configure the rule to allow the corresponding IPv6 traffic. For example, to add a rule that allows all HTTP traffic over IPv6, choose HTTP for Type and ::/0 for Source. 5. When you are finished adding rules, choose Save rules. Update your outbound security group rules When you associate an IPv6 CIDR block with your VPC, we automatically add an outbound rule to the security groups for the VPC that allows all IPv6 traffic. However, if you modified the original outbound rules for your security group, this rule is not automatically added, and you must add equivalent outbound rules for IPv6 traffic. Update your network ACL rules When you associate an IPv6 CIDR block with a VPC, we automatically add rules to the default network ACL to allow IPv6 traffic. However, if you modified your default network ACL or if you've created a custom network ACL, you must manually add rules for IPv6 traffic. For more information, see Add and delete rules. Step 4: Assign IPv6 addresses to your instances All current generation instance types support IPv6. If your instance type does not support IPv6, you must resize the instance to a supported instance type before you can assign an IPv6 address. The process that you'll use depends on whether the new instance type that you choose is compatible Add IPv6 support for your VPC 68 Amazon Virtual Private Cloud User Guide with the current instance type. For more information, see Change the instance type in the Amazon EC2 User Guide. If you must launch an instance from a new AMI to support IPv6, you can assign an IPv6 address to your instance during launch. After you've verified that your instance type supports IPv6, you can assign an IPv6 address to your instance using the Amazon EC2 console. The IPv6 address is assigned to the primary network interface (for example, eth0) for the instance. For more information, see Assign an IPv6 address to an instance in the Amazon EC2 User Guide. You can connect to an instance using its IPv6 address. For more information, see Connect to your Linux instance using an SSH client in the Amazon EC2 User Guide. If you launched your instance using an AMI for a current version of your operating system, your instance is configured for IPv6. If you can't ping an IPv6 address from your instance, refer to the documentation for your operating system to configure IPv6. Example dual-stack VPC configuration With a dual-stack configuration, you can use both IPv4 and IPv6 addresses for communication between resources in your VPC and resources over the internet. The following diagram represents the architecture of your VPC. Your VPC has a public subnet and a private subnet. The VPC and subnets have both an IPv4 CIDR block and an IPv6 CIDR block. There is an EC2 instance in the private subnet that has both an IPv4 address and an IPv6 address. The instance can send outbound IPv4 traffic to the internet using a NAT gateway and outbound IPv6 traffic to the internet using an egress-only internet gateway. Example dual-stack VPC 69 Amazon Virtual Private Cloud User Guide Route table for public subnet The following is the route table for the public subnet. The first two entries are the local routes. The third entry sends all IPv4 traffic to the internet gateway. Note that the fourth entry is necessary only if you plan to launch EC2 instances with IPv6 addresses in the public subnet. Destination VPC IPv4 CIDR VPC IPv6 CIDR 0.0.0.0/0 ::/0 Route table for the private subnet Target local local internet-gateway-id internet-gateway-id Example dual-stack VPC 70 Amazon Virtual Private Cloud User Guide The following is the route table for the private subnet. The first two entries are the local routes. The third entry sends all IPv4 traffic to the NAT gateway. The last entry sends all IPv6 traffic to the egress-only internet gateway. Destination VPC IPv4 CIDR VPC IPv6 CIDR 0.0.0.0/0 ::/0 Target local local nat-gateway-id egress-only-gateway-id AWS services that support IPv6 Computers and smart devices use IP addresses to communicate with each other over the internet and other networks. As the internet continues to grow, so does the need for IP addresses. The most common format for IP addresses is IPv4. The new format for IP addresses is IPv6, which provides a larger address space than IPv4. AWS services support for IPv6 includes support for dual stack configuration (IPv4 and IPv6) or IPv6 only configurations. For example, a virtual private cloud (VPC) is a logically isolated section of the AWS Cloud where you can launch AWS resources. Within a VPC, you can create subnets that are IPv4 only, dual stack, |
vpc-ug-029 | vpc-ug.pdf | 29 | with each other over the internet and other networks. As the internet continues to grow, so does the need for IP addresses. The most common format for IP addresses is IPv4. The new format for IP addresses is IPv6, which provides a larger address space than IPv4. AWS services support for IPv6 includes support for dual stack configuration (IPv4 and IPv6) or IPv6 only configurations. For example, a virtual private cloud (VPC) is a logically isolated section of the AWS Cloud where you can launch AWS resources. Within a VPC, you can create subnets that are IPv4 only, dual stack, or IPv6 only. AWS services support access through public endpoints. Some AWS services also support access using private endpoints powered by AWS PrivateLink. AWS services can support IPv6 through their private endpoints even if they do not support IPv6 through their public endpoints. Endpoints that support IPv6 can respond to DNS queries with AAAA records. Services that support IPv6 The following table lists the AWS services that provide dual stack support, IPv6 only support, and endpoints that support IPv6. We will update this table as we release additional support for IPv6. For the specifics about how a service supports IPv6, refer to the documentation for the service. IPv6 support on AWS 71 Amazon Virtual Private Cloud User Guide Service name Dual stack support IPv6 only support Public endpoints support IPv6 Private endpoints support IPv6 1 AWS Amplify Amazon API Gateway AWS App Mesh AWS AppConfig AWS Application Discovery Service Application Recovery Controller (ARC) Amazon AppStream 2.0 AWS AppSync2 Amazon Athena Amazon Aurora AWS B2B Data Interchange AWS Backup Yes Yes Yes Yes Yes Yes Yes Partial Yes Yes Yes Yes No No Yes No No No No No No No No No Yes Yes Yes Yes Yes Yes No Partial Yes Yes Yes Yes Yes No Yes Yes No No Yes No Yes Yes Services that support IPv6 72 Amazon Virtual Private Cloud Service name Dual stack support IPv6 only support Public endpoints support IPv6 Private endpoints support IPv6 1 User Guide AWS Batch AWS Billing and Cost Management Data Exports AWS Billing and Cost Management Pricing Calculator AWS Billing Conductor Amazon Braket AWS Certificate Manager Amazon Comprehend AWS Clean Rooms AWS Clean Rooms ML AWS Cloud9 AWS Cloud Control API Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes No No No No Yes No Yes Yes Yes No No Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes Yes Yes Yes Services that support IPv6 73 Amazon Virtual Private Cloud Service name Dual stack support IPv6 only support Public endpoints support IPv6 Private endpoints support IPv6 1 User Guide Amazon CloudFront AWS CloudHSM AWS CloudTrail Amazon CloudWatch Logs AWS Cloud Map AWS Cloud WAN AWS CodeArtifact Amazon CodeGuru Profiler AWS Cost Optimization Hub AWS Elastic Beanstalk Amazon Cognito Amazon Data Firehose Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes No No No No Yes Yes No No No No No No No No Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Services that support IPv6 74 Dual stack support IPv6 only support Public endpoints support IPv6 Private endpoints support IPv6 1 User Guide Amazon Virtual Private Cloud Service name Amazon Data Lifecycle Manager AWS Database Migration Service AWS Deadline Cloud Amazon Detective AWS Direct Connect Amazon EBS direct APIs Amazon EC2 Amazon ECS Amazon EKS Yes Yes Yes Yes Yes Yes Yes Yes No No No Yes Yes No Yes No Elastic Load Balancing Partial Partial Partial Partial Amazon ElastiCache AWS End User Messaging Social Yes Yes Yes No Yes No Yes Yes No Yes Yes Yes Yes No No Yes Yes No Yes Yes No Yes Yes No No No Services that support IPv6 75 Amazon Virtual Private Cloud Service name Dual stack support IPv6 only support Public endpoints support IPv6 Private endpoints support IPv6 1 User Guide AWS Entity Resolution AWS Fargate Amazon FSx Amazon GameLift Streams AWS Global Accelerator AWS Glue Amazon Managed Grafana 3 AWS Ground Station 4 AWS Identity and Access Management (IAM) AWS IAM Access Analyzer Amazon Inspector Yes Yes No Yes Yes Yes Yes Yes Yes Yes Yes No No No No No No No No Yes No Yes Yes No Yes Yes No No Yes Yes Yes Yes Yes Yes No Yes No Yes Yes Yes Yes Yes Yes Services that support IPv6 76 Amazon Virtual Private Cloud Service name Dual stack support IPv6 only support Public endpoints support IPv6 Private endpoints support IPv6 1 User Guide AWS IoT AWS IoT FleetWise AWS IoT Wireless Amazon Kinesis Data Streams AWS Lake Formation AWS Lambda Amazon Lightsail Amazon Macie AWS Mainframe Modernization AWS Network |
vpc-ug-030 | vpc-ug.pdf | 30 | Analyzer Amazon Inspector Yes Yes No Yes Yes Yes Yes Yes Yes Yes Yes No No No No No No No No Yes No Yes Yes No Yes Yes No No Yes Yes Yes Yes Yes Yes No Yes No Yes Yes Yes Yes Yes Yes Services that support IPv6 76 Amazon Virtual Private Cloud Service name Dual stack support IPv6 only support Public endpoints support IPv6 Private endpoints support IPv6 1 User Guide AWS IoT AWS IoT FleetWise AWS IoT Wireless Amazon Kinesis Data Streams AWS Lake Formation AWS Lambda Amazon Lightsail Amazon Macie AWS Mainframe Modernization AWS Network Firewall AWS Network Manager Amazon OpenSearch Service Yes Yes Yes Yes No Yes Yes Yes Yes Yes Yes Yes No No No No No No Yes No No Yes No No Yes Yes Yes Yes No Yes Yes Yes Yes No Yes Yes No Yes Yes No Yes Yes Yes Yes Yes No Yes No Services that support IPv6 77 Amazon Virtual Private Cloud Service name AWS Organizations Amazon Personalize Amazon Pinpoint Amazon Polly AWS Private CA Connector for SCEP AWS PrivateLink Amazon Managed Service for Prometheus Amazon RDS Recycle Bin AWS re:Post Private AWS Resource Access Manager AWS Resource Explorer Dual stack support IPv6 only support Public endpoints support IPv6 Private endpoints support IPv6 1 User Guide Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes No No No No Yes Yes No No No No No No Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes No Yes Yes Yes No Yes Yes Yes Services that support IPv6 78 Amazon Virtual Private Cloud Service name Dual stack support IPv6 only support Public endpoints support IPv6 Private endpoints support IPv6 1 User Guide AWS Resource Groups AWS Resource Groups Tagging API Amazon Route 53 Amazon S3 AWS Secrets Manager Amazon Security Lake AWS Shield Amazon Simple Email Service Amazon Simple Notification Service Amazon Simple Queue Service Amazon Simple Workflow Service AWS Site-to-Site VPN Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes No No No Yes No No No No No Yes Yes No Yes Yes Yes No Yes Yes Yes Yes Yes Yes Yes No No Yes Yes No No Yes No Services that support IPv6 79 Amazon Virtual Private Cloud Service name AWS Step Functions Amazon Transcribe AWS Transit Gateway Amazon Translate Amazon VPC AWS WAF Amazon WorkSpaces AWS X-Ray EC2 Image Builder Dual stack support IPv6 only support Public endpoints support IPv6 Private endpoints support IPv6 1 User Guide Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes No Yes Yes Yes No No Yes Yes Yes Yes Yes Yes No No Yes Yes Yes Yes No Yes No No Yes Yes 1 An empty cell indicates that the service does not integrate with AWS PrivateLink. 2 This entry represents IPv6 support for AWS AppSync GraphlQL and Event API configuration operations, through the AWS AppSync SDK API. IPv6 is not supported for client connections to customer managed AWS AppSync GraphQL and Event APIs. Services that support IPv6 80 Amazon Virtual Private Cloud User Guide 3 This entry represents IPv6 support for Grafana workspace management operations, such as updating workspaces and workspace permissions. There is no IPv6 support for general Grafana workspace operations, such as creating and editing dashboards or querying data sources. 4 This entry represents IPv6 support for AWS Ground Station control plane operations, such as calling the AWS Ground Station API. IPv6 is not supported by the AWS Ground Station data plane, so make sure the resources you are delivering data to (such as Amazon EC2 instances) are accessible over IPv4. Additional IPv6 support Compute • Amazon EC2 supports launching instances based on the Nitro System into IPv6-only subnets. • Amazon EC2 provides IPv6 endpoints for Instance Metadata Service (IMDS) and Amazon Time Sync Service. Networking and Content Delivery • Amazon VPC supports creating IPv6-only subnets. • Amazon VPC helps IPv6 AWS resources communicate with IPv4 resources by supporting DNS64 on your subnets and NAT64 on your NAT gateways. Security, Identity, and Compliance • Amazon Detective supports IPv6 addresses in its network-related findings and entity profiles. • AWS Identity and Access Management (IAM) supports IPv6 addresses in IAM identity-based policies. • Amazon Macie supports IPv6 addresses in personally identifiable information (PII). • Amazon Security Lake supports IPv6 addresses across all operations on log sources and subscribers. Management and Governance • AWS CloudTrail records include source IPv6 information. • AWS CLI v2 supports download over IPv6 connections for IPv6-only clients. Additional IPv6 support 81 Amazon Virtual Private Cloud Learn more • IPv6 on AWS • Dual Stack and IPv6-only Amazon VPC Reference Architectures (PDF) User Guide Learn more 82 Amazon Virtual Private Cloud User Guide Configure a virtual private |
vpc-ug-031 | vpc-ug.pdf | 31 | Identity and Access Management (IAM) supports IPv6 addresses in IAM identity-based policies. • Amazon Macie supports IPv6 addresses in personally identifiable information (PII). • Amazon Security Lake supports IPv6 addresses across all operations on log sources and subscribers. Management and Governance • AWS CloudTrail records include source IPv6 information. • AWS CLI v2 supports download over IPv6 connections for IPv6-only clients. Additional IPv6 support 81 Amazon Virtual Private Cloud Learn more • IPv6 on AWS • Dual Stack and IPv6-only Amazon VPC Reference Architectures (PDF) User Guide Learn more 82 Amazon Virtual Private Cloud User Guide Configure a virtual private cloud Amazon Virtual Private Cloud (VPC) is a fundamental building block, allowing you to provision a logically isolated virtual network within the AWS cloud. By creating your own VPC, you gain full control over the networking environment, including the ability to define IP address ranges, subnets, routing tables, and connectivity options. Your AWS account contains a default VPC for each AWS Region. This default VPC comes pre- configured with settings that make it a convenient option for quickly launching resources. However, the default VPC may not always align with your long-term networking needs. This is where creating additional VPCs can be advantageous. Creating additional VPCs offers several advantages over relying on the default VPC that comes provisioned with every new AWS account. With a self-managed VPC, you can architect the network topology to align precisely with your specific requirements, whether that's implementing a multi- tier application, connecting to on-premises resources, or segregating workloads by department or business unit. In addition, creating multiple VPCs can enable greater security and isolation between your different applications or business units. Each VPC acts as a separate, virtual network, allowing you to apply distinct security policies, access controls, and routing configurations tailored to each environment. Ultimately, the decision to use the default VPC or create one (or more) custom VPCs should be based on your specific application requirements, security needs, and long-term scalability goals. Investing the time to thoughtfully design your VPC infrastructure can pay dividends in the form of a robust, secure, and adaptable cloud networking foundation. Contents • VPC basics • VPC configuration options • Default VPCs • Create a VPC • Visualize the resources in your VPC • Add or remove a CIDR block from your VPC • DHCP option sets in Amazon VPC • DNS attributes for your VPC 83 Amazon Virtual Private Cloud User Guide • Network Address Usage for your VPC • Share your VPC subnets with other accounts • Extend a VPC to a Local Zone, Wavelength Zone, or Outpost • Delete your VPC • Generate infrastructure-as-code from your VPC console actions with Console-to-Code VPC basics A VPC spans all of the Availability Zones in a Region. After you create a VPC, you can add one or more subnets in each Availability Zone. For more information, see Subnets. Contents • VPC IP address range • VPC diagram • VPC resources VPC IP address range When you create a VPC, you specify its IP addresses as follows: • IPv4 only – The VPC has an IPv4 CIDR block but does not have an IPv6 CIDR block. • Dual stack – The VPC has both an IPv4 CIDR block and an IPv6 CIDR block. For more information, see IP addressing for your VPCs and subnets. VPC diagram The following diagram shows a VPC with no additional VPC resources. For example VPC configurations, see Examples. VPC basics 84 Amazon Virtual Private Cloud User Guide VPC resources Each VPC automatically comes with the following resources: • Default DHCP option set • Default network ACL • Default security group • Main route table You can create the following resources for your VPC: • Network ACLs • Custom route tables • Security groups • Internet gateway • NAT gateways VPC resources 85 Amazon Virtual Private Cloud User Guide VPC configuration options You can specify the following configuration options when you create a VPC. Availability Zones Discrete data centers with redundant power, networking, and connectivity in an AWS Region. You can use multiple AZs to operate production applications and databases that are more highly available, fault tolerant, and scalable than would be possible from a single data center. If you partition your applications running in subnets across AZs, you are better isolated and protected from issues such as power outages, lightning strikes, tornadoes, and earthquakes. CIDR blocks You must specify IP address ranges for your VPC and subnets. For more information, see IP addressing for your VPCs and subnets. DNS options If you need public IPv4 DNS hostnames for the EC2 instances launched into your subnets, you must enable both of the DNS options. For more information, see DNS attributes for your VPC. • Enable DNS hostnames: EC2 instances launched in the VPC receive public |
vpc-ug-032 | vpc-ug.pdf | 32 | single data center. If you partition your applications running in subnets across AZs, you are better isolated and protected from issues such as power outages, lightning strikes, tornadoes, and earthquakes. CIDR blocks You must specify IP address ranges for your VPC and subnets. For more information, see IP addressing for your VPCs and subnets. DNS options If you need public IPv4 DNS hostnames for the EC2 instances launched into your subnets, you must enable both of the DNS options. For more information, see DNS attributes for your VPC. • Enable DNS hostnames: EC2 instances launched in the VPC receive public DNS hostnames that correspond to their public IPv4 addresses. • Enable DNS resolution: DNS resolution for private DNS hostnames is provided for the VPC by the Amazon DNS server, called the Route 53 Resolver. Internet gateway Connects your VPC to the internet. The instances in a public subnet can access the internet because the subnet route table contains a route that sends traffic bound for the internet to the internet gateway. If a server doesn't need to be directly reachable from the internet, you should not deploy it into a public subnet. For more information, see Internet gateways. Name The names that you specify for the VPC and the other VPC resources are used to create Name tags. If you use the name tag auto-generation feature in the console, the tag values have the format name-resource. VPC configuration options 86 Amazon Virtual Private Cloud NAT gateways User Guide Enables instances in a private subnet to send outbound traffic to the internet, but prevents resources on the internet from connecting to the instances. In production, we recommend that you deploy a NAT gateway in each active AZ. For more information, see NAT gateways. Route tables Contains a set of rules, called routes, that determine where network traffic from your subnet or gateway is directed. For more information, see Route tables. Subnets A range of IP addresses in your VPC. You can launch AWS resources, such as EC2 instances, into your subnets. Each subnet resides entirely within one Availability Zone. By launching instances in at least two Availability Zones, you can protect your applications from the failure of a single Availability Zone. A public subnet has a direct route to an internet gateway. Resources in a public subnet can access the public internet. A private subnet does not have a direct route to an internet gateway. Resources in a private subnet require another component, such as a NAT device, to access the public internet. For more information, see Subnets. Tenancy This option defines if EC2 instances that you launch into the VPC will run on hardware that's shared with other AWS accounts or on hardware that's dedicated for your use only. If you choose the tenancy of the VPC to be Default, EC2 instances launched into this VPC will use the tenancy attribute specified when you launch the instance -- For more information, see Launch an instance using defined parameters in the Amazon EC2 User Guide. If you choose the tenancy of the VPC to be Dedicated, the instances will always run as Dedicated Instances on hardware that's dedicated for your use. If you're using AWS Outposts, your Outpost requires private connectivity; you must use Default tenancy. Default VPCs When you start using Amazon VPC, you have a default VPC in each AWS Region. A default VPC comes with a public subnet in each Availability Zone, an internet gateway, and settings to enable Default VPCs 87 Amazon Virtual Private Cloud User Guide DNS resolution. Therefore, you can immediately start launching Amazon EC2 instances into a default VPC. You can also use services such as Elastic Load Balancing, Amazon RDS, and Amazon EMR in your default VPC. A default VPC is suitable for getting started quickly and for launching public instances such as a blog or simple website. You can modify the components of your default VPC as needed. You can add subnets to your default VPC. For more information, see the section called “Create a subnet”. Contents • Default VPC components • Default subnets • Work with your default VPC and default subnets Default VPC components When we create a default VPC, we do the following to set it up for you: • Create a VPC with a size /16 IPv4 CIDR block (172.31.0.0/16). This provides up to 65,536 private IPv4 addresses. • Create a size /20 default subnet in each Availability Zone. This provides up to 4,096 addresses per subnet, a few of which are reserved for our use. • Create an internet gateway and connect it to your default VPC. • Add a route to the main route table that points all traffic (0.0.0.0/0) to the internet gateway. • Create a default security group and associate it with your default |
vpc-ug-033 | vpc-ug.pdf | 33 | we do the following to set it up for you: • Create a VPC with a size /16 IPv4 CIDR block (172.31.0.0/16). This provides up to 65,536 private IPv4 addresses. • Create a size /20 default subnet in each Availability Zone. This provides up to 4,096 addresses per subnet, a few of which are reserved for our use. • Create an internet gateway and connect it to your default VPC. • Add a route to the main route table that points all traffic (0.0.0.0/0) to the internet gateway. • Create a default security group and associate it with your default VPC. • Create a default network access control list (ACL) and associate it with your default VPC. • Associate the default DHCP options set for your AWS account with your default VPC. Note • Amazon creates the above resources on your behalf. IAM policies do not apply to these actions because you do not perform these actions. For example, if you have an IAM policy that denies the ability to call CreateInternetGateway, and then you call CreateDefaultVpc, the internet gateway in the default VPC is still created. To prevent Default VPC components 88 Amazon Virtual Private Cloud User Guide Amazon from creating an internet gateway, you would have to deny CreateDefaultVpc and CreateInternetGateway. • To block all traffic to and from the internet gateways in your account, see Block public access to VPCs and subnets. The following figure illustrates the key components that we set up for a default VPC. The following table shows the routes in the main route table for the default VPC. Destination 172.31.0.0/16 Default VPC components Target local 89 Amazon Virtual Private Cloud User Guide Destination 0.0.0.0/0 Target internet_gateway_id You can use a default VPC as you would use any other VPC: • Add additional nondefault subnets. • Modify the main route table. • Add additional route tables. • Associate additional security groups. • Update the rules of the default security group. • Add AWS Site-to-Site VPN connections. • Add more IPv4 CIDR blocks. • Access VPCs in a remote Region by using a Direct Connect gateway. For information about Direct Connect gateway options, see Direct Connect gateways in the AWS Direct Connect User Guide. You can use a default subnet as you would use any other subnet; add custom route tables and set network ACLs. You can also specify a specific default subnet when you launch an EC2 instance. You can optionally associate an IPv6 CIDR block with your default VPC. Default subnets By default, a default subnet is a public subnet, because the main route table sends the subnet's traffic that is destined for the internet to the internet gateway. You can make a default subnet into a private subnet by removing the route from the destination 0.0.0.0/0 to the internet gateway. However, if you do this, no EC2 instance running in that subnet can access the internet. Instances that you launch into a default subnet receive both a public IPv4 address and a private IPv4 address, and both public and private DNS hostnames. Instances that you launch into a nondefault subnet in a default VPC don't receive a public IPv4 address or a DNS hostname. You can change your subnet's default public IP addressing behavior. For more information, see Modify the IP addressing attributes of your subnet. From time to time, AWS may add a new Availability Zone to a Region. In most cases, we automatically create a new default subnet in this Availability Zone for your default VPC within Default subnets 90 Amazon Virtual Private Cloud User Guide a few days. However, if you made any modifications to your default VPC, we do not add a new default subnet. If you want a default subnet for the new Availability Zone, you can create one yourself. For more information, see Create a default subnet. Work with your default VPC and default subnets This section describes how to work with default VPCs and default subnets. Contents • View your default VPC and default subnets • Create a default VPC • Create a default subnet • Delete your default subnets and default VPC View your default VPC and default subnets You can view your default VPC and subnets using the Amazon VPC console or the command line. To view your default VPC and subnets using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. 4. 5. 6. In the navigation pane, choose Your VPCs. In the Default VPC column, look for a value of Yes. Take note of the ID of the default VPC. In the navigation pane, choose Subnets. In the search bar, type the ID of the default VPC. The returned subnets are subnets in your default VPC. To verify which subnets are default subnets, look for a value of |
vpc-ug-034 | vpc-ug.pdf | 34 | VPC and subnets using the Amazon VPC console or the command line. To view your default VPC and subnets using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. 4. 5. 6. In the navigation pane, choose Your VPCs. In the Default VPC column, look for a value of Yes. Take note of the ID of the default VPC. In the navigation pane, choose Subnets. In the search bar, type the ID of the default VPC. The returned subnets are subnets in your default VPC. To verify which subnets are default subnets, look for a value of Yes in the Default Subnet column. To describe your default VPC using the command line • Use the describe-vpcs (AWS CLI) • Use the Get-EC2Vpc (AWS Tools for Windows PowerShell) Use the commands with the isDefault filter and set the filter value to true. Work with your default VPC and default subnets 91 Amazon Virtual Private Cloud User Guide To describe your default subnets using the command line • Use the describe-subnets (AWS CLI) • Use the Get-EC2Subnet (AWS Tools for Windows PowerShell) Use the commands with the vpc-id filter and set the filter value to the ID of the default VPC. In the output, the DefaultForAz field is set to true for default subnets. Create a default VPC If you delete your default VPC, you can create a new one. You cannot restore a previous default VPC that you deleted, and you cannot mark an existing nondefault VPC as a default VPC. When you create a default VPC, it is created with the standard components of a default VPC, including a default subnet in each Availability Zone. You cannot specify your own components. The subnet CIDR blocks of your new default VPC may not map to the same Availability Zones as your previous default VPC. For example, if the subnet with CIDR block 172.31.0.0/20 was created in us-east-2a in your previous default VPC, it may be created in us-east-2b in your new default VPC. If you already have a default VPC in the Region, you cannot create another one. To create a default VPC using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. In the navigation pane, choose Your VPCs. 3. Choose Actions, Create Default VPC. 4. Choose Create. Close the confirmation screen. To create a default VPC using the command line You can use the create-default-vpc AWS CLI command. This command does not have any input parameters. aws ec2 create-default-vpc The following is example output. Work with your default VPC and default subnets 92 User Guide Amazon Virtual Private Cloud { "Vpc": { "VpcId": "vpc-3f139646", "InstanceTenancy": "default", "Tags": [], "Ipv6CidrBlockAssociationSet": [], "State": "pending", "DhcpOptionsId": "dopt-61079b07", "CidrBlock": "172.31.0.0/16", "IsDefault": true } } Alternatively, you can use the New-EC2DefaultVpc Tools for Windows PowerShell command or the CreateDefaultVpc Amazon EC2 API action. Create a default subnet Note You cannot create a default subnet using the AWS Management Console. You can create a default subnet in an Availability Zone that does not have one. For example, you might want to create a default subnet if you have deleted a default subnet, or if AWS has added a new Availability Zone and did not automatically create a default subnet for that zone in your default VPC. When you create a default subnet, it is created with a size /20 IPv4 CIDR block in the next available contiguous space in your default VPC. The following rules apply: • You cannot specify the CIDR block yourself. • You cannot restore a previous default subnet that you deleted. • You can have only one default subnet per Availability Zone. • You cannot create a default subnet in a nondefault VPC. If there is not enough address space in your default VPC to create a size /20 CIDR block, the request fails. If you need more address space, you can add an IPv4 CIDR block to your VPC. Work with your default VPC and default subnets 93 Amazon Virtual Private Cloud User Guide If you've associated an IPv6 CIDR block with your default VPC, the new default subnet does not automatically receive an IPv6 CIDR block. Instead, you can associate an IPv6 CIDR block with the default subnet after you create it. For more information, see Add or remove an IPv6 CIDR block from your subnet. To create a default subnet using the AWS CLI Use the create-default-subnet AWS CLI command and specify the Availability Zone in which to create the subnet. aws ec2 create-default-subnet --availability-zone us-east-2a The following is example output. { "Subnet": { "AvailabilityZone": "us-east-2a", "Tags": [], "AvailableIpAddressCount": 4091, "DefaultForAz": true, "Ipv6CidrBlockAssociationSet": [], "VpcId": "vpc-1a2b3c4d", "State": "available", "MapPublicIpOnLaunch": true, "SubnetId": "subnet-1122aabb", "CidrBlock": "172.31.32.0/20", "AssignIpv6AddressOnCreation": false } } For more information about setting up the AWS CLI, see the AWS Command Line Interface |
vpc-ug-035 | vpc-ug.pdf | 35 | with the default subnet after you create it. For more information, see Add or remove an IPv6 CIDR block from your subnet. To create a default subnet using the AWS CLI Use the create-default-subnet AWS CLI command and specify the Availability Zone in which to create the subnet. aws ec2 create-default-subnet --availability-zone us-east-2a The following is example output. { "Subnet": { "AvailabilityZone": "us-east-2a", "Tags": [], "AvailableIpAddressCount": 4091, "DefaultForAz": true, "Ipv6CidrBlockAssociationSet": [], "VpcId": "vpc-1a2b3c4d", "State": "available", "MapPublicIpOnLaunch": true, "SubnetId": "subnet-1122aabb", "CidrBlock": "172.31.32.0/20", "AssignIpv6AddressOnCreation": false } } For more information about setting up the AWS CLI, see the AWS Command Line Interface User Guide. Alternatively, you can use the New-EC2DefaultSubnet Tools for Windows PowerShell command or the CreateDefaultSubnet Amazon EC2 API action. Delete your default subnets and default VPC You can delete a default subnet or default VPC just as you can delete any other subnet or VPC. However, if you delete your default subnets or default VPC, you must explicitly specify a subnet in one of your VPCs when you launch instances. If you do not have another VPC, you must create a VPC with a subnet in at least one Availability Zone. For more information, see Create a VPC. Work with your default VPC and default subnets 94 Amazon Virtual Private Cloud User Guide If you delete your default VPC, you can create a new one. For more information, see Create a default VPC. If you delete a default subnet, you can create a new one. For more information, see Create a default subnet. To ensure that your new default subnet behaves as expected, modify the subnet attribute to assign public IP addresses to instances that are launched in that subnet. For more information, see Modify the IP addressing attributes of your subnet. You can only have one default subnet per Availability Zone. You cannot create a default subnet in a nondefault VPC. Create a VPC Use the following procedures to create a virtual private cloud (VPC). A VPC must have additional resources, such as subnets, route tables, and gateways, before you can create AWS resources in the VPC. Contents • Create a VPC plus other VPC resources • Create a VPC only • Create a VPC using the AWS CLI For information about modifying a VPC, see the section called “Add or remove CIDR block”. Create a VPC plus other VPC resources Use the following procedure to create a VPC plus the additional VPC resources that you need to run your application, such as subnets, route tables, internet gateways, and NAT gateways. For example VPC configurations, see Examples. To create a VPC, subnets, and other VPC resources using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. On the VPC dashboard, choose Create VPC. 3. For Resources to create, choose VPC and more. 4. Keep Name tag auto-generation selected to create Name tags for the VPC resources or clear it to provide your own Name tags for the VPC resources. 5. For IPv4 CIDR block, enter an IPv4 address range for the VPC. A VPC must have an IPv4 address range. Create a VPC 95 Amazon Virtual Private Cloud User Guide 6. (Optional) To support IPv6 traffic, choose IPv6 CIDR block, Amazon-provided IPv6 CIDR block. 7. Choose a Tenancy option. This option defines if EC2 instances that you launch into the VPC will run on hardware that's shared with other AWS accounts or on hardware that's dedicated for your use only. If you choose the tenancy of the VPC to be Default, EC2 instances launched into this VPC will use the tenancy attribute specified when you launch the instance. For more information, see Launch an instance using defined parameters in the Amazon EC2 User Guide. If you choose the tenancy of the VPC to be Dedicated, the instances will always run as Dedicated Instances on hardware that's dedicated for your use. If you're using AWS Outposts, your Outpost requires private connectivity; you must use Default tenancy. 8. 9. For Number of Availability Zones (AZs), we recommend that you provision subnets in at least two Availability Zones for a production environment. To choose the AZs for your subnets, expand Customize AZs. Otherwise, let AWS choose them for you. To configure your subnets, choose values for Number of public subnets and Number of private subnets. To choose the IP address ranges for your subnets, expand Customize subnets CIDR blocks. Otherwise, let AWS choose them for you. 10. (Optional) If resources in a private subnet need access to the public internet over IPv4, for NAT gateways, choose the number of AZs in which to create NAT gateways. In production, we recommend that you deploy a NAT gateway in each AZ with resources that need access to the public internet. Note that there is a cost associated with NAT gateways. For |
vpc-ug-036 | vpc-ug.pdf | 36 | To configure your subnets, choose values for Number of public subnets and Number of private subnets. To choose the IP address ranges for your subnets, expand Customize subnets CIDR blocks. Otherwise, let AWS choose them for you. 10. (Optional) If resources in a private subnet need access to the public internet over IPv4, for NAT gateways, choose the number of AZs in which to create NAT gateways. In production, we recommend that you deploy a NAT gateway in each AZ with resources that need access to the public internet. Note that there is a cost associated with NAT gateways. For more information, see Pricing for NAT gateways. 11. (Optional) If resources in a private subnet need access to the public internet over IPv6, for Egress only internet gateway, choose Yes. 12. (Optional) If you need to access Amazon S3 directly from your VPC, choose VPC endpoints, S3 Gateway. This creates a gateway VPC endpoint for Amazon S3. For more information, see Gateway endpoints in the AWS PrivateLink Guide. 13. (Optional) For DNS options, both options for domain name resolution are enabled by default. If the default doesn't meet your needs, you can disable these options. 14. (Optional) To add a tag to your VPC, expand Additional tags, choose Add new tag, and enter a tag key and a tag value. 15. In the Preview pane, you can visualize the relationships between the VPC resources that you've configured. Solid lines represent relationships between resources. Dotted lines represent network traffic to NAT gateways, internet gateways, and gateway endpoints. After you create the VPC, you can visualize the resources in your VPC in this format at any time using the Resource map tab. For more information, see Visualize the resources in your VPC. Create a VPC plus other VPC resources 96 Amazon Virtual Private Cloud User Guide 16. When you are finished configuring your VPC, choose Create VPC. Create a VPC only Use the following procedure to create a VPC with no additional VPC resources using the Amazon VPC console. To create a VPC with no additional VPC resources using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. On the VPC dashboard, choose Create VPC. 3. 4. For Resources to create, choose VPC only. (Optional) For Name tag, enter a name for your VPC. Doing so creates a tag with a key of Name and the value that you specify. 5. For IPv4 CIDR block, do one of the following: • • Choose IPv4 CIDR manual input and enter an IPv4 address range for your VPC. Choose IPAM-allocated IPv4 CIDR block, select your Amazon VPC IP Address Manager (IPAM) IPv4 address pool and a netmask. The size of the CIDR block is limited by the allocation rules on the IPAM pool. IPAM is a VPC feature that makes it easier for you to plan, track, and monitor IP addresses for your AWS workloads. For more information, see the Amazon VPC IPAM User Guide. If you are using IPAM to manage your IP addresses, we recommend that you choose this option. Otherwise, the CIDR block that you specify for your VPC might overlap with an IPAM CIDR allocation. 6. (Optional) To create a dual stack VPC, specify an IPv6 address range for your VPC. For IPv6 CIDR block, do one of the following: • Choose IPAM-allocated IPv6 CIDR block if you are using Amazon VPC IP Address Manager and you want to provision a IPv6 CIDR from an IPAM pool. If you use the IPAM-allocated IPv6 CIDR block to provision IPv6 CIDRs to VPCs, you get the benefit of contiguous IPv6 CIDRs for VPC creation. Contiguously-allocated CIDRs are CIDRs that are allocated sequentially. They enable you to simplify your security and networking rules; the IPv6 CIDRs can be aggregated in a single entry across networking and security constructs like access control lists, route tables, security groups, and firewalls. You have two options for provisioning an IP address range to the VPC under CIDR block: Create a VPC only 97 Amazon Virtual Private Cloud User Guide • Netmask length: Choose this option to select a netmask length for the CIDR. Do one of the following: • If there is a default netmask length selected for the IPAM pool, you can choose Default to IPAM netmask length to use the default netmask length set for the IPAM pool by the IPAM administrator. For more information about the optional default netmask length allocation rule, see Create a Regional IPv6 pool in the Amazon VPC IPAM User Guide. • If there is no default netmask length selected for the IPAM pool, choose a netmask length that's more specific than the netmask length of the IPAM pool CIDR. For example, if the IPAM pool CIDR is /50, you can choose a netmask length between /52 to |
vpc-ug-037 | vpc-ug.pdf | 37 | length selected for the IPAM pool, you can choose Default to IPAM netmask length to use the default netmask length set for the IPAM pool by the IPAM administrator. For more information about the optional default netmask length allocation rule, see Create a Regional IPv6 pool in the Amazon VPC IPAM User Guide. • If there is no default netmask length selected for the IPAM pool, choose a netmask length that's more specific than the netmask length of the IPAM pool CIDR. For example, if the IPAM pool CIDR is /50, you can choose a netmask length between /52 to /60 for the VPC. Possible netmask lengths are between /44 and /60 in increments of /4. • Select a CIDR: Choose this option to manually enter an IPv6 address. You can only choose a netmask length that's more specific than the netmask length of the IPAM pool CIDR. For example, if the IPAM pool CIDR is /50, you can choose a netmask length between /52 to /60 for the VPC. Possible IPv6 netmask lengths are between /44 and /60 in increments of /4. • Choose Amazon-provided IPv6 CIDR block to request an IPv6 CIDR block from an Amazon pool of IPv6 addresses. For Network Border Group, select the group from which AWS advertises IP addresses. Amazon provides a fixed IPv6 CIDR block size of /56. • Choose IPv6 CIDR owned by me to provision an IPv6 CIDR that you have already brought to AWS. For more information about bringing your own IP address ranges to AWS, see Bring your own IP addresses (BYOIP) in the Amazon EC2 User Guide. You can provision an IP address range for the VPC using the following options for CIDR block: • No preference: Choose this option to use netmask length of /56. • Select a CIDR: Choose this option to manually enter an IPv6 address and choose a netmask length that's more specific than the size of BYOIP CIDR. For example, if the BYOIP pool CIDR is /50, you can choose a netmask length between /52 to /60 for the VPC. Possible IPv6 netmask lengths are between /44 and /60 in increments of /4. 7. (Optional) Choose a Tenancy option. This option defines if EC2 instances that you launch into the VPC will run on hardware that's shared with other AWS accounts or on hardware that's dedicated for your use only. If you choose the tenancy of the VPC to be Default, EC2 instances launched into this VPC will use the tenancy attribute specified when you launch the instance -- For more information, see Launch an instance using defined parameters in the Amazon EC2 User Guide. If you choose the tenancy of the VPC to be Dedicated, the instances will always run as Dedicated Instances on hardware that's dedicated for your use. If Create a VPC only 98 Amazon Virtual Private Cloud User Guide you're using AWS Outposts, your Outpost requires private connectivity; you must use Default tenancy. 8. (Optional) To add a tag to your VPC, choose Add new tag and enter a tag key and a tag value. 9. Choose Create VPC. 10. After you create a VPC, you can add subnets. For more information, see Create a subnet. Create a VPC using the AWS CLI The following procedure contains example AWS CLI commands to create a VPC plus the additional VPC resources needed to run an application. If you run all of the commands in this procedure, you'll create a VPC, a public subnet, a private subnet, a route table for each subnet, an internet gateway, an egress-only internet gateway, and a public NAT gateway. If you do not need all of these resources, you can use only the example commands that you need. Prerequisites Before you begin, install and configure the AWS CLI. When you configure the AWS CLI, you are prompted for AWS credentials. The examples in this procedure assume that you also configured a default Region. Otherwise, add the --region option to each command. For more information, see Installing or updating the AWS CLI and Configuring the AWS CLI. Tagging You can add tags to a resource after you create it by using the create-tags command. Alternatively, you can add the --tag-specification option to the creation command for the resource as follows. --tag-specifications ResourceType=vpc,Tags=[{Key=Name,Value=my-project}] To create a VPC plus VPC resources by using the AWS CLI 1. Use the following create-vpc command to create a VPC with the specified IPv4 CIDR block. aws ec2 create-vpc --cidr-block 10.0.0.0/24 --query Vpc.VpcId --output text Alternatively, to create a dual stack VPC, add the --amazon-provided-ipv6-cidr-block option to add an Amazon-provided IPv6 CIDR block, as shown in the following example. Create a VPC using the AWS CLI 99 Amazon Virtual Private Cloud User Guide aws ec2 create-vpc --cidr-block 10.0.0.0/24 --amazon-provided-ipv6-cidr-block -- query Vpc.VpcId |
vpc-ug-038 | vpc-ug.pdf | 38 | can add the --tag-specification option to the creation command for the resource as follows. --tag-specifications ResourceType=vpc,Tags=[{Key=Name,Value=my-project}] To create a VPC plus VPC resources by using the AWS CLI 1. Use the following create-vpc command to create a VPC with the specified IPv4 CIDR block. aws ec2 create-vpc --cidr-block 10.0.0.0/24 --query Vpc.VpcId --output text Alternatively, to create a dual stack VPC, add the --amazon-provided-ipv6-cidr-block option to add an Amazon-provided IPv6 CIDR block, as shown in the following example. Create a VPC using the AWS CLI 99 Amazon Virtual Private Cloud User Guide aws ec2 create-vpc --cidr-block 10.0.0.0/24 --amazon-provided-ipv6-cidr-block -- query Vpc.VpcId --output text These commands return the ID of the new VPC. The following is an example. vpc-1a2b3c4d5e6f1a2b3 2. [Dual stack VPC] Get the IPv6 CIDR block that's associated with your VPC by using the following describe-vpcs command. aws ec2 describe-vpcs --vpc-id vpc-1a2b3c4d5e6f1a2b3 --query Vpcs[].Ipv6CidrBlockAssociationSet[].Ipv6CidrBlock --output text The following is example output. 2600:1f13:cfe:3600::/56 3. Create one or more subnets, depending on your use case. In production, we recommend that you launch resources in at least two Availability Zones. Use one of the following commands to create each subnet. • • • IPv4-only subnet – To create a subnet with a specific IPv4 CIDR block, use the following create-subnet command. aws ec2 create-subnet --vpc-id vpc-1a2b3c4d5e6f1a2b3 --cidr-block 10.0.1.0/20 --availability-zone us-east-2a --query Subnet.SubnetId --output text Dual stack subnet – If you created a dual stack VPC, you can use the --ipv6-cidr- block option to create a dual stack subnet, as shown in the following command. aws ec2 create-subnet --vpc-id vpc-1a2b3c4d5e6f1a2b3 --cidr-block 10.0.1.0/20 --ipv6-cidr-block 2600:1f13:cfe:3600::/64 --availability-zone us-east-2a -- query Subnet.SubnetId --output text IPv6-only subnet – If you created a dual stack VPC, you can use the --ipv6-native option to create an IPv6-only subnet, as shown in the following command. Create a VPC using the AWS CLI 100 Amazon Virtual Private Cloud User Guide aws ec2 create-subnet --vpc-id vpc-1a2b3c4d5e6f1a2b3 --ipv6-native --ipv6- cidr-block 2600:1f13:cfe:3600::/64 --availability-zone us-east-2a --query Subnet.SubnetId --output text These commands return the ID of the new subnet. The following is an example. subnet-1a2b3c4d5e6f1a2b3 4. If you need a public subnet for your web servers, or for a NAT gateway, do the following: a. Create an internet gateway by using the following create-internet-gateway command. The command returns the ID of the new internet gateway. aws ec2 create-internet-gateway --query InternetGateway.InternetGatewayId -- output text b. Attach the internet gateway to your VPC by using the following attach-internet-gateway command. Use the internet gateway ID returned from the previous step. aws ec2 attach-internet-gateway --vpc-id vpc-1a2b3c4d5e6f1a2b3 --internet- gateway-id igw-id c. Create a custom route table for your public subnet by using the following create-route- table command. The command returns the ID of the new route table. aws ec2 create-route-table --vpc-id vpc-1a2b3c4d5e6f1a2b3 --query RouteTable.RouteTableId --output text d. Create a route in the route table that sends all IPv4 traffic to the internet gateway by using the following create-route command. Use the ID of the route table for the public subnet. aws ec2 create-route --route-table-id rtb-id-public --destination-cidr-block 0.0.0.0/0 --gateway-id igw-id e. Associate the route table with the public subnet by using the following associate-route- table command. Use the ID of the route table for the public subnet and the ID of the public subnet. Create a VPC using the AWS CLI 101 Amazon Virtual Private Cloud User Guide aws ec2 associate-route-table --route-table-id rtb-id-public --subnet- id subnet-id-public-subnet 5. [IPv6] You can add an egress-only internet gateway so that instances in a private subnet can access the internet over IPv6 (for example, to get software updates), but hosts on the internet can't access your instances. a. Create an egress-only internet gateway by using the following create-egress-only- internet-gateway command. The command returns the ID of the new internet gateway. aws ec2 create-egress-only-internet-gateway --vpc-id vpc-1a2b3c4d5e6f1a2b3 -- query EgressOnlyInternetGateway.EgressOnlyInternetGatewayId --output text b. Create a custom route table for your private subnet by using the following create-route- table command. The command returns the ID of the new route table. aws ec2 create-route-table --vpc-id vpc-1a2b3c4d5e6f1a2b3 --query RouteTable.RouteTableId --output text c. Create a route in the route table for the private subnet that sends all IPv6 traffic to the egress-only internet gateway by using the following create-route command. Use the ID of the route table returned in the previous step. aws ec2 create-route --route-table-id rtb-id-private --destination-cidr- block ::/0 --egress-only-internet-gateway eigw-id d. Associate the route table with the private subnet by using the following associate-route- table command. aws ec2 associate-route-table --route-table-id rtb-id-private --subnet- id subnet-id-private-subnet 6. If you need a NAT gateway for your resources in a private subnet, do the following: a. Create an elastic IP address for the NAT gateway by using the following allocate-address command. aws ec2 allocate-address --domain vpc --query AllocationId --output text Create a VPC using the AWS CLI 102 Amazon Virtual Private Cloud User Guide b. Create the NAT gateway in the public subnet by using |
vpc-ug-039 | vpc-ug.pdf | 39 | ec2 create-route --route-table-id rtb-id-private --destination-cidr- block ::/0 --egress-only-internet-gateway eigw-id d. Associate the route table with the private subnet by using the following associate-route- table command. aws ec2 associate-route-table --route-table-id rtb-id-private --subnet- id subnet-id-private-subnet 6. If you need a NAT gateway for your resources in a private subnet, do the following: a. Create an elastic IP address for the NAT gateway by using the following allocate-address command. aws ec2 allocate-address --domain vpc --query AllocationId --output text Create a VPC using the AWS CLI 102 Amazon Virtual Private Cloud User Guide b. Create the NAT gateway in the public subnet by using the following create-nat-gateway command. Use the allocation ID returned from the previous step. aws ec2 create-nat-gateway --subnet-id subnet-id-public-subnet --allocation- id eipalloc-id c. (Optional) If you already created a route table for the private subnet in step 5, skip this step. Otherwise, use the following create-route-table command to create a route table for your private subnet. The command returns the ID of the new route table. aws ec2 create-route-table --vpc-id vpc-1a2b3c4d5e6f1a2b3 --query RouteTable.RouteTableId --output text d. Create a route in the route table for the private subnet that sends all IPv4 traffic to the NAT gateway by using the following create-route command. Use the ID of the route table for the private subnet, which you created either in this step or in step 5. aws ec2 create-route --route-table-id rtb-id-private --destination-cidr- block 0.0.0.0/0 --gateway-id nat-id e. (Optional) If you already associated a route table with the private subnet in step 5, skip this step. Otherwise, use the following associate-route-table command to associate the route table with the private subnet. Use the ID of the route table for the private subnet, which you created either in this step or in step 5. aws ec2 associate-route-table --route-table-id rtb-id-private --subnet- id subnet-id-private-subnet Visualize the resources in your VPC This section describes how you can see a visual representation of the resources in your VPC using the Resource map tab. The following resources are visible in the resource map: • VPC • Subnets • The Availability Zone is represented with a letter. • Public subnets are green. Visualize the resources in your VPC 103 Amazon Virtual Private Cloud • Private subnets are blue. • Route tables • Internet gateways • Egress-only internet gateways • NAT gateways User Guide • Gateway endpoints (Amazon S3 and Amazon DynamoDB) The resource map shows relationships between resources inside a VPC and how traffic flows from subnets to NAT gateways, internet gateway and gateway endpoints. You can use the resource map to understand the architecture of a VPC, see how many subnets it has in it, which subnets are associated with which route tables, and which route tables have routes to NAT gateways, internet gateways, and gateway endpoints. You can also use the resource map to spot undesirable or incorrect configurations, such as private subnets disconnected from NAT gateways or private subnets with a route directly to the internet gateway. You can choose resources within the resource map, such as route tables, and edit the configurations for those resources. To visualize the resources in your VPC 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. In the navigation pane, choose VPCs. Select the VPC. 4. Choose the Resource map tab to display a visualization of the resources. 5. Choose Show details to view details in addition to the resource IDs and zones displayed by default. • VPC: The IPv4 and IPv6 CIDR ranges assigned to the VPC. • Subnets: The IPv4 and IPv6 CIDR ranges assigned to each subnet. • Route tables: The subnet associations, and the number of routes in the route table. • Network connections: The details related to each type of connection: Visualize the resources in your VPC 104 Amazon Virtual Private Cloud User Guide • If there are public subnets in the VPC, there is an internet gateway resource with the number of routes and the source and destination subnets for traffic using the internet gateway. • If there is an egress-only internet gateway, there is an egress-only internet gateway resource with the number of routes and the source and destination subnets for traffic using the egress-only internet gateway. • If there is a NAT gateway, there is a NAT gateway resource with the number of network interfaces and Elastic IP addresses for the NAT gateway. • If there is a gateway endpoint, there is a gateway endpoint resource with the name of the AWS service (Amazon S3 or Amazon DynamoDB) that you can connect to using the endpoint. 6. Hover over a resource to see the relationship between the resources. Solid lines represent relationships between resources. Dotted lines represent network traffic to network connections. Add or remove a CIDR block from your VPC This section describes how to add or remove IPv4 and IPv6 CIDR |
vpc-ug-040 | vpc-ug.pdf | 40 | there is a NAT gateway resource with the number of network interfaces and Elastic IP addresses for the NAT gateway. • If there is a gateway endpoint, there is a gateway endpoint resource with the name of the AWS service (Amazon S3 or Amazon DynamoDB) that you can connect to using the endpoint. 6. Hover over a resource to see the relationship between the resources. Solid lines represent relationships between resources. Dotted lines represent network traffic to network connections. Add or remove a CIDR block from your VPC This section describes how to add or remove IPv4 and IPv6 CIDR blocks from a VPC. Important • Your VPC can have up to five IPv4 and five IPv6 CIDR blocks by default, but this limit is adjustable. For more information, see Amazon VPC quotas. For information about restrictions on CIDR blocks for a VPC, see VPC CIDR blocks. • If your VPC has more than one IPv4 CIDR block associated with it, you can remove an IPv4 CIDR block from the VPC. You cannot remove the primary IPv4 CIDR block. You must remove an entire CIDR block; you cannot remove a subset of a CIDR block or a merged range of CIDR blocks. You must first delete all subnets in the CIDR block. • If you no longer want IPv6 support in your VPC, but you want to continue using your VPC to create and communicate with IPv4 resources, you can remove the IPv6 CIDR block. • To remove an IPv6 CIDR block, you must first unassign any IPv6 addresses that are assigned to any instances in your subnet. Add or remove CIDR block 105 Amazon Virtual Private Cloud User Guide • Removing an IPv6 CIDR block does not automatically delete any security group rules, network ACL rules, or route table routes that you've configured for IPv6 networking. You must manually modify or delete these rules or routes. To add or remove a CIDR block from a VPC using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. 4. 5. 6. In the navigation pane, choose Your VPCs. Select the VPC, and then choose Actions, Edit CIDRs. To remove a CIDR, choose Remove next to the CIDR. To add a CIDR, choose Add new IPv4 CIDR or Add new IPv6 CIDR. To add a CIDR for IPv4 CIDR block, do one of the following: • • • Choose IPv4 CIDR manual input and enter an IPv4 CIDR block. Choose IPAM-allocated IPv4 CIDR and select a CIDR from an IPv4 IPAM pool. Choose Save. 7. To add a CIDR for IPv6 CIDR block, do the following: • Choose IPAM-allocated IPv6 CIDR block if you are using Amazon VPC IP Address Manager and you want to provision a IPv6 CIDR from an IPAM pool. You have two options for provisioning an IP address range to the VPC under CIDR block: • Netmask length: Choose this option to select a netmask length for the CIDR. Do one of the following: • If there is a default netmask length selected for the IPAM pool, you can choose Default to IPAM netmask length to use the default netmask length set for the IPAM pool by the IPAM administrator. For more information about the optional default netmask length allocation rule, see Create a Regional IPv6 pool in the Amazon VPC IPAM User Guide. • If there is no default netmask length selected for the IPAM pool, choose a netmask length that's more specific than the netmask length of the IPAM pool CIDR. For example, if the IPAM pool CIDR is /50, you can choose a netmask length between /52 to /60 for the VPC. Possible netmask lengths are between /44 and /60 in increments of /4. • Select a CIDR: Choose this option to manually enter an IPv6 address. You can only choose a netmask length that's more specific than the netmask length of the IPAM pool CIDR. For Add or remove CIDR block 106 Amazon Virtual Private Cloud User Guide example, if the IPAM pool CIDR is /50, you can choose a netmask length between /52 to /60 for the VPC. Possible IPv6 netmask lengths are between /44 and /60 in increments of /4. • Choose Amazon-provided IPv6 CIDR block to request an IPv6 CIDR block from an Amazon pool of IPv6 addresses. For Network Border Group, select the group from which AWS advertises IP addresses. Amazon provides a fixed IPv6 CIDR block size of /56. • Choose IPv6 CIDR owned by me to provision an IPv6 CIDR that you have already brought to AWS. For more information about bringing your own IP address ranges to AWS, see Bring your own IP addresses (BYOIP) in Amazon EC2 in the Amazon EC2 User Guide. You have two options for provisioning an IP address range |
vpc-ug-041 | vpc-ug.pdf | 41 | /4. • Choose Amazon-provided IPv6 CIDR block to request an IPv6 CIDR block from an Amazon pool of IPv6 addresses. For Network Border Group, select the group from which AWS advertises IP addresses. Amazon provides a fixed IPv6 CIDR block size of /56. • Choose IPv6 CIDR owned by me to provision an IPv6 CIDR that you have already brought to AWS. For more information about bringing your own IP address ranges to AWS, see Bring your own IP addresses (BYOIP) in Amazon EC2 in the Amazon EC2 User Guide. You have two options for provisioning an IP address range to the VPC under CIDR block: • No preference: Choose this option to use netmask length of /56. • Select a CIDR: Choose this option to manually enter an IPv6 address and choose a netmask length that's more specific than the size of BYOIP CIDR. For example, if the BYOIP pool CIDR is /50, you can choose a netmask length between /52 to /60 for the VPC. Possible IPv6 netmask lengths are between /44 and /60 in increments of /4. • Choose Select CIDR when you're done. 8. Choose Close. 9. If you've added a CIDR block to your VPC, you can create subnets that use the new CIDR block. For more information, see Create a subnet. To associate or disassociate a CIDR block from a VPC using the AWS CLI Use the associate-vpc-cidr-block and disassociate-vpc-cidr-block commands. DHCP option sets in Amazon VPC Network devices in your VPC use Dynamic Host Configuration Protocol (DHCP). You can use DHCP option sets to control the following aspects of the network configuration in your virtual network: • The DNS servers, domain names, or Network Time Protocol (NTP) servers used by the devices in your VPC. • Whether DNS resolution is enabled in your VPC. Contents • What is DHCP? DHCP option sets 107 Amazon Virtual Private Cloud • DHCP option set concepts • Work with DHCP option sets What is DHCP? User Guide Every device on a TCP/IP network requires an IP address to communicate over the network. In the past, IP addresses had to be assigned to each device in your network manually. Today, IP addresses are assigned dynamically by DHCP servers using the Dynamic Host Configuration Protocol (DHCP). Applications running on EC2 instances can communicate with Amazon DHCP servers as needed to retrieve their IP address lease or other network configuration information (such as the IP address of an Amazon DNS server or the IP address of the router in your VPC). You can specify the network configurations that are provided by Amazon DHCP servers by using DHCP option sets. If you have a VPC configuration that requires your applications to make direct requests to the Amazon IPv6 DHCP server, note the following: • An EC2 instance in a dual-stack subnet can only retrieve its IPv6 address from the IPv6 DHCP server. It cannot retrieve any additional network configurations from the IPv6 DHCP server, such as DNS server names or domain names. • An EC2 instance in a IPv6-only subnet can retrieve its IPv6 address from the IPv6 DHCP server and can retrieve additional networking configuration information, such as DNS server names and domain names. • For an EC2 instance in an IPv6-only subnet, the IPv4 DHCP Server will return 169.254.169.253 as the name server if "AmazonProvidedDNS" is explicitly mentioned in the DHCP option set. If "AmazonProvidedDNS" is missing from the option set, the IPv4 DHCP Server won't return an address whether other IPv4 name servers are mentioned in the option set or not. The Amazon DHCP servers can also provide an entire IPv4 or IPv6 prefix to a network interface in your VPC using prefix delegation (see Assigning prefixes to Amazon EC2 network interfaces in the Amazon EC2 User Guide). IPv4 prefix delegation is not provided in DHCP responses. IPv4 prefixes assigned to the interface can be retrieved using IMDS (see Instance metadata categories in the Amazon EC2 User Guide). What is DHCP? 108 Amazon Virtual Private Cloud User Guide DHCP option set concepts A DHCP option set is a group of network settings used by resources in your VPC, such as EC2 instances, to communicate over your virtual network. Each Region has a default DHCP option set. Each VPC uses the default DHCP option set for its Region unless you either create and associate a custom DHCP option set with the VPC or configure the VPC with no DHCP option set. If your VPC has no DHCP option set configured: • For EC2 instances built on the Nitro System, AWS configures 169.254.169.253 as the default domain name server. • For EC2 instances built on Xen, no domain name servers are configured and, because instances in the VPC have no access to a DNS server, they can't access the internet. |
vpc-ug-042 | vpc-ug.pdf | 42 | Each Region has a default DHCP option set. Each VPC uses the default DHCP option set for its Region unless you either create and associate a custom DHCP option set with the VPC or configure the VPC with no DHCP option set. If your VPC has no DHCP option set configured: • For EC2 instances built on the Nitro System, AWS configures 169.254.169.253 as the default domain name server. • For EC2 instances built on Xen, no domain name servers are configured and, because instances in the VPC have no access to a DNS server, they can't access the internet. You can associate a DHCP option set with multiple VPCs, but each VPC can have only one associated DHCP option set. If you delete a VPC, the DHCP option set that is associated with the VPC is disassociated from the VPC. Contents • Default DHCP option set • Custom DHCP option set Default DHCP option set The default DHCP option set contains the following settings: • Domain name servers: The DNS servers that your network interfaces use for domain name resolution. For a default DHCP option set, this is always AmazonProvidedDNS. For more information, see Amazon DNS server. • Domain name: The domain name that a client should use when resolving hostnames using the Domain Name System (DNS). For more information about the domain names used for EC2 instances, see Amazon EC2 instance hostnames. DHCP option set concepts 109 Amazon Virtual Private Cloud User Guide • IPv6 Preferred Lease Time: How frequently a running instance with an IPv6 assigned to it goes through DHCPv6 lease renewal. The default lease time is 140 seconds. Lease renewal typically occurs when half of the lease time has elapsed. When you use a default DHCP options set, the following settings are not used, but there are defaults for EC2 instances: • NTP servers: By default, EC2 instances use the Amazon Time Sync Service to retrieve the time. • NetBIOS name servers: For EC2 instances running Windows, the NetBIOS computer name is a friendly name assigned to the instance to identify it on the network. The NetBIOS name server maintains a list of mappings between NetBIOS computer names and network addresses for networks that use NetBIOS as their naming service. • NetBIOS node type: For EC2 instances running Windows, this is the method that the instances use to resolve NetBIOS names to IP addresses. When you use the default option set, the Amazon DHCP server uses the network settings in the default option set. When you launch instances in your VPC, they do the following, as shown in the diagram: (1) interact with the DHCP server, (2) interact with the Amazon DNS server, and (3) connect to other devices in the network through the router for your VPC. The instances can interact with the Amazon DHCP server at any time to get their IP address lease and additional network settings. DHCP option set concepts 110 Amazon Virtual Private Cloud User Guide Custom DHCP option set You can create a custom DHCP option set with the following settings, and then associate it with a VPC: • Domain name servers: The DNS servers that your network interfaces use for domain name resolution. • Domain name: The domain name that a client uses when resolving hostnames using the Domain Name System (DNS). • NTP servers: The NTP servers that provide the time to the instances. • NetBIOS name servers: For EC2 instances running Windows, the NetBIOS computer name is a friendly name assigned to the instance to identify it on the network. A NetBIOS name server maintains a list of mappings between NetBIOS computer names and network addresses for networks that use NetBIOS as their naming service. • NetBIOS node type: For EC2 instances running Windows, the method that the instances use to resolve NetBIOS names to IP addresses. • IPv6 Preferred Lease Time (optional): A value (in seconds, minutes, hours, or years) for how frequently a running instance with an IPv6 assigned to it goes through DHCPv6 lease renewal. Acceptable values are between 140 and 4294967295 seconds (approximately 138 years). If no DHCP option set concepts 111 Amazon Virtual Private Cloud User Guide value is entered, the default lease time is 140 seconds. If you use long-term addressing for EC2 instances, you can increase the lease time and avoid frequent lease renewal requests. Lease renewal typically occurs when half of the lease time has elapsed. When you use a custom option set, instances launched into your VPC do the following, as shown in the diagram: (1) use the network settings in the custom DHCP option set, (2) interact with the DNS, NTP, and NetBIOS servers specified in the custom DHCP option set, and (3) connect to other devices in the network through the router for your VPC. |
vpc-ug-043 | vpc-ug.pdf | 43 | default lease time is 140 seconds. If you use long-term addressing for EC2 instances, you can increase the lease time and avoid frequent lease renewal requests. Lease renewal typically occurs when half of the lease time has elapsed. When you use a custom option set, instances launched into your VPC do the following, as shown in the diagram: (1) use the network settings in the custom DHCP option set, (2) interact with the DNS, NTP, and NetBIOS servers specified in the custom DHCP option set, and (3) connect to other devices in the network through the router for your VPC. Related tasks • Create a DHCP option set • Change the option set associated with a VPC Work with DHCP option sets Use the following procedures to view and work with DHCP option sets. For more information about how DHCP option sets work, see the section called “DHCP option set concepts”. Tasks Work with DHCP option sets 112 Amazon Virtual Private Cloud • Create a DHCP option set • Change the option set associated with a VPC • Delete a DHCP option set Create a DHCP option set User Guide A custom DHCP option set enables you to customize your VPC with your own DNS server, domain name, and more. You can create as many additional DHCP option sets as you want. However, you can only associate a VPC with one DHCP option set at a time. Note After you create a DHCP option set, you can't modify it. To update the DHCP options for your VPC, you must create a new DHCP option set and then associate it with your VPC. To create a DHCP options set using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. In the navigation pane, choose DHCP option sets. 3. Choose Create DHCP options set. 4. For Tag settings, optionally enter a name for the DHCP option set. If you enter a value, it automatically creates a Name tag for the DHCP option set. 5. For DHCP options, provide the configuration settings that you need. • Domain name (optional): Enter the domain name that a client should use when resolving hostnames via the Domain Name System. If you are not using AmazonProvidedDNS, your custom domain name servers must resolve the hostname as appropriate. If you use an Amazon Route 53 private hosted zone, you can use AmazonProvidedDNS. For more information, see DNS attributes for your VPC. Note Only use domain names that you fully control. Work with DHCP option sets 113 Amazon Virtual Private Cloud User Guide Some Linux operating systems accept multiple domain names separated by spaces. However, Windows and other Linux operating systems treat the value as a single domain, which results in unexpected behavior. If your DHCP option set is associated with a VPC that has instances running operating systems that treat the value as a single domain, specify only one domain name. • Domain name servers (optional): Enter the DNS servers that will be used to resolve the IP address of a host from the host's name. You can enter either AmazonProvidedDNS or custom domain name servers. Using both might cause unexpected behavior. You can enter the IP addresses of up to four IPv4 domain name servers (or up to three IPv4 domain name servers and AmazonProvidedDNS) and four IPv6 domain name servers separated by commas. Although you can specify up to eight domain name servers, some operating systems might impose lower limits. For more information about AmazonProvidedDNS and the Amazon DNS server, see Amazon DNS server. Important If your VPC has an internet gateway, be sure to specify your own DNS server or an Amazon DNS server (AmazonProvidedDNS) for the Domain name servers value. Otherwise, the instances in the VPC won't have access to DNS, which disable internet access. • NTP servers (optional): Enter the IP addresses of up to eight Network Time Protocol (NTP) servers (four IPv4 addresses and four IPv6 addresses). NTP servers provide the time to your network. You can specify the Amazon Time Sync Service at IPv4 address 169.254.169.123 or IPv6 address fd00:ec2::123. Instances communicate with the Amazon Time Sync Service by default. Note that the IPv6 address is only accessible on EC2 instances built on the Nitro System. For more information about the NTP servers option, see RFC 2132. For more information about the Amazon Time Sync Service, see Set the time for your instance in the Amazon EC2 User Guide. • NetBIOS name servers (optional): Enter the IP addresses of up to four NetBIOS name servers. Work with DHCP option sets 114 Amazon Virtual Private Cloud User Guide For EC2 instances running a Windows OS, the NetBIOS computer name is a friendly name assigned to the instance to identify it on the network. The NetBIOS name server maintains a list |
vpc-ug-044 | vpc-ug.pdf | 44 | EC2 instances built on the Nitro System. For more information about the NTP servers option, see RFC 2132. For more information about the Amazon Time Sync Service, see Set the time for your instance in the Amazon EC2 User Guide. • NetBIOS name servers (optional): Enter the IP addresses of up to four NetBIOS name servers. Work with DHCP option sets 114 Amazon Virtual Private Cloud User Guide For EC2 instances running a Windows OS, the NetBIOS computer name is a friendly name assigned to the instance to identify it on the network. The NetBIOS name server maintains a list of mappings between NetBIOS computer names and network addresses for networks that use NetBIOS as their naming service. • NetBIOS node type (optional): Enter 1, 2, 4, or 8. We recommend that you specify 2 (point-to-point or P-node). Broadcast and multicast are not currently supported. For more information about these node types, see section 8.7 of RFC 2132 and section 10 of RFC1001. For EC2 instances running a Windows OS, this is the method that the instances use to resolve NetBIOS names to IP addresses. In the default options set, there is no value for NetBIOS node type. • IPv6 Preferred Lease Time (optional): A value (in seconds, minutes, hours, or years) for how frequently a running instance with an IPv6 assigned to it goes through DHCPv6 lease renewal. Acceptable values are between 140 and 2147483647 seconds (approximately 68 years). If no value is entered, the default lease time is 140 seconds. If you use long-term addressing for EC2 instances, you can increase the lease time and avoid frequent lease renewal requests. Lease renewal typically occurs when half of the lease time has elapsed. 6. Add Tags. 7. Choose Create DHCP options set. Note the name or ID of the new DHCP option set. 8. To configure a VPC to use the new option set, see Change the option set associated with a VPC. To create a DHCP option set for your VPC using the command line • create-dhcp-options (AWS CLI) • New-EC2DhcpOption (AWS Tools for Windows PowerShell) Change the option set associated with a VPC After you create a DHCP option set, you can associate it with one or more VPCs. You can associate only one DHCP option set with a VPC at a time. If you do not associate a DHCP option set with a VPC, this disables domain name resolution in the VPC. When you associate a new set of DHCP options with a VPC, any existing instances and all new instances that you launch in that VPC use the new options. You don't need to restart or relaunch Work with DHCP option sets 115 Amazon Virtual Private Cloud User Guide your instances. Instances automatically pick up the changes within a few hours, depending on how frequently they renew their DHCP leases. If you prefer, you can explicitly renew the lease using the operating system on the instance. To change the DHCP option set associated with a VPC using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. 4. In the navigation pane, choose Your VPCs. Select the check box for the VPC, and then choose Actions, Edit VPC settings. For DHCP options set, choose a new DHCP option set. Alternatively, choose No DHCP option set to disable domain name resolution for the VPC. 5. Choose Save. To change the DHCP option set associated with a VPC using the command line • associate-dhcp-options (AWS CLI) • Register-EC2DhcpOption (AWS Tools for Windows PowerShell) Delete a DHCP option set When you no longer need a DHCP option set, use the following procedure to delete it. You can't delete a DHCP option set if it's in use. For each VPC associated with the DHCP option set to delete, you must associate a different DHCP option set with the VPC or configure the VPC to use no DHCP option set. For more information, see the section called “Change the option set associated with a VPC”. To delete a DHCP option set using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. In the navigation pane, choose DHCP option sets. Select the radio button for the DHCP option set, and then choose Actions, Delete DHCP option set. 4. When prompted for confirmation, enter delete, and then choose Delete DHCP option set. Work with DHCP option sets 116 Amazon Virtual Private Cloud User Guide To delete a DHCP option set using the command line • delete-dhcp-options (AWS CLI) • Remove-EC2DhcpOption (AWS Tools for Windows PowerShell) DNS attributes for your VPC Domain Name System (DNS) is a standard by which names used on the internet are resolved to their corresponding IP addresses. A DNS hostname is a name that uniquely and absolutely names a computer; it's composed of |
vpc-ug-045 | vpc-ug.pdf | 45 | DHCP option set, and then choose Actions, Delete DHCP option set. 4. When prompted for confirmation, enter delete, and then choose Delete DHCP option set. Work with DHCP option sets 116 Amazon Virtual Private Cloud User Guide To delete a DHCP option set using the command line • delete-dhcp-options (AWS CLI) • Remove-EC2DhcpOption (AWS Tools for Windows PowerShell) DNS attributes for your VPC Domain Name System (DNS) is a standard by which names used on the internet are resolved to their corresponding IP addresses. A DNS hostname is a name that uniquely and absolutely names a computer; it's composed of a host name and a domain name. DNS servers resolve DNS hostnames to their corresponding IP addresses. Public IPv4 addresses enable communication over the internet, while private IPv4 addresses enable communication within the network of the instance. For more information, see IP addressing for your VPCs and subnets. Amazon provides a DNS server (the Amazon Route 53 Resolver) for your VPC. To use your own DNS server instead, create a new set of DHCP options for your VPC. For more information, see DHCP option sets in Amazon VPC. Contents • Understanding Amazon DNS • View DNS hostnames for your EC2 instance • View and update DNS attributes for your VPC Understanding Amazon DNS As an AWS architect or administrator, one of the foundational networking components you'll encounter is the Amazon DNS server, also known as the Route 53 Resolver. This DNS resolver service is natively integrated into each Availability Zone within your AWS Region, providing a reliable and scalable solution for domain name resolution within your Virtual Private Cloud (VPC). In this section you'll learn about the Amazon DNS server's IP addresses, the private DNS hostnames it can resolve, and the rules that govern its usage. Contents • Amazon DNS server DNS attributes 117 Amazon Virtual Private Cloud • Rules and considerations • DNS hostnames for EC2 instances • DNS attributes for your VPC • DNS quotas • Private hosted zones Amazon DNS server User Guide The Route 53 Resolver (also called "Amazon DNS server" or "AmazonProvidedDNS") is a DNS Resolver service which is built into each Availability Zone in an AWS Region. The Route 53 Resolver is located at 169.254.169.253 (IPv4), fd00:ec2::253 (IPv6), and at the primary private IPV4 CIDR range provisioned to your VPC plus two. For example, if you have a VPC with an IPv4 CIDR of 10.0.0.0/16 and an IPv6 CIDR of 2001:db8::/32, you can reach the Route 53 Resolver at 169.254.169.253 (IPv4), fd00:ec2::253 (IPv6), or 10.0.0.2 (IPv4). Resources within a VPC use a link local address for DNS queries. These queries are transported to the Route 53 Resolver privately and are not visible on the network. In an IPv6-only subnet, the IPv4 link-local address (169.254.169.253) is still reachable as long as "AmazonProvidedDNS" is the name server in the DHCP option set. When you launch an instance into a VPC, we provide the instance with a private DNS hostname. We also provide a public DNS hostname if the instance is configured with a public IPv4 address and the VPC DNS attributes are enabled. The format of the private DNS hostname depends on how you configure the EC2 instance when you launch it. For more information on the types of private DNS hostnames, see Amazon EC2 instance hostname types in the Amazon EC2 User Guide. The Amazon DNS server in your VPC is used to resolve the DNS domain names that you specify in a private hosted zone in Route 53. For more information about private hosted zones, see Working with private hosted zones in the Amazon Route 53 Developer Guide. Rules and considerations When using the Amazon DNS server, the following rules and considerations apply. • You cannot filter traffic to or from the Amazon DNS server using network ACLs or security groups. Understanding Amazon DNS 118 Amazon Virtual Private Cloud User Guide • Services that use the Hadoop framework, such as Amazon EMR, require instances to resolve their own fully qualified domain names (FQDN). In such cases, DNS resolution can fail if the domain- name-servers option is set to a custom value. To ensure proper DNS resolution, consider adding a conditional forwarder on your DNS server to forward queries for the domain region- name.compute.internal to the Amazon DNS server. For more information, see Setting up a VPC to host clusters in the Amazon EMR Management Guide. • The Amazon Route 53 Resolver only supports recursive DNS queries. DNS hostnames for EC2 instances When you launch an instance, it always receives a private IPv4 address and a private DNS hostname that corresponds to its private IPv4 address. If your instance has a public IPv4 address, the DNS attributes for its VPC determines whether it receives a public DNS hostname that corresponds to the public IPv4 address. |
vpc-ug-046 | vpc-ug.pdf | 46 | server to forward queries for the domain region- name.compute.internal to the Amazon DNS server. For more information, see Setting up a VPC to host clusters in the Amazon EMR Management Guide. • The Amazon Route 53 Resolver only supports recursive DNS queries. DNS hostnames for EC2 instances When you launch an instance, it always receives a private IPv4 address and a private DNS hostname that corresponds to its private IPv4 address. If your instance has a public IPv4 address, the DNS attributes for its VPC determines whether it receives a public DNS hostname that corresponds to the public IPv4 address. For more information, see DNS attributes for your VPC. With the Amazon provided DNS server enabled, DNS hostnames are resolved as follows. Private IPv4 DNS name The private IPv4 DNS hostname of an instance resolves to its private IPv4 address. You can use the private IPv4 DNS hostname for communication between instances in the same VPC or in connected VPCs. For more information, see Private IPv4 addresses in the Amazon EC2 User Guide. Public IPv4 DNS name The public IPv4 DNS hostname of an instance resolves to its public IPv4 address (outside the network of the instance) or its private IPv4 address (inside the network of the instance). For more information, see Public IPv4 addresses in the Amazon EC2 User Guide. To resolve public IPv4 DNS names to private IPv4 addresses over a VPC peering connection, you must enable DNS resolution for the peering connection. For more information, see Enable DNS resolution for a VPC peering connection. Private resource DNS name The RBN-based DNS name that can resolve to the A and AAAA DNS records selected for this instance. This DNS hostname is visible in the instance details for instances in dual-stack and IPv6- only subnets. For more information about RBN, see EC2 instance hostname types in the Amazon EC2 User Guide. Understanding Amazon DNS 119 Amazon Virtual Private Cloud User Guide DNS attributes for your VPC The following VPC attributes determine the DNS support provided for your VPC. If both attributes are enabled, an instance launched into the VPC receives a public DNS hostname if it is assigned a public IPv4 address or an Elastic IP address at creation. If you enable both attributes for a VPC that didn't previously have them both enabled, instances that were already launched into that VPC receive public DNS hostnames if they have a public IPv4 address or an Elastic IP address. To check whether these attributes are enabled for your VPC, see View and update DNS attributes for your VPC. Attribute Description enableDnsHostnames Determines whether the VPC supports assigning public DNS hostnames to instances with public IP addresses. The default for this attribute is false unless the VPC is a default VPC. Note the Rules and considerations for this attribute below. enableDnsSupport Determines whether the VPC supports DNS resolution through the Amazon provided DNS server. If this attribute is true, queries to the Amazon provided DNS server succeed. For more information, see Amazon DNS server. The default for this attribute is true. Note the Rules and considerations for this attribute below. Rules and considerations • If both attributes are set to true, the following occurs: • Instances with public IP addresses receive corresponding public DNS hostnames. • The Amazon Route 53 Resolver server can resolve Amazon-provided private DNS hostnames. • If at least one of the attributes is set to false, the following occurs: • Instances with public IP addresses do not receive corresponding public DNS hostnames. • The Amazon Route 53 Resolver cannot resolve Amazon-provided private DNS hostnames. Understanding Amazon DNS 120 Amazon Virtual Private Cloud User Guide • Instances receive custom private DNS hostnames if there is a custom domain name in the DHCP options set. If you are not using the Amazon Route 53 Resolver server, your custom domain name servers must resolve the hostname as appropriate. • If you use custom DNS domain names defined in a private hosted zone in Amazon Route 53, or use private DNS with interface VPC endpoints (AWS PrivateLink), you must set both the enableDnsHostnames and enableDnsSupport attributes to true. • The Amazon Route 53 Resolver can resolve private DNS hostnames to private IPv4 addresses for all address spaces, including where the IPv4 address range of your VPC falls outside of the private IPv4 addresses ranges specified by RFC 1918. However, if you created your VPC before October 2016, the Amazon Route 53 Resolver does not resolve private DNS hostnames if your VPC's IPv4 address range falls outside of these ranges. To enable support for this, contact Support. DNS quotas There is a 1024 packet per second (PPS) limit to services that use link-local addresses. This limit includes the aggregate of Route 53 Resolver DNS queries, Instance Metadata Service (IMDS) requests, Amazon Time |
vpc-ug-047 | vpc-ug.pdf | 47 | IPv4 addresses for all address spaces, including where the IPv4 address range of your VPC falls outside of the private IPv4 addresses ranges specified by RFC 1918. However, if you created your VPC before October 2016, the Amazon Route 53 Resolver does not resolve private DNS hostnames if your VPC's IPv4 address range falls outside of these ranges. To enable support for this, contact Support. DNS quotas There is a 1024 packet per second (PPS) limit to services that use link-local addresses. This limit includes the aggregate of Route 53 Resolver DNS queries, Instance Metadata Service (IMDS) requests, Amazon Time Service Network Time Protocol (NTP) requests, and Windows Licensing Service (for Microsoft Windows based instances) requests. This quota cannot be increased. The number of DNS queries per second supported by Route 53 Resolver varies by the type of query, the size of the response, and the protocol in use. For more information and recommendations for a scalable DNS architecture, see the AWS Hybrid DNS with Active Directory Technical Guide. If you reach the quota, the Route 53 Resolver rejects traffic. Some of the causes for reaching the quota might be a DNS throttling issue, or instance metadata queries that use the Route 53 Resolver network interface. For information about how to solve VPC DNS throttling issues, see How can I determine whether my DNS queries to the Amazon provided DNS server are failing due to VPC DNS throttling. For information about instance metadata retrieval, see Retrieve instance metadata in the Amazon EC2 User Guide. Private hosted zones To access the resources in your VPC using custom DNS domain names, such as example.com, instead of using private IPv4 addresses or AWS-provided private DNS hostnames, you can create a private hosted zone in Route 53. A private hosted zone is a container that holds information about how you want to route traffic for a domain and its subdomains within one or more VPCs without Understanding Amazon DNS 121 Amazon Virtual Private Cloud User Guide exposing your resources to the internet. You can then create Route 53 resource record sets, which determine how Route 53 responds to queries for your domain and subdomains. For example, if you want browser requests for example.com to be routed to a web server in your VPC, you'll create an A record in your private hosted zone and specify the IP address of that web server. For more information about creating a private hosted zone, see Working with private hosted zones in the Amazon Route 53 Developer Guide. To access resources using custom DNS domain names, you must be connected to an instance within your VPC. From your instance, you can test that your resource in your private hosted zone is accessible from its custom DNS name by using the ping command; for example, ping mywebserver.example.com. (You must ensure that your instance's security group rules allow inbound ICMP traffic for the ping command to work.) Private hosted zones do not support transitive relationships outside of the VPC; for example, you cannot access your resources using their custom private DNS names from the other side of a VPN connection. Important If you use custom DNS domain names defined in a private hosted zone in Amazon Route 53, you must set both the enableDnsHostnames and enableDnsSupport attributes to true. View DNS hostnames for your EC2 instance You can view the DNS hostnames for a running instance or a network interface using the Amazon EC2 console or the command line. Knowing these hostnames is important for connecting to your resources. The Public DNS (IPv4) and Private DNS fields are available when the DNS options are enabled for the VPC that is associated with the instance. For more information, see the section called “DNS attributes for your VPC”. Instance To view DNS hostnames for an instance using the console 1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/. View DNS hostnames for your EC2 instance 122 Amazon Virtual Private Cloud User Guide 2. 3. 4. In the navigation pane, choose Instances. Select your instance from the list. In the details pane, the Public DNS (IPv4) and Private DNS fields display the DNS hostnames, if applicable. To view DNS hostnames for an instance using the command line • describe-instances (AWS CLI) • Get-EC2Instance (AWS Tools for Windows PowerShell) Network interface To view the private DNS hostname for a network interface using the console 1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/. 2. 3. 4. In the navigation pane, choose Network Interfaces. Select the network interface from the list. In the details pane, the Private DNS (IPv4) field displays the private DNS hostname. To view DNS hostnames for a network interface using the command line • describe-network-interfaces (AWS CLI) • Get-EC2NetworkInterface (AWS Tools for Windows PowerShell) View and update DNS attributes for your VPC You |
vpc-ug-048 | vpc-ug.pdf | 48 | the command line • describe-instances (AWS CLI) • Get-EC2Instance (AWS Tools for Windows PowerShell) Network interface To view the private DNS hostname for a network interface using the console 1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/. 2. 3. 4. In the navigation pane, choose Network Interfaces. Select the network interface from the list. In the details pane, the Private DNS (IPv4) field displays the private DNS hostname. To view DNS hostnames for a network interface using the command line • describe-network-interfaces (AWS CLI) • Get-EC2NetworkInterface (AWS Tools for Windows PowerShell) View and update DNS attributes for your VPC You can view and update the DNS support attributes for your VPC using the Amazon VPC console. These settings control whether your instances get public DNS hostnames and whether the Amazon DNS server can resolve your private DNS names. Configuring these attributes correctly is vital for ensuring seamless communication within your VPC. To describe and update DNS support for a VPC using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. In the navigation pane, choose Your VPCs. View and update DNS attributes for your VPC 123 Amazon Virtual Private Cloud User Guide 3. Select the checkbox for the VPC. 4. Review the information in Details. In this example, both DNS hostnames and DNS resolution are enabled. 5. To update these settings, choose Actions and then choose Edit VPC settings. Select or clear Enable on the appropriate DNS attribute and choose Save changes. To describe DNS support for a VPC using the command line • describe-vpc-attribute (AWS CLI) • Get-EC2VpcAttribute (AWS Tools for Windows PowerShell) To update DNS support for a VPC using the command line • modify-vpc-attribute (AWS CLI) • Edit-EC2VpcAttribute (AWS Tools for Windows PowerShell) Network Address Usage for your VPC Network Address Usage (NAU) is a metric applied to resources in your virtual network to help you plan for and monitor the size of your VPC. Each NAU unit contributes to a total that represents the size of your VPC. It's important to understand the total number of units that make up the NAU of your VPC because the following VPC quotas limit the size of a VPC: Network Address Usage 124 Amazon Virtual Private Cloud User Guide • Network Address Usage – The maximum number of NAU units that a single VPC can have. Each VPC can have up to 64,000 NAU units by default. You can request a quota increase up to 256,000. • Peered Network Address Usage – The maximum number of NAU units for a VPC and all of its peered VPCs. If a VPC is peered with other VPCs in the same Region, the VPCs combined can have up to 128,000 NAU units by default. You can request a quota increase up to 512,000. VPCs that are peered across different Regions do not contribute to this limit. You can use the NAU in the following ways: • Before you create your virtual network, calculate the NAU units to help you decide if you should spread workloads across multiple VPCs. • After you’ve created your VPC, use Amazon CloudWatch to monitor the NAU usage of the VPC so that it doesn't grow beyond the NAU quota limits. For more information, see the section called “CloudWatch metrics”. How NAU is calculated If you understand how NAU is calculated, it can help you plan for the scaling of your VPCs. The following table explains which resources make up the NAU count in a VPC and how many NAU units each resource uses. Some AWS resources are represented as single NAU units and some resources are represented as multiple NAU units. You can use the table to learn how NAU is calculated. Resource Each private or public IPv4 and each IPv6 address assigned to a network interface for an EC2 instance in the VPC Additional network interfaces attached to an EC2 instance Prefix assigned to a network interface Network Load Balancer per AZ Gateway Load Balancer per AZ NAU units 1 1 1 6 6 How NAU is calculated 125 Amazon Virtual Private Cloud Resource VPC endpoint per AZ Transit gateway attachment Lambda function NAT gateway EFS mount target EFA interface (EFA with an ENA device) or an EFA-only interface Amazon EKS pod NAU examples The following examples show how to calculate NAU. Example 1 - Two VPCs connected using VPC peering User Guide NAU units 6 6 6 6 6 1 1 Peered VPCs in the same Region contribute to a combined NAU quota. • VPC 1 • 50 Network Load Balancers in 2 subnets in separate Availability Zones - 600 NAU units • 5,000 instances (each with an IPv4 address and IPv6 address) in one subnet and 5,000 instances (each with an IPv4 address and IPv6 address) in another subnet - 20,000 units |
vpc-ug-049 | vpc-ug.pdf | 49 | device) or an EFA-only interface Amazon EKS pod NAU examples The following examples show how to calculate NAU. Example 1 - Two VPCs connected using VPC peering User Guide NAU units 6 6 6 6 6 1 1 Peered VPCs in the same Region contribute to a combined NAU quota. • VPC 1 • 50 Network Load Balancers in 2 subnets in separate Availability Zones - 600 NAU units • 5,000 instances (each with an IPv4 address and IPv6 address) in one subnet and 5,000 instances (each with an IPv4 address and IPv6 address) in another subnet - 20,000 units • 100 Lambda functions - 600 NAU units • VPC 2 • 50 Network Load Balancers in 2 subnets in separate Availability Zones - 600 NAU units • 5,000 instances (each with an IPv4 address and IPv6 address) in one subnet and 5,000 instances (each with an IPv4 address and IPv6 address) in another subnet - 20,000 units • 100 Lambda functions - 600 NAU units • Total peering NAU count: 42,400 units • Default peering NAU quota: 128,000 units NAU examples 126 Amazon Virtual Private Cloud User Guide Example 2 - Two VPCs connected using a transit gateway VPCs that are connected using a transit gateway do not contribute to a combined NAU quota as they do for peered VPCs. • VPC 1 • 50 Network Load Balancers in 2 subnets in separate Availability Zones - 600 NAU units • 5,000 instances (each with an IPv4 address and IPv6 address) in one subnet and 5,000 instances (each with an IPv4 address and IPv6 address) in another subnet - 20,000 units • 100 Lambda functions - 600 NAU units • VPC 2 • 50 Network Load Balancers in 2 subnets in separate Availability Zones - 600 NAU units • 5,000 instances (each with an IPv4 address and IPv6 address) in one subnet and 5,000 instances (each with an IPv4 address and IPv6 address) in another subnet - 20,000 units • 100 Lambda functions - 600 NAU units • Total NAU count per VPC: 21,200 units • Default NAU quota per VPC: 64,000 units Share your VPC subnets with other accounts VPC subnet sharing allows multiple AWS accounts to create their application resources, such as Amazon EC2 instances, Amazon Relational Database Service (RDS) databases, Amazon Redshift clusters, and AWS Lambda functions, into shared, centrally-managed virtual private clouds (VPCs). In this model, the account that owns the VPC (owner) shares one or more subnets with other accounts (participants) that belong to the same organization from AWS Organizations. After a subnet is shared, the participants can view, create, modify, and delete their application resources in the subnets shared with them. Participants cannot view, modify, or delete resources that belong to other participants or the VPC owner. You can share your VPC subnets to leverage the implicit routing within a VPC for applications that require a high degree of interconnectivity and are within the same trust boundaries. This reduces the number of VPCs that you create and manage, while using separate accounts for billing and access control. You can simplify network topologies by interconnecting shared Amazon VPC subnets using connectivity features, such as AWS PrivateLink, transit gateways, and VPC peering. For more information about the benefits of VPC subnet sharing, see VPC sharing: A new approach to multiple accounts and VPC management. Share a VPC subnet 127 Amazon Virtual Private Cloud User Guide There are quotas related to VPC subnet sharing. For more information, see VPC subnet sharing. Contents • Shared subnet prerequisites • Working with shared subnets • Billing and metering for owner and participants • Responsibilities and permissions for owners and participants • AWS resources and shared VPC subnets Shared subnet prerequisites This section contains prerequisites for working with shared subnets: • The accounts for the VPC owner and participant must be managed by AWS Organizations. • You must enable resource sharing in the AWS RAM console from the management account for your organization. For more information, see Enable resource sharing within AWS Organizations in the AWS RAM User Guide. • You must create a resource share. You can specify the subnets to share when you create the resource share, or add the subnets to the resource share later on using the procedure in the next section. For more information, see Create a resource share in the AWS RAM User Guide. Working with shared subnets This section describes how to work with shared subnets in the AWS console and AWS CLI. Contents • Share a subnet • Unshare a shared subnet • Identify the owner of a shared subnet Share a subnet You can share non-default subnets with other accounts within your organization as follows. In addition, you can share security groups across AWS Organizations. For more information, see Share security groups |
vpc-ug-050 | vpc-ug.pdf | 50 | the subnets to the resource share later on using the procedure in the next section. For more information, see Create a resource share in the AWS RAM User Guide. Working with shared subnets This section describes how to work with shared subnets in the AWS console and AWS CLI. Contents • Share a subnet • Unshare a shared subnet • Identify the owner of a shared subnet Share a subnet You can share non-default subnets with other accounts within your organization as follows. In addition, you can share security groups across AWS Organizations. For more information, see Share security groups with AWS Organizations. Shared subnet prerequisites 128 Amazon Virtual Private Cloud User Guide To share a subnet using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. 4. In the navigation pane, choose Subnets. Select your subnet and choose Actions, Share subnet. Select your resource share and choose Share subnet. To share a subnet using the AWS CLI Use the create-resource-share and associate-resource-share commands. Map subnets across Availability Zones To ensure that resources are distributed across the Availability Zones for a Region, we independently map Availability Zones to names for each account. For example, the Availability Zone us-east-1a for your AWS account might not have the same location as us-east-1a for another AWS account. To coordinate Availability Zones across accounts for VPC sharing, you must use an AZ ID, which is a unique and consistent identifier for an Availability Zone. For example, use1-az1 is the AZ ID for one of the Availability Zones in the us-east-1 Region. Use AZ IDs to determine the location of resources in one account relative to another account. You can view the AZ ID for each subnet in the Amazon VPC console. The following diagram illustrates two accounts with different mappings of Availability Zone code to AZ ID. Working with shared subnets 129 Amazon Virtual Private Cloud User Guide Unshare a shared subnet The owner can unshare a shared subnet with participants at any time. After the owner unshares a shared subnet, the following rules apply: • Existing participant resources continue to run in the unshared subnet. AWS managed services (for example, Elastic Load Balancing) that have automated/managed workflows (such as auto scaling or node replacement) may require continuous access to the shared subnet for some resources. • Participants can no longer create new resources in the unshared subnet. • Participants can modify, describe, and delete their resources that are in the subnet. • If participants still have resources in the unshared subnet, the owner cannot delete the shared subnet or the shared-subnet VPC. The owner can only delete the subnet or shared-subnet VPC after the participants delete all the resources in the unshared subnet. To unshare a subnet using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. In the navigation pane, choose Subnets. Select your subnet and choose Actions, Share subnet. 4. Choose Actions, Stop sharing. Working with shared subnets 130 Amazon Virtual Private Cloud User Guide To unshare a subnet using the AWS CLI Use the disassociate-resource-share command. Identify the owner of a shared subnet Participants can view the subnets that have been shared with them by using the Amazon VPC console, or the command line tool. To identify a subnet owner using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. In the navigation pane, choose Subnets. The Owner column displays the subnet owner. To identify a subnet owner using the AWS CLI Use the describe-subnets and describe-vpcs commands, which include the ID of the owner in their output. Billing and metering for owner and participants This section contains billing and metering details for those who own the shared subnet and for those working with the shared subnet: • In a shared VPC, each participant pays for their application resources including Amazon EC2 instances, Amazon Relational Database Service databases, Amazon Redshift clusters, and AWS Lambda functions. Participants also pay for data transfer charges associated with inter- Availability Zone data transfer as well as data transfer over VPC peering connections, across internet gateways, and across AWS Direct Connect gateways. • VPC owners pay hourly charges (where applicable), data processing and data transfer charges across NAT gateways, virtual private gateways, transit gateways, AWS PrivateLink, and VPC endpoints. In addition, public IPv4 addresses used in shared VPCs are billed to VPC owners. For more information about public IPv4 address pricing, see the Public IPv4 Address tab on the Amazon VPC pricing page. • Data transfer within the same Availability Zone (uniquely identified using the AZ-ID) is free irrespective of account ownership of the communicating resources. Billing and metering for owner and participants 131 Amazon Virtual Private Cloud User Guide Responsibilities and permissions for owners and participants This section includes details about the responsibilities and permissions for |
vpc-ug-051 | vpc-ug.pdf | 51 | NAT gateways, virtual private gateways, transit gateways, AWS PrivateLink, and VPC endpoints. In addition, public IPv4 addresses used in shared VPCs are billed to VPC owners. For more information about public IPv4 address pricing, see the Public IPv4 Address tab on the Amazon VPC pricing page. • Data transfer within the same Availability Zone (uniquely identified using the AZ-ID) is free irrespective of account ownership of the communicating resources. Billing and metering for owner and participants 131 Amazon Virtual Private Cloud User Guide Responsibilities and permissions for owners and participants This section includes details about the responsibilities and permissions for those who own the shared subnet (owner) and for those who are using the shared subnet (participant). Owner resources Owners are responsible for the VPC resources that they own. VPC owners are responsible for creating, managing, and deleting the resources associated with a shared VPC. These include subnets, route tables, network ACLs, peering connections, gateway endpoints, interface endpoints, Amazon Route 53 Resolver endpoints, internet gateways, NAT gateways, virtual private gateways, and transit gateway attachments. Participant resources Participants are responsible for the VPC resources that they own. Participants can create a limited set of VPC resources in a shared VPC. For example, participants can create network interfaces and security groups, and enable VPC flow logs for the network interfaces that they own. The VPC resources that a participant creates count against the VPC quotas in the participant account, not the owner account. For more information, see VPC subnet sharing. VPC resources The following responsibilities and permissions apply to VPC resources when working with shared VPC subnets: Flow logs • Participants can create, delete, and describe flow logs for network interfaces that they own in a shared VPC subnet. • Participants cannot create, delete, or describe flow logs for network interfaces that they do not own in a shared VPC subnet. • Participants cannot create, delete, or describe flow logs for a shared VPC subnet. • VPC owners can create, delete, and describe flow logs for network interfaces that they do not own in a shared VPC subnet. • VPC owners can create, delete, and describe flow logs for a shared VPC subnet. • VPC owners cannot describe or delete flow logs created by a participant. Responsibilities and permissions for owners and participants 132 Amazon Virtual Private Cloud User Guide Internet gateways and egress-only internet gateways • Participants cannot create, attach, or delete internet gateways and egress-only internet gateways in a shared VPC subnet. Participants can describe internet gateways in a shared VPC subnet. Participants cannot describe egress-only internet gateways in a shared VPC subnet. NAT gateways • Participants cannot create, delete, or describe NAT gateways in a shared VPC subnet. Network access control lists (NACLs) • Participants cannot create, delete, or replace NACLs in a shared VPC subnet. Participants can describe NACLs created by VPC owners in a shared VPC subnet. Network interfaces • Participants can create network interfaces in a shared VPC subnet. Participants cannot work with network interfaces created by VPC owners in a shared VPC subnet in any other way, such as attaching, detaching, or modifying the network interfaces. Participants can modify or delete the network interfaces in a shared VPC that they created. For example, participants can associate or disassociate IP addresses with the network interfaces that they created. • VPC owners can describe network interfaces owned by participants in a shared VPC subnet. VPC owners cannot work with network interfaces owned by participants in any other way, such as attaching, detaching, or modifying the network interfaces owned by participants in a shared VPC subnet. Route tables • Participants cannot work with route tables (for example, create, delete, or associate route tables) in a shared VPC subnet. Participants can describe route tables in a shared VPC subnet. Security groups • Participants can work with (create, delete, describe, modify, or create ingress and egress rules for) security groups that they own in a shared VPC subnet. Participants can work with security groups created by VPC owners if the VPC owner shares the security group with the participant. Responsibilities and permissions for owners and participants 133 Amazon Virtual Private Cloud User Guide • Participants can create rules in the security groups that they own that reference security groups that belong to other participants or the VPC owner as follows: account-number/security-group- id • Participants can't launch instances using the default security group for the VPC because it belongs to the owner. • Participants can't launch instances using non-default security groups that are owned by the VPC owner or other participants unless the security group is shared with them. • VPC owners can describe the security groups created by participants in a shared VPC subnet. VPC owners cannot work with security groups created by participants in any other way. For example, |
vpc-ug-052 | vpc-ug.pdf | 52 | security groups that they own that reference security groups that belong to other participants or the VPC owner as follows: account-number/security-group- id • Participants can't launch instances using the default security group for the VPC because it belongs to the owner. • Participants can't launch instances using non-default security groups that are owned by the VPC owner or other participants unless the security group is shared with them. • VPC owners can describe the security groups created by participants in a shared VPC subnet. VPC owners cannot work with security groups created by participants in any other way. For example, VPC owners can't launch instances using security groups created by participants. Subnets • Participants cannot modify shared subnets or their related attributes. Only the VPC owner can. Participants can describe subnets in a shared VPC subnet. • VPC owners can share subnets only with other accounts or organizational units that are in the same organization from AWS Organizations. VPC owners can't share subnets that are in a default VPC. Transit gateways • Only the VPC owner can attach a transit gateway to a shared VPC subnet. Participants can't. VPCs • Participants cannot modify VPCs or their related attributes. Only the VPC owner can. Participants can describe VPCs, their attibutes, and the DHCP option sets. • VPC tags and tags for the resources within the shared VPC are not shared with the participants. • Participants can associate their own security groups with a shared VPC. This allows the participant to use the security group with Elastic network interfaces they own in the shared VPC. AWS resources and shared VPC subnets The AWS services listed in this section support resources in shared VPC subnets. AWS resources and shared VPC subnets 134 Amazon Virtual Private Cloud User Guide For more information about how the service supports shared VPC subnets, follow the links to the corresponding service documentation. • Amazon Aurora • AWS CodeBuild • AWS Database Migration Service • Amazon EC2 • Amazon ECS • Amazon ElastiCache (Redis OSS) • Amazon EFS • Amazon Elastic Kubernetes Service • Elastic Load Balancing • Application Load Balancers • Gateway Load Balancers • Network Load Balancers • Amazon EMR • AWS Glue • AWS Lambda • Amazon MQ running Apache MQ (not Rabbit MQ) • Amazon MSK • AWS Network Manager • AWS Cloud WAN • Network Access Analyzer • Reachability Analyzer • Amazon OpenSearch Service • AWS PrivateLink† • Amazon Relational Database Service (RDS) • Amazon Redshift • Amazon Route 53 • AWS Transit Gateway • AWS Verified Access AWS resources and shared VPC subnets 135 Amazon Virtual Private Cloud • Amazon VPC • Peering • Traffic Mirroring • Amazon VPC Lattice User Guide † You can connect to all AWS services that support PrivateLink using a VPC endpoint in a shared VPC. For a list of services that support PrivateLink, see AWS services that integrate with AWS PrivateLink in the AWS PrivateLink Guide. The list in this section is our best effort to document which services support launching resources in shared VPC subnets. There may be other services not listed here that support launching resources in shared VPC subnets. We encourage you to submit feedback if you have questions about resources not on this list. Extend a VPC to a Local Zone, Wavelength Zone, or Outpost You can host VPC resources, such as subnets, in multiple locations world-wide. These locations are composed of Regions, Availability Zones, Local Zones, and Wavelength Zones. Each Region is a separate geographic area. • Availability Zones are multiple, isolated locations within each Region. • Local Zones allow you to place resources, such as compute and storage, in multiple locations closer to your end users. • AWS Outposts brings native AWS services, infrastructure, and operating models to virtually any data center, co-location space, or on-premises facility. • Wavelength Zones allow developers to build applications that deliver ultra-low latencies to 5G devices and end users. Wavelength deploys standard AWS compute and storage services to the edge of telecommunication carriers' 5G networks. AWS operates state-of-the-art, highly available data centers. Although rare, failures can occur that affect the availability of instances that are in the same location. If you host all of your instances in a single location that is affected by a failure, none of your instances would be available. Extend a VPC to other Zones 136 Amazon Virtual Private Cloud User Guide Subnets in AWS Local Zones AWS Local Zones allow you to place resources closer to your users, and seamlessly connect to the full range of services in the AWS Region, using familiar APIs and tool sets. When you create a subnet in a Local Zone, you extend the VPC to that Local Zone. To use a Local Zone, you use the following process: • Opt in to the Local |
vpc-ug-053 | vpc-ug.pdf | 53 | instances in a single location that is affected by a failure, none of your instances would be available. Extend a VPC to other Zones 136 Amazon Virtual Private Cloud User Guide Subnets in AWS Local Zones AWS Local Zones allow you to place resources closer to your users, and seamlessly connect to the full range of services in the AWS Region, using familiar APIs and tool sets. When you create a subnet in a Local Zone, you extend the VPC to that Local Zone. To use a Local Zone, you use the following process: • Opt in to the Local Zone. • Create a subnet in the Local Zone. • Launch resources in the Local Zone subnet, so that your applications are closer to your users. The following diagram illustrates a VPC in the US West (Oregon) (us-west-2) Region that spans Availability Zones and a Local Zone. When you create a VPC, you can choose to assign a set of Amazon-provided public IP addresses to the VPC. You can also set a network border group for the addresses that limits the addresses to the group. When you set a network border group, the IP addresses can't move between network border groups. Local Zone network traffic will go directly to the internet or to points-of-presence (PoPs) without traversing the Local Zone's parent Region, enabling access to low-latency computing. For the complete list of Local Zones and their corresponding parent Regions, see Available Local Zones in the AWS Local Zones User Guide. The following rules apply to Local Zones: Subnets in AWS Local Zones 137 Amazon Virtual Private Cloud User Guide • The Local Zone subnets follow the same routing rules as Availability Zone subnets, including route tables, security groups, and network ACLs. • Outbound internet traffic leaves a Local Zone from the Local Zone. • You must provision public IP addresses for use in a Local Zone. When you allocate addresses, you can specify the location from which the IP address is advertised. We refer to this as a network border group, and you can set this parameter to limit the addresses to this location. After you provision the IP addresses, you cannot move them between the Local Zone and the parent Region (for example, from us-west-2-lax-1a to us-west-2). • If the Local Zone supports IPv6, you can request IPv6 Amazon-provided IP addresses and associate them with the network border group for a new or existing VPC. For the list of Local Zones that support IPv6, see Considerations in the AWS Local Zones User Guide • You can't create VPC endpoints in Local Zone subnets. For more information about working with Local Zones, see the AWS Local Zones User Guide. Considerations for internet gateways Take the following information into account when you use internet gateways (in the parent Region) in Local Zones: • You can use internet gateways in Local Zones with Elastic IP addresses or Amazon auto-assigned public IP addresses. The Elastic IP addresses that you associate must include the network border group of the Local Zone. For more information, see the section called “Elastic IP addresses”. You cannot associate an Elastic IP address that is set for the Region. • Elastic IP addresses that are used in Local Zones have the same quotas as Elastic IP addresses in a Region. For more information, see the section called “Elastic IP addresses”. • You can use internet gateways in route tables that are associated with Local Zone resources. For more information, see the section called “Routing to an internet gateway”. Access Local Zones using a Direct Connect gateway Consider the scenario where you want an on-premises data center to access resources that are in a Local Zone. You use a virtual private gateway for the VPC that's associated with the Local Zone to connect to a Direct Connect gateway. The Direct Connect gateway connects to an AWS Direct Subnets in AWS Local Zones 138 Amazon Virtual Private Cloud User Guide Connect location in a Region. The on-premises data center has an AWS Direct Connect connection to the AWS Direct Connect location. Note Traffic that is destined for a subnet in a Local Zone using Direct Connect does not travel through the parent Region of the Local Zone. Instead, traffic takes the shortest path to the Local Zone. This decreases latency and helps make your applications more responsive. You configure the following resources for this configuration: • A virtual private gateway for the VPC that is associated with the Local Zone subnet. You can view the VPC for the subnet on the subnet details page in the Amazon Virtual Private Cloud Console, or use the describe-subnets command. For information about creating a virtual private gateway, see Create a target gateway in the AWS Site-to-Site VPN User Guide. • A Direct Connect connection. |
vpc-ug-054 | vpc-ug.pdf | 54 | parent Region of the Local Zone. Instead, traffic takes the shortest path to the Local Zone. This decreases latency and helps make your applications more responsive. You configure the following resources for this configuration: • A virtual private gateway for the VPC that is associated with the Local Zone subnet. You can view the VPC for the subnet on the subnet details page in the Amazon Virtual Private Cloud Console, or use the describe-subnets command. For information about creating a virtual private gateway, see Create a target gateway in the AWS Site-to-Site VPN User Guide. • A Direct Connect connection. For the best latency performance, AWS recommends that you use the Direct Connect location closest to the Local Zone to which you'll be extending your subnet. For information about ordering a connection, see Cross connects in the AWS Direct Connect User Guide. • A Direct Connect gateway. For information about creating a Direct Connect gateway, see Create a Direct Connect gateway in the AWS Direct Connect User Guide. • A virtual private gateway association to connect the VPC to the Direct Connect gateway. For information about creating a virtual private gateway association, see Associating and disassociating virtual private gateways in the AWS Direct Connect User Guide. • A private virtual interface on the connection from the AWS Direct Connect location to the on- premises data center. For information about creating a Direct Connect gateway, see Creating a private virtual interface to the Direct Connect gateway in the AWS Direct Connect User Guide. Connect Local Zone subnets to a transit gateway You can't create a transit gateway attachment for a subnet in a Local Zone. The following diagram shows how to configure your network so that subnets in the Local Zone connect to a transit gateway through the parent Availability Zone. Create subnets in the Local Zones and subnets in Subnets in AWS Local Zones 139 Amazon Virtual Private Cloud User Guide the parent Availability Zones. Connect the subnets in the parent Availability Zones to the transit gateway, and then create a route in the route table for each VPC that routes traffic destined for the other VPC CIDR to the network interface for the transit gateway attachment. Note Traffic destined for a subnet in a Local Zone that originates from a transit gateway will first traverse the parent Region. Create the following resources for this scenario: • A subnet in each parent Availability Zone. For more information, see the section called “Create a subnet”. • A transit gateway. For more information, see Create a transit gateway in Amazon VPC Transit Gateways. • A transit gateway attachment for each VPC using the parent Availability Zone. For more information, see Create a transit gateway attachment to a VPC in Amazon VPC Transit Gateways. • A transit gateway route table associated with the transit gateway attachment. For more information, see Transit gateway route tables in Amazon VPC Transit Gateways. Subnets in AWS Local Zones 140 Amazon Virtual Private Cloud User Guide • For each VPC, an entry in the subnet route tables of the Local Zone subnets that have the other VPC CIDR as the destination, and the ID of the network interface for the transit gateway attachment as the target. To find the network interface for the transit gateway attachment, search the descriptions of your network interfaces for the ID of the transit gateway attachment. For more information, see the section called “Routing for a transit gateway”. The following is an example route table for VPC 1. Destination VPC 1 CIDR VPC 2 CIDR The following is an example route table for VPC 2. Destination VPC 2 CIDR VPC 1 CIDR Target local vpc1-attachment-network-int erface-id Target local vpc2-attachment-network-int erface-id The following is an example of the transit gateway route table. The CIDR blocks for each VPC propagate to the transit gateway route table. CIDR Attachment Route type VPC 1 CIDR Attachment for VPC 1 propagated VPC 2 CIDR Attachment for VPC 2 propagated Subnets in AWS Local Zones 141 Amazon Virtual Private Cloud User Guide Subnets in AWS Wavelength AWS Wavelength allows developers to build applications that deliver ultra-low latencies to mobile devices and end-users. Wavelength deploys standard AWS compute and storage services to the edge of telecommunication carriers' 5G networks. Developers can extend a virtual private cloud (VPC) to one or more Wavelength Zones, and then use AWS resources like Amazon EC2 instances to run applications that require ultra-low latency and connect to AWS services in the Region. To use a Wavelength Zones, you must first opt in to the Zone. Next, create a subnet in the Wavelength Zone. You can create Amazon EC2 instances, Amazon EBS volumes, and Amazon VPC subnets and carrier gateways in Wavelength Zones. You can also use services that orchestrate or work with EC2, EBS, and |
vpc-ug-055 | vpc-ug.pdf | 55 | services to the edge of telecommunication carriers' 5G networks. Developers can extend a virtual private cloud (VPC) to one or more Wavelength Zones, and then use AWS resources like Amazon EC2 instances to run applications that require ultra-low latency and connect to AWS services in the Region. To use a Wavelength Zones, you must first opt in to the Zone. Next, create a subnet in the Wavelength Zone. You can create Amazon EC2 instances, Amazon EBS volumes, and Amazon VPC subnets and carrier gateways in Wavelength Zones. You can also use services that orchestrate or work with EC2, EBS, and VPC, such as Amazon EC2 Auto Scaling, Amazon EKS clusters, Amazon ECS clusters, Amazon EC2 Systems Manager, Amazon CloudWatch, AWS CloudTrail, and AWS CloudFormation. The services in Wavelength are part of a VPC that is connected over a reliable, high bandwidth connection to an AWS Region for easy access to services including Amazon DynamoDB and Amazon RDS. The following rules apply to Wavelength Zones: • A VPC extends to a Wavelength Zone when you create a subnet in the VPC and associate it with the Wavelength Zone. • By default, every subnet that you create in a VPC that spans a Wavelength Zone inherits the main VPC route table, including the local route. • When you launch an EC2 instance in a subnet in a Wavelength Zone, you assign a carrier IP address to it. The carrier gateway uses the address for traffic from the interface to the internet, or mobile devices. The carrier gateway uses NAT to translate the address, and then sends the traffic to the destination. Traffic from the telecommunication carrier network routes through the carrier gateway. • You can set the target of a VPC route table, or subnet route table in a Wavelength Zone to a carrier gateway, which allows inbound traffic from a carrier network in a specific location, and outbound traffic to the carrier network and internet. For more information about routing options in a Wavelength Zone, see Routing in the AWS Wavelength Developer Guide. • Subnets in Wavelength Zones have the same networking components as subnets in Availability Zones, including IPv4 addresses, DHCP option sets, and network ACLs. • You can't create a transit gateway attachment to a subnet in a Wavelength Zone. Instead, create the attachment through a subnet in the parent Availability Zone, and then route traffic to the desired destinations through the transit gateway. For an example, see the next section. Subnets in AWS Wavelength 142 Amazon Virtual Private Cloud User Guide Considerations for multiple Wavelength Zones EC2 instances that are in different Wavelength Zones in the same VPC are not allowed to communicate with each other. If you need Wavelength Zone to Wavelength Zone communication, AWS recommends that you use multiple VPCs, one for each Wavelength Zone. You can use a transit gateway to connect the VPCs. This configuration enables communication between instances in the Wavelength Zones. Wavelength Zone to Wavelength Zone traffic routes through the AWS Region. For more information, see AWS Transit Gateway. The following diagram shows how to configure your network so that instances in two different Wavelength Zones can communicate. You have two Wavelength Zones (Wavelength Zone A and Wavelength Zone B). You need to create the following resources to enable communication: • For each Wavelength Zone, a subnet in an Availability Zone that is the parent Availability Zone for the Wavelength Zone. In the example, you create subnet 1 and subnet 2. For information about creating subnets, see the section called “Create a subnet”. Use the describe-availability- zones command to find the parent zone. • A transit gateway. The transit gateway connects the VPCs. For information about creating a transit gateway, see Create a transit gateway in the Amazon VPC Transit Gateways Guide. • For each VPC, a VPC attachment to the transit gateway in the parent Availability Zone of the Wavelength Zone. For more information, see Transit gateway attachments to a VPC in the Amazon VPC Transit Gateways Guide. • Entries for each VPC in the transit gateway route table. For information about creating transit gateway routes, see Transit gateway route tables in the Amazon VPC Transit Gateways Guide. • For each VPC, an entry in the VPC route table that has the other VPC CIDR as the destination, and the transit gateway ID as the target. For more information, see the section called “Routing for a transit gateway”. In the example, the route table for VPC 1 has the following entry: Destination 10.1.0.0/24 Target tgw-22222222222222222 Subnets in AWS Wavelength 143 Amazon Virtual Private Cloud User Guide The route table for VPC 2 has the following entry: Destination 10.0.0.0/24 Target tgw-22222222222222222 Subnets in AWS Outposts AWS Outposts offers you the same AWS hardware infrastructure, services, APIs, and tools to build and run |
vpc-ug-056 | vpc-ug.pdf | 56 | VPC, an entry in the VPC route table that has the other VPC CIDR as the destination, and the transit gateway ID as the target. For more information, see the section called “Routing for a transit gateway”. In the example, the route table for VPC 1 has the following entry: Destination 10.1.0.0/24 Target tgw-22222222222222222 Subnets in AWS Wavelength 143 Amazon Virtual Private Cloud User Guide The route table for VPC 2 has the following entry: Destination 10.0.0.0/24 Target tgw-22222222222222222 Subnets in AWS Outposts AWS Outposts offers you the same AWS hardware infrastructure, services, APIs, and tools to build and run your applications on premises and in the cloud. AWS Outposts is ideal for workloads that need low latency access to on-premises applications or systems, and for workloads that need to store and process data locally. For more information about AWS Outposts, see AWS Outposts. Subnets in AWS Outposts 144 Amazon Virtual Private Cloud User Guide A VPC spans all Availability Zones in an AWS Region. After you connect your Outpost to its parent Region, you can extend any VPC in the Region to your Outpost by creating a subnet for the Outpost in that VPC. The following rules apply to AWS Outposts: • The subnets must reside in one Outpost location. • You create a subnet for an Outpost by specifying the Amazon Resource Name (ARN) of the Outpost when you create the subnet. • Outposts rack - A local gateway handles the network connectivity between your VPC and on- premises networks. For more information, see Local gateways in the AWS Outposts User Guide for Outposts rack. • Outposts servers - A local network interface handles the network connectivity between your VPC and on-premises networks. For more information, see Local network interfaces in the AWS Outposts User Guide for Outposts servers. • By default, every subnet that you create in a VPC, including subnets for your Outposts, is implicitly associated with the main route table for the VPC. Alternatively, you can explicitly associate a custom route table with the subnets in your VPC and have a local gateway as a next- hop target for all traffic destined for your on-premises network. Subnets in AWS Outposts 145 Amazon Virtual Private Cloud Delete your VPC When you are finished with a VPC, you can delete it. Requirement User Guide Before you can delete a VPC, you must first terminate or delete any resources that created a requester-managed network interface in the VPC. For example, you must terminate your EC2 instances and delete your load balancers, NAT gateways, transit gateway VPC attachments, and interface VPC endpoints. Note If you have created a flow log for the VPC you are deleting, note that flow logs for deleted VPCs are eventually automatically removed. Contents • Delete a VPC using the console • Delete a VPC using the command line Delete a VPC using the console If you delete a VPC using the Amazon VPC console, we also delete the following VPC components for you: • DHCP options • Egress-only internet gateways • Gateway endpoints • Internet gateways • Network ACLs • Route tables • Security groups • Subnets Delete your VPC 146 Amazon Virtual Private Cloud User Guide To delete your VPC using the console 1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/. 2. Terminate all instances in the VPC. For more information, see Terminate Your Instance in the Amazon EC2 User Guide. 3. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 4. 5. 6. In the navigation pane, choose Your VPCs. Select the VPC to delete and choose Actions, Delete VPC. If there are resources that you must delete or terminate before we can delete the VPC, we display them. Delete or terminate these resources and then try again. Otherwise, we display the resources that we will delete in addition to the VPC. Review the list and then proceed to the next step. 7. (Optional) If you have a Site-to-Site VPN connection, you can select the option to delete it. If you plan to use the customer gateway with another VPC, we recommend that you keep the Site-to-Site VPN connection and the gateways. Otherwise, you must configure your customer gateway device again after you create a new Site-to-Site VPN connection. 8. When prompted for confirmation, enter delete and then choose Delete. Delete a VPC using the command line Before you can delete a VPC using the command line, you must terminate or delete any resources that created a requester-managed network interface in the VPC. You must also delete or detach all VPC resources that you created, such as subnets, security groups, network ACLs, route tables, internet gateways, and egress-only internet gateways. You do not need to delete the default security group, default route table, or default network ACL. The following procedure demonstrates the commands that |
vpc-ug-057 | vpc-ug.pdf | 57 | a new Site-to-Site VPN connection. 8. When prompted for confirmation, enter delete and then choose Delete. Delete a VPC using the command line Before you can delete a VPC using the command line, you must terminate or delete any resources that created a requester-managed network interface in the VPC. You must also delete or detach all VPC resources that you created, such as subnets, security groups, network ACLs, route tables, internet gateways, and egress-only internet gateways. You do not need to delete the default security group, default route table, or default network ACL. The following procedure demonstrates the commands that you use to delete common VPC resources and then to delete your VPC. You must use these commands in this order. If you created additional VPC resources, you'll also need to use their corresponding delete command before you can delete the VPC. To delete a VPC by using the AWS CLI 1. Delete your security group by using the delete-security-group command. aws ec2 delete-security-group --group-id sg-id Delete using the CLI 147 Amazon Virtual Private Cloud User Guide 2. Delete each network ACL by using the delete-network-acl command. aws ec2 delete-network-acl --network-acl-id acl-id 3. Delete each subnet by using the delete-subnet command. aws ec2 delete-subnet --subnet-id subnet-id 4. Delete each custom route table by using the delete-route-table command. aws ec2 delete-route-table --route-table-id rtb-id 5. Detach your internet gateway from your VPC by using the detach-internet-gateway command. aws ec2 detach-internet-gateway --internet-gateway-id igw-id --vpc-id vpc-id 6. Delete your internet gateway by using the delete-internet-gateway command. aws ec2 delete-internet-gateway --internet-gateway-id igw-id 7. [Dual stack VPC] Delete your egress-only internet gateway by using the delete-egress-only- internet-gateway command. aws ec2 delete-egress-only-internet-gateway --egress-only-internet-gateway-id eigw- id 8. Delete your VPC by using the delete-vpc command. aws ec2 delete-vpc --vpc-id vpc-id Generate infrastructure-as-code from your VPC console actions with Console-to-Code The console provides a guided path for creating resources and testing prototypes. If you want to create the same resources at scale, you’ll need automation code. Console-to-Code is a feature of Amazon Q Developer that can help you get started with your automation code. Console-to-Code records your console actions, including default values and compatible parameters. It then uses generative AI to suggest code in your preferred infrastructure-as-code (IaC) format for the actions Generate IaC from console actions 148 Amazon Virtual Private Cloud User Guide you want. Because the console workflow makes sure the parameter values that you specify are valid together, the code that you generate by using Console-to-Code has compatible parameter values. You can use the code as a starting point, and then customize it to make it production-ready for your specific use case. For example, with Console-to-Code you can record yourself using the VPC console to create subnets, security groups, NACLs, a custom routing table, and an internet gateway and generate code in AWS CloudFormation JSON format. Then, you can copy that code and customize it for use in your AWS CloudFormation template. Console-to-Code can currently generate infrastructure-as-code (IaC) in the following languages and formats: • CDK Java • CDK Python • CDK TypeScript • CloudFormation JSON • CloudFormation YAML For more information and instructions on how to use Console-to-Code, see Automating AWS services with Amazon Q Developer Console-to-Code in the Amazon Q Developer User Guide. Generate IaC from console actions 149 Amazon Virtual Private Cloud User Guide Subnets for your VPC A subnet is a range of IP addresses in your VPC. You can create AWS resources, such as EC2 instances, in specific subnets. Contents • Subnet basics • Subnet security • Create a subnet • Add or remove an IPv6 CIDR block from your subnet • Modify the IP addressing attributes of your subnet • Subnet CIDR reservations • Configure route tables • Middlebox routing wizard • Delete a subnet Subnet basics Each subnet must reside entirely within one Availability Zone and cannot span zones. By launching AWS resources in separate Availability Zones, you can protect your applications from the failure of a single Availability Zone. Contents • Subnet IP address range • Subnet types • Subnet diagram • Subnet routing • Subnet settings Subnet IP address range When you create a subnet, you specify its IP addresses, depending on the configuration of the VPC: Subnet basics 150 Amazon Virtual Private Cloud User Guide • IPv4 only – The subnet has an IPv4 CIDR block but does not have an IPv6 CIDR block. Resources in an IPv4-only subnet must communicate over IPv4. • Dual stack – The subnet has both an IPv4 CIDR block and an IPv6 CIDR block. The VPC must have both an IPv4 CIDR block and an IPv6 CIDR block. Resources in a dual-stack subnet can communicate over IPv4 and IPv6. • IPv6 only – The subnet has an IPv6 CIDR block but does not have an IPv4 CIDR block. The VPC |
vpc-ug-058 | vpc-ug.pdf | 58 | Subnet basics 150 Amazon Virtual Private Cloud User Guide • IPv4 only – The subnet has an IPv4 CIDR block but does not have an IPv6 CIDR block. Resources in an IPv4-only subnet must communicate over IPv4. • Dual stack – The subnet has both an IPv4 CIDR block and an IPv6 CIDR block. The VPC must have both an IPv4 CIDR block and an IPv6 CIDR block. Resources in a dual-stack subnet can communicate over IPv4 and IPv6. • IPv6 only – The subnet has an IPv6 CIDR block but does not have an IPv4 CIDR block. The VPC must have an IPv6 CIDR block. Resources in an IPv6-only subnet must communicate over IPv6. Note Resources in IPv6-only subnets are assigned IPv4 link-local addresses from CIDR block 169.254.0.0/16. These addresses are used to communicate with services that are available only in the VPC. For examples, see Link-local addresses in the Amazon EC2 User Guide. For more information, see IP addressing for your VPCs and subnets. Subnet types The subnet type is determined by how you configure routing for your subnets. For example: • Public subnet – The subnet has a direct route to an internet gateway. Resources in a public subnet can access the public internet. • Private subnet – The subnet does not have a direct route to an internet gateway. Resources in a private subnet require a NAT device to access the public internet. • VPN-only subnet – The subnet has a route to a Site-to-Site VPN connection through a virtual private gateway. The subnet does not have a route to an internet gateway. • Isolated subnet – The subnet has no routes to destinations outside its VPC. Resources in an isolated subnet can only access or be accessed by other resources in the same VPC. Subnet diagram The following diagram shows a VPC with subnets in two Availability Zones and an internet gateway. Each Availability Zone has a public subnet and a private subnet. Subnet types 151 Amazon Virtual Private Cloud User Guide For diagrams that show subnets in Local Zones and Wavelength Zones, see How AWS Local Zones work and How AWS Wavelength works. Subnet routing Each subnet must be associated with a route table, which specifies the allowed routes for outbound traffic leaving the subnet. Every subnet that you create is automatically associated with the main route table for the VPC. You can change the association, and you can change the contents of the main route table. For more information, see Configure route tables. Subnet settings All subnets have a modifiable attribute that determines whether a network interface created in that subnet is assigned a public IPv4 address and, if applicable, an IPv6 address. This includes the primary network interface (for example, eth0) that's created for an instance when you launch an instance in that subnet. Regardless of the subnet attribute, you can still override this setting for a specific instance during launch. After you create a subnet, you can modify the following settings for the subnet: Subnet routing 152 Amazon Virtual Private Cloud User Guide • Auto-assign IP settings: Enables you to configure the auto-assign IP settings to automatically request a public IPv4 or IPv6 address for a new network interface in this subnet. • Resource-based Name (RBN) settings: Enables you to specify the hostname type for EC2 instances in this subnet and configure how DNS A and AAAA record queries are handled. For more information, see Amazon EC2 instance hostname types in the Amazon EC2 User Guide. Subnet security To protect your AWS resources, we recommend that you use private subnets. Use a bastion host or NAT device to provide internet access to resources, such as EC2 instances, in a private subnet. AWS provides features that you can use to increase security for the resources in your VPC. Security groups allow inbound and outbound traffic for associated resources, such as EC2 instances. Network ACLs allow or deny inbound and outbound traffic at the subnet level. In most cases, security groups can meet your needs. However, you can use network ACLs if you want an additional layer of security. For more information, see the section called “Compare security groups and network ACLs”. By design, each subnet must be associated with a network ACL. Every subnet that you create is automatically associated with the default network ACL for the VPC. The default network ACL allows all inbound and outbound traffic. You can update the default network ACL, or create custom network ACLs and associate them with your subnets. For more information, see Control subnet traffic with network access control lists. You can create a flow log on your VPC or subnet to capture the traffic that flows to and from the network interfaces in your VPC or subnet. You can also create a flow |
vpc-ug-059 | vpc-ug.pdf | 59 | design, each subnet must be associated with a network ACL. Every subnet that you create is automatically associated with the default network ACL for the VPC. The default network ACL allows all inbound and outbound traffic. You can update the default network ACL, or create custom network ACLs and associate them with your subnets. For more information, see Control subnet traffic with network access control lists. You can create a flow log on your VPC or subnet to capture the traffic that flows to and from the network interfaces in your VPC or subnet. You can also create a flow log on an individual network interface. For more information, see Logging IP traffic using VPC Flow Logs. Create a subnet Use the following procedure to create subnets for your virtual private cloud (VPC). Depending on the connectivity that you need, you might also need to add gateways and route tables. Considerations • You must specify an IPv4 CIDR block for the subnet from the range of your VPC. You can optionally specify an IPv6 CIDR block for a subnet if there is an IPv6 CIDR block associated with the VPC. For more information, see IP addressing for your VPCs and subnets. Subnet security 153 Amazon Virtual Private Cloud User Guide • If you create an IPv6-only subnet, be aware of the following. An EC2 instance launched in an IPv6-only subnet receives an IPv6 address but not an IPv4 address. Any instances that you launch into an IPv6-only subnet must be instances built on the Nitro System. • To create the subnet in a Local Zone or a Wavelength Zone, you must enable the Zone. For more information, see Regions and Zones in the Amazon EC2 User Guide. To add a subnet to your VPC 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. In the navigation pane, choose Subnets. 3. Choose Create subnet. 4. Under VPC ID, choose the VPC for the subnet. 5. (Optional) For Subnet name, enter a name for your subnet. Doing so creates a tag with a key of Name and the value that you specify. 6. For Availability Zone, you can choose a Zone for your subnet, or leave the default No Preference to let AWS choose one for you. 7. For IPv4 CIDR block, select Manual input to enter an IPv4 CIDR block for your subnet (for example, 10.0.1.0/24) or select No IPv4 CIDR. If you are using Amazon VPC IP Address Manager (IPAM) to plan, track, and monitor IP addresses for your AWS workloads, when you create a subnet you have the option to allocate a CIDR block from IPAM (IPAM-allocated). For more information on planning VPC IP address space for subnet IP allocations, see Tutorial: Plan VPC IP address space for subnet IP allocations in the Amazon VPC IPAM User Guide. 8. For IPv6 CIDR block, select Manual input to choose the VPC's IPv6 CIDR that you want to create a subnet in. This option is available only if the VPC has an associated IPv6 CIDR block. If you are using Amazon VPC IP Address Manager (IPAM) to plan, track, and monitor IP addresses for your AWS workloads, when you create a subnet you have the option to allocate a CIDR block from IPAM (IPAM-allocated). For more information on planning VPC IP address space for subnet IP allocations, see Tutorial: Plan VPC IP address space for subnet IP allocations in the Amazon VPC IPAM User Guide. 9. Choose an IPv6 VPC CIDR block. 10. For IPv6 subnet CIDR block, choose a CIDR for the subnet that's equal to or more specific than the VPC CIDR. For example, if the VPC pool CIDR is /50, you can choose a netmask length between /50 to /64 for the subnet. Possible IPv6 netmask lengths are between /44 and /64 in increments of /4. Create a subnet 154 Amazon Virtual Private Cloud 11. Choose Create subnet. User Guide To add a subnet to your VPC using the AWS CLI Use the create-subnet command. Next steps After you create a subnet, you can configure it as follows: • Configure routing. You can then create a custom route table and route that send traffic to a gateway that's associated with the VPC, such as an internet gateway. For more information, see Configure route tables. • Modify the IP addressing behavior. You can specify whether instances launched in the subnet receive a public IPv4 address, an IPv6 address, or both. For more information, see Modify the IP addressing attributes of your subnet. • Modify the resource-based name (RBN) settings. For more information, see Amazon EC2 instance hostname types. • Create or modify your network ACLs. For more information, see Control subnet traffic with network access control lists. • Share the subnet with other accounts. For more information, see ???. |
vpc-ug-060 | vpc-ug.pdf | 60 | associated with the VPC, such as an internet gateway. For more information, see Configure route tables. • Modify the IP addressing behavior. You can specify whether instances launched in the subnet receive a public IPv4 address, an IPv6 address, or both. For more information, see Modify the IP addressing attributes of your subnet. • Modify the resource-based name (RBN) settings. For more information, see Amazon EC2 instance hostname types. • Create or modify your network ACLs. For more information, see Control subnet traffic with network access control lists. • Share the subnet with other accounts. For more information, see ???. Add or remove an IPv6 CIDR block from your subnet You can associate an IPv6 CIDR block with an existing subnet in your VPC. The subnet must not have an existing IPv6 CIDR block associated with it. If you no longer want IPv6 support in your subnet, but you want to continue to use your subnet to create and communicate with IPv4 resources, you can remove the IPv6 CIDR block. Before you can remove an IPv6 CIDR block, you must first unassign any IPv6 addresses that are assigned to any instances in your subnet. To add or remove an IPv6 CIDR block to a subnet 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. In the navigation pane, choose Subnets. Add or remove an IPv6 CIDR block from your subnet 155 Amazon Virtual Private Cloud User Guide 3. 4. Select your subnet and choose Actions, Edit IPv6 CIDRs. To add a CIDR, choose Add IPv6 CIDR, choose a VPC CIDR block, enter a Subnet CIDR block, and choose a netmask length that's equal to or more specific than the netmask length of the VPC CIDR. For example, if the VPC pool CIDR is /50, you can choose a netmask length between /50 to /64 for the subnet. Possible IPv6 netmask lengths are between /44 and /64 in increments of /4. 5. To remove a CIDR, find the IPv6 CIDR block and choose Remove. 6. Choose Save. To associate an IPv6 CIDR block with a subnet using the AWS CLI Use the associate-subnet-cidr-block command. To disassociate an IPv6 CIDR block from a subnet using the AWS CLI Use the disassociate-subnet-cidr-block command. Modify the IP addressing attributes of your subnet By default, nondefault subnets have the IPv4 public addressing attribute set to false, and default subnets have this attribute set to true. An exception is a nondefault subnet created by the Amazon EC2 launch instance wizard — the wizard sets the attribute to true. You can modify this attribute using the Amazon VPC console. By default, all subnets have the IPv6 addressing attribute set to false. You can modify this attribute using the Amazon VPC console. If you enable the IPv6 addressing attribute for your subnet, network interfaces created in the subnet receive an IPv6 address from the range of the subnet. Instances launched into the subnet receive an IPv6 address on the primary network interface. Your subnet must have an associated IPv6 CIDR block. Note If you enable the IPv6 addressing feature for your subnet, your network interface or instance only receives an IPv6 address if it's created using version 2016-11-15 or later of the Amazon EC2 API. The Amazon EC2 console uses the latest API version. Modify the IP addressing attributes of your subnet 156 Amazon Virtual Private Cloud User Guide To modify your subnet's IP addressing behavior 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. 4. 5. In the navigation pane, choose Subnets. Select your subnet and choose Actions, Edit subnet settings. The Enable auto-assign public IPv4 address check box, if selected, requests a public IPv4 address for all instances launched into the selected subnet. Select or clear the check box as required, and then choose Save. The Enable auto-assign IPv6 address check box, if selected, requests an IPv6 address for all network interfaces created in the selected subnet. Select or clear the check box as required, and then choose Save. To modify a subnet attribute using the AWS CLI Use the modify-subnet-attribute command. Subnet CIDR reservations A subnet CIDR reservation is a range of IPv4 or IPv6 addresses that you set aside so that AWS won't assign them to your network interfaces. This enables you to reserve IPv4 or IPv6 CIDR blocks (also called "prefixes") for use with your network interfaces. When you create a subnet CIDR reservation, you specify how you will use the reserved IP addresses. The following options are available: • Prefix — Allows you to assign a prefix to a single network interface. For more information, see Assign prefixes to Amazon EC2 network interfaces in the Amazon EC2 User Guide. • Explicit — Allows you to manually assign an individual IP address to a single network interface. The following rules apply to |
vpc-ug-061 | vpc-ug.pdf | 61 | assign them to your network interfaces. This enables you to reserve IPv4 or IPv6 CIDR blocks (also called "prefixes") for use with your network interfaces. When you create a subnet CIDR reservation, you specify how you will use the reserved IP addresses. The following options are available: • Prefix — Allows you to assign a prefix to a single network interface. For more information, see Assign prefixes to Amazon EC2 network interfaces in the Amazon EC2 User Guide. • Explicit — Allows you to manually assign an individual IP address to a single network interface. The following rules apply to subnet CIDR reservations: • When you create a subnet CIDR reservation, the IP address range can include addresses that are already in use. Creating a subnet reservation does not unassign any IP addresses that are already in use. • You can reserve multiple CIDR ranges per subnet. When you reserve multiple CIDR ranges within the same VPC, the CIDR ranges cannot overlap. Subnet CIDR reservations 157 Amazon Virtual Private Cloud User Guide • When you reserve more than one range in a subnet for Prefix Delegation, and Prefix Delegation is configured for automatic assignment, we choose the IP addresses to assign to network interfaces at random. • When you delete a subnet reservation, the unused IP addresses are available for AWS to assign to your network interfaces. Deleting a subnet reservation does not unassign any IP addresses that are in use. For more information about Classless Inter-Domain Routing (CIDR) notation, see IP addressing. Contents • Work with subnet CIDR reservations using the console • Work with subnet CIDR reservations using the AWS CLI Work with subnet CIDR reservations using the console You can create and manage subnet CIDR reservations as follows. To edit subnet CIDR reservations 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. In the navigation pane, choose Subnets. Select the subnet. 4. Choose the CIDR reservations tab to get information about any existing subnet CIDR reservations. 5. To add or remove subnet CIDR reservations, choose Actions, Edit CIDR reservations and then do the following: • • • To add an IPv4 CIDR reservation, choose IPv4, Add IPv4 CIDR reservation. Choose the reservation type, enter the CIDR range, and choose Add. To add an IPv6 CIDR reservation, choose IPv6, Add IPv6 CIDR reservation. Choose the reservation type, enter the CIDR range, and choose Add. To remove a CIDR reservation, choose Remove for the subnet CIDR reservation. Work with subnet CIDR reservations using the AWS CLI You can use the AWS CLI to create and manage subnet CIDR reservations. Work with subnet CIDR reservations using the console 158 Amazon Virtual Private Cloud Tasks • Create a subnet CIDR reservation • View subnet CIDR reservations • Delete a subnet CIDR reservation Create a subnet CIDR reservation User Guide You can use create-subnet-cidr-reservation to create a subnet CIDR reservation. aws ec2 create-subnet-cidr-reservation --subnet-id subnet-03c51e2eEXAMPLE -- reservation-type prefix --cidr 2600:1f13:925:d240:3a1b::/80 The following is example output. { "SubnetCidrReservation": { "SubnetCidrReservationId": "scr-044f977c4eEXAMPLE", "SubnetId": "subnet-03c51e2ef5EXAMPLE", "Cidr": "2600:1f13:925:d240:3a1b::/80", "ReservationType": "prefix", "OwnerId": "123456789012" } } View subnet CIDR reservations You can use get-subnet-cidr-reservations to view the details of a subnet CIDR reservation. aws ec2 get-subnet-cidr-reservations --subnet-id subnet-05eef9fb78EXAMPLE Delete a subnet CIDR reservation You can use delete-subnet-cidr-reservation to delete a subnet CIDR reservation. aws ec2 delete-subnet-cidr-reservation --subnet-cidr-reservation- id scr-044f977c4eEXAMPLE Work with subnet CIDR reservations using the AWS CLI 159 Amazon Virtual Private Cloud User Guide Configure route tables A route table contains a set of rules, called routes, that determine where network traffic from your subnet or gateway is directed. Contents • Route table concepts • Subnet route tables • Gateway route tables • Route priority • Example routing options • Change a subnet route table • Replace the main route table • Control traffic entering your VPC with a gateway route table • Replace or restore the target for a local route • Dynamic routing in your VPC using VPC Route Server • Troubleshoot reachability issues Route table concepts The following are the key concepts for route tables. • Main route table—The route table that automatically comes with your VPC. It controls the routing for all subnets that are not explicitly associated with any other route table. • Custom route table—A route table that you create for your VPC. • Destination—The range of IP addresses where you want traffic to go (destination CIDR). For example, an external corporate network with the CIDR 172.16.0.0/12. • Target—The gateway, network interface, or connection through which to send the destination traffic; for example, an internet gateway. • Route table association—The association between a route table and a subnet, internet gateway, or virtual private gateway. • Subnet route table—A route table that's associated with a subnet. Route tables 160 Amazon Virtual Private Cloud User Guide • Local route—A default route for |
vpc-ug-062 | vpc-ug.pdf | 62 | table. • Custom route table—A route table that you create for your VPC. • Destination—The range of IP addresses where you want traffic to go (destination CIDR). For example, an external corporate network with the CIDR 172.16.0.0/12. • Target—The gateway, network interface, or connection through which to send the destination traffic; for example, an internet gateway. • Route table association—The association between a route table and a subnet, internet gateway, or virtual private gateway. • Subnet route table—A route table that's associated with a subnet. Route tables 160 Amazon Virtual Private Cloud User Guide • Local route—A default route for communication within the VPC. • Propagation—If you've attached a virtual private gateway to your VPC and enable route propagation, we automatically add routes for your VPN connection to your subnet route tables. This means that you don't need to manually add or remove VPN routes. For more information, see Site-to-Site VPN routing options in the Site-to-Site VPN User Guide. • Gateway route table—A route table that's associated with an internet gateway or virtual private gateway. • Edge association—A route table that you use to route inbound VPC traffic to an appliance. You associate a route table with the internet gateway or virtual private gateway, and specify the network interface of your appliance as the target for VPC traffic. • Transit gateway route table—A route table that's associated with a transit gateway. For more information, see Transit gateway route tables in Amazon VPC Transit Gateways. • Local gateway route table—A route table that's associated with an Outposts local gateway. For more information, see Local gateways in the AWS Outposts User Guide. Subnet route tables Your VPC has an implicit router, and you use route tables to control where network traffic is directed. Each subnet in your VPC must be associated with a route table, which controls the routing for the subnet (subnet route table). You can explicitly associate a subnet with a particular route table. Otherwise, the subnet is implicitly associated with the main route table. A subnet can only be associated with one route table at a time, but you can associate multiple subnets with the same subnet route table. Contents • Routes • Main route table • Custom route tables • Subnet route table association Routes Each route in a table specifies a destination and a target. For example, to enable your subnet to access the internet through an internet gateway, add the following route to your subnet route Subnet route tables 161 Amazon Virtual Private Cloud User Guide table. The destination for the route is 0.0.0.0/0, which represents all IPv4 addresses. The target is the internet gateway that's attached to your VPC. Destination 0.0.0.0/0 Target igw-id CIDR blocks for IPv4 and IPv6 are treated separately. For example, a route with a destination CIDR of 0.0.0.0/0 does not automatically include all IPv6 addresses. You must create a route with a destination CIDR of ::/0 for all IPv6 addresses. If you frequently reference the same set of CIDR blocks across your AWS resources, you can create a customer-managed prefix list to group them together. You can then specify the prefix list as the destination in your route table entry. Every route table contains a local route for communication within the VPC. This route is added by default to all route tables. If your VPC has more than one IPv4 CIDR block, your route tables contain a local route for each IPv4 CIDR block. If you've associated an IPv6 CIDR block with your VPC, your route tables contain a local route for the IPv6 CIDR block. You can replace or restore the target of each local route as needed. Rules and considerations • You can add a route to your route tables that is more specific than the local route. The destination must match the entire IPv4 or IPv6 CIDR block of a subnet in your VPC. The target must be a NAT gateway, network interface, or Gateway Load Balancer endpoint. • If your route table has multiple routes, we use the most specific route that matches the traffic (longest prefix match) to determine how to route the traffic. • You can't add routes to IPv4 addresses that are an exact match or a subset of the following range: 169.254.168.0/22. This range is within the link-local address space and is reserved for use by AWS services. For example, Amazon EC2 uses addresses in this range for services that are accessible only from EC2 instances, such as the Instance Metadata Service (IMDS) and the Amazon DNS server. You can use a CIDR block that is larger than but overlaps 169.254.168.0/22, but packets destined for addresses in 169.254.168.0/22 will not be forwarded. • You can't add routes to IPv6 addresses that are an exact match or a subset of the following range: fd00:ec2::/32. |
vpc-ug-063 | vpc-ug.pdf | 63 | match or a subset of the following range: 169.254.168.0/22. This range is within the link-local address space and is reserved for use by AWS services. For example, Amazon EC2 uses addresses in this range for services that are accessible only from EC2 instances, such as the Instance Metadata Service (IMDS) and the Amazon DNS server. You can use a CIDR block that is larger than but overlaps 169.254.168.0/22, but packets destined for addresses in 169.254.168.0/22 will not be forwarded. • You can't add routes to IPv6 addresses that are an exact match or a subset of the following range: fd00:ec2::/32. This range is within the unique local address (ULA) space and is reserved for use by AWS services. For example, Amazon EC2 uses addresses in this range for services that Subnet route tables 162 Amazon Virtual Private Cloud User Guide are accessible only from EC2 instances, such as the Instance Metadata Service (IMDS) and the Amazon DNS server. You can use a CIDR block that is larger than but overlaps fd00:ec2::/32, but packets destined for addresses in fd00:ec2::/32 will not be forwarded. • You can add middlebox appliances to the routing paths for your VPC. For more information, see the section called “Routing for a middlebox appliance”. Example In the following example, suppose that the VPC has both an IPv4 CIDR block and an IPv6 CIDR block. IPv4 and IPv6 traffic are treated separately, as shown in the following route table. Destination 10.0.0.0/16 2001:db8:1234:1a00::/56 Target Local Local 172.31.0.0/16 pcx-11223344556677889 0.0.0.0/0 ::/0 igw-12345678901234567 eigw-aabbccddee1122334 • IPv4 traffic to be routed within the VPC (10.0.0.0/16) is covered by the Local route. • IPv6 traffic to be routed within the VPC (2001:db8:1234:1a00::/56) is covered by the Local route. • The route for 172.31.0.0/16 sends traffic to a peering connection. • The route for all IPv4 traffic (0.0.0.0/0) sends traffic to an internet gateway. Therefore, all IPv4 traffic, except for traffic within the VPC and to the peering connection, is routed to the internet gateway. • The route for all IPv6 traffic (::/0) sends traffic to an egress-only internet gateway. Therefore, all IPv6 traffic, except for traffic within the VPC, is routed to the egress-only internet gateway. Main route table When you create a VPC, it automatically has a main route table. When a subnet does not have an explicit routing table associated with it, the main routing table is used by default. On the Route Subnet route tables 163 Amazon Virtual Private Cloud User Guide tables page in the Amazon VPC console, you can view the main route table for a VPC by looking for Yes in the Main column. By default, when you create a nondefault VPC, the main route table contains only a local route. If you Create a VPC and choose a NAT gateway, Amazon VPC automatically adds routes to the main route table for the gateways. The following rules apply to the main route table: • You can add, remove, and modify routes in the main route table. • You can't delete the main route table. • You can't set a gateway route table as the main route table. • You can replace the main route table by associating a custom route table with a subnet. • You can explicitly associate a subnet with the main route table, even if it's already implicitly associated. You might want to do that if you change which table is the main route table. When you change which table is the main route table, it also changes the default for additional new subnets, or for any subnets that are not explicitly associated with any other route table. For more information, see Replace the main route table. Custom route tables By default, a route table contains a local route for communication within the VPC. If you Create a VPC and choose a public subnet, Amazon VPC creates a custom route table and adds a route that points to the internet gateway. One way to protect your VPC is to leave the main route table in its original default state. Then, explicitly associate each new subnet that you create with one of the custom route tables you've created. This ensures that you explicitly control how each subnet routes traffic. You can add, remove, and modify routes in a custom route table. You can delete a custom route table only if it has no associations. Subnet route table association Each subnet in your VPC must be associated with a route table. A subnet can be explicitly associated with custom route table, or implicitly or explicitly associated with the main route table. Subnet route tables 164 Amazon Virtual Private Cloud User Guide For more information about viewing your subnet and route table associations, see Determine which subnets and or gateways are explicitly associated. Subnets that are in |
vpc-ug-064 | vpc-ug.pdf | 64 | each subnet routes traffic. You can add, remove, and modify routes in a custom route table. You can delete a custom route table only if it has no associations. Subnet route table association Each subnet in your VPC must be associated with a route table. A subnet can be explicitly associated with custom route table, or implicitly or explicitly associated with the main route table. Subnet route tables 164 Amazon Virtual Private Cloud User Guide For more information about viewing your subnet and route table associations, see Determine which subnets and or gateways are explicitly associated. Subnets that are in VPCs associated with Outposts can have an additional target type of a local gateway. This is the only routing difference from non-Outposts subnets. Example 1: Implicit and explicit subnet association The following diagram shows the routing for a VPC with an internet gateway, a virtual private gateway, a public subnet, and a VPN-only subnet. Route table A is a custom route table that is explicitly associated with the public subnet. It has a route that sends all traffic to the internet gateway, which is what makes the subnet a public subnet. Destination VPC CIDR 0.0.0.0/0 Subnet route tables Target Local igw-id 165 Amazon Virtual Private Cloud User Guide Route table B is the main route table. It is implicitly associated with the private subnet. It has a route that sends all traffic to the virtual private gateway, but no route to the internet gateway, which is what makes the subnet a VPN-only subnet. If you create another subnet in this VPC and don't associate a custom route table, the subnet will also be implicitly associated with this route table because it is the main route table. Destination VPC CIDR 0.0.0.0/0 Target Local vgw-id Example 2: Replacing the main route table You might want to make changes to the main route table. To avoid any disruption to your traffic, we recommend that you first test the route changes using a custom route table. After you're satisfied with the testing, you can replace the main route table with the new custom table. The following diagram shows two subnets and two route tables. Subnet A is implicitly associated with route table A, the main route table. Subnet B is implicitly associated with route table A. Route table B, a custom route table, isn't associated with either subnet. To replace the main route table, start by creating an explicit association between subnet B and route table B. Test route table B. Subnet route tables 166 Amazon Virtual Private Cloud User Guide After you've tested route table B, make it the main route table. Subnet B still has an explicit association with route table B. However, subnet A now has an implicit association with route table B, because route table B is the new main route table. Route table A is no longer associated with either subnet. (Optional) If you disassociate subnet B from route table B, there is still an implicit association between subnet B and route table B. If you no longer need route table A, you can delete it. Subnet route tables 167 Amazon Virtual Private Cloud User Guide Gateway route tables You can associate a route table with an internet gateway or a virtual private gateway. When a route table is associated with a gateway, it's referred to as a gateway route table. You can create a gateway route table for fine-grain control over the routing path of traffic entering your VPC. For example, you can intercept the traffic that enters your VPC through an internet gateway by redirecting that traffic to a middlebox appliance (such as a security appliance) in your VPC. Contents • Gateway route table routes • Rules and considerations Gateway route table routes A gateway route table associated with an internet gateway supports routes with the following targets: • The default local route • A Gateway Load Balancer endpoint • A network interface for a middlebox appliance A gateway route table associated with a virtual private gateway supports routes with the following targets: Gateway route tables 168 Amazon Virtual Private Cloud • The default local route • A Gateway Load Balancer endpoint • A network interface for a middlebox appliance User Guide When the target is a Gateway Load Balancer endpoint or a network interface, the following destinations are allowed: • The entire IPv4 or IPv6 CIDR block of your VPC. In this case, you replace the target of the default local route. • The entire IPv4 or IPv6 CIDR block of a subnet in your VPC. This is a more specific route than the default local route. If you change the target of the local route in a gateway route table to a network interface in your VPC, you can later restore it to the default |
vpc-ug-065 | vpc-ug.pdf | 65 | a middlebox appliance User Guide When the target is a Gateway Load Balancer endpoint or a network interface, the following destinations are allowed: • The entire IPv4 or IPv6 CIDR block of your VPC. In this case, you replace the target of the default local route. • The entire IPv4 or IPv6 CIDR block of a subnet in your VPC. This is a more specific route than the default local route. If you change the target of the local route in a gateway route table to a network interface in your VPC, you can later restore it to the default local target. For more information, see Replace or restore the target for a local route. Example In the following gateway route table, traffic destined for a subnet with the 172.31.0.0/20 CIDR block is routed to a specific network interface. Traffic destined for all other subnets in the VPC uses the local route. Destination 172.31.0.0/16 172.31.0.0/20 Example Target Local eni-id In the following gateway route table, the target for the local route is replaced with a network interface ID. Traffic destined for all subnets within the VPC is routed to the network interface. Destination 172.31.0.0/16 Gateway route tables Target eni-id 169 Amazon Virtual Private Cloud Rules and considerations User Guide You cannot associate a route table with a gateway if any of the following applies: • The route table contains existing routes with targets other than a network interface, Gateway Load Balancer endpoint, or the default local route. • The route table contains existing routes to CIDR blocks outside of the ranges in your VPC. • Route propagation is enabled for the route table. In addition, the following rules and considerations apply: • You cannot add routes to any CIDR blocks outside of the ranges in your VPC, including ranges larger than the individual VPC CIDR blocks. • You can only specify local, a Gateway Load Balancer endpoint, or a network interface as a target. You cannot specify any other types of targets, including individual host IP addresses. For more information, see the section called “Example routing options”. • You cannot specify a prefix list as a destination. • You cannot use a gateway route table to control or intercept traffic outside of your VPC, for example, traffic through an attached transit gateway. You can intercept traffic that enters your VPC and redirect it to another target in the same VPC only. • To ensure that traffic reaches your middlebox appliance, the target network interface must be attached to a running instance. For traffic that flows through an internet gateway, the target network interface must also have a public IP address. • When configuring your middlebox appliance, take note of the appliance considerations. • When you route traffic through a middlebox appliance, the return traffic from the destination subnet must be routed through the same appliance. Asymmetric routing is not supported. • Route table rules apply to all traffic that leaves a subnet. Traffic that leaves a subnet is defined as traffic destined to that subnet's gateway router's MAC address. Traffic that is destined for the MAC address of another network interface in the subnet makes use of data link (layer 2) routing instead of network (layer 3) so the rules do not apply to this traffic. • Not all Local Zones support edge association with virtual private gateways. For more information on available zones, see Considerations in the AWS Local Zones User Guide. Gateway route tables 170 Amazon Virtual Private Cloud Route priority User Guide In general, we direct traffic using the most specific route that matches the traffic. This is known as the longest prefix match. If your route table has overlapping or matching routes, additional rules apply. The following list shows a route priority summary with links to sections below with more detailed information and examples: 1. Longest prefix (for example, 10.10.2.15/32 has priority over 10.10.2.0/24) 2. Static routes (like VPC peering and internet gateway connections) 3. Prefix list routes 4. Propagated routes a. Direct Connect BGP routes (dynamic routes) b. VPN static routes c. VPN BGP routes (dynamic routes) (like virtual private gateways) Longest prefix match Routes to IPv4 and IPv6 addresses or CIDR blocks are independent of each other. We use the most specific route that matches either IPv4 traffic or IPv6 traffic to determine how to route the traffic. The following example subnet route table has a route for IPv4 internet traffic (0.0.0.0/0) that points to an internet gateway, and a route for 172.31.0.0/16 IPv4 traffic that points to a peering connection (pcx-11223344556677889). Any traffic from the subnet that's destined for the 172.31.0.0/16 IP address range uses the peering connection, because this route is more specific than the route for internet gateway. Any traffic destined for a target within the VPC (10.0.0.0/16) is covered by |
vpc-ug-066 | vpc-ug.pdf | 66 | of each other. We use the most specific route that matches either IPv4 traffic or IPv6 traffic to determine how to route the traffic. The following example subnet route table has a route for IPv4 internet traffic (0.0.0.0/0) that points to an internet gateway, and a route for 172.31.0.0/16 IPv4 traffic that points to a peering connection (pcx-11223344556677889). Any traffic from the subnet that's destined for the 172.31.0.0/16 IP address range uses the peering connection, because this route is more specific than the route for internet gateway. Any traffic destined for a target within the VPC (10.0.0.0/16) is covered by the local route, and therefore is routed within the VPC. All other traffic from the subnet uses the internet gateway. Destination 10.0.0.0/16 172.31.0.0/16 0.0.0.0/0 Route priority Target local pcx-11223344556677889 igw-12345678901234567 171 Amazon Virtual Private Cloud User Guide Route priority for static and dynamically propagated routes If you've attached a virtual private gateway to your VPC and enabled route propagation on your subnet route table, routes representing your Site-to-Site VPN connection automatically appear as propagated routes in your route table. If the destination of a propagated route is identical to the destination of a static route, the static route takes priority. The following resources use static routes: • internet gateway • NAT gateway • Network interface • Instance ID • Gateway VPC endpoint • Transit gateway • VPC peering connection • Gateway Load Balancer endpoint For more information, see Route tables and VPN route priority in the AWS Site-to-Site VPN User Guide. The following example route table has a static route to an internet gateway and a propagated route to a virtual private gateway. Both routes have a destination of 172.31.0.0/24. Because a static route to an internet gateway takes priority, all traffic destined for 172.31.0.0/24 is routed to the internet gateway. Destination 10.0.0.0/16 Target local 172.31.0.0/24 vgw-11223344556677889 172.31.0.0/24 igw-12345678901234567 Propagated No Yes No Route priority for prefix lists If your route table references a prefix list, the following rules apply: Route priority 172 Amazon Virtual Private Cloud User Guide • If your route table contains a propagated route that matches a route that references a prefix list, the route that references the prefix list takes priority. Please note that for routes that overlap, more specific routes always take priority irrespective of whether they are propagated routes, static routes, or routes that reference prefix lists. • If your route table references multiple prefix lists that have overlapping CIDR blocks to different targets, we randomly choose which route takes priority. Thereafter, the same route always takes priority. Example routing options The following topics describe routing for specific gateways or connections in your VPC. Contents • Routing to an internet gateway • Routing to a NAT device • Routing to a virtual private gateway • Routing to an AWS Outposts local gateway • Routing to a VPC peering connection • Routing to a gateway VPC endpoint • Routing to an egress-only internet gateway • Routing for a transit gateway • Routing for a middlebox appliance • Routing using a prefix list • Routing to a Gateway Load Balancer endpoint Routing to an internet gateway You can make a subnet a public subnet by adding a route in your subnet route table to an internet gateway. To do this, create and attach an internet gateway to your VPC, and then add a route with a destination of 0.0.0.0/0 for IPv4 traffic or ::/0 for IPv6 traffic, and a target of the internet gateway ID (igw-xxxxxxxxxxxxxxxxx). Example routing options 173 Amazon Virtual Private Cloud User Guide Destination 0.0.0.0/0 ::/0 Target igw-id igw-id For more information, see Enable internet access for a VPC using an internet gateway. Routing to a NAT device To enable instances in a private subnet to connect to the internet, you can create a NAT gateway or launch a NAT instance in a public subnet. Then add a route for the private subnet's route table that routes IPv4 internet traffic (0.0.0.0/0) to the NAT device. Destination 0.0.0.0/0 Target nat-gateway-id You can also create more specific routes to other targets to avoid unnecessary data processing charges for using a NAT gateway, or to route certain traffic privately. In the following example, Amazon S3 traffic (pl-xxxxxxxx, a prefix list that contains the IP address ranges for Amazon S3 in a specific Region) is routed to a gateway VPC endpoint, and 10.25.0.0/16 traffic is routed to a VPC peering connection. These IP address ranges are more specific than 0.0.0.0/0. When instances send traffic to Amazon S3 or the peer VPC, the traffic is sent to the gateway VPC endpoint or the VPC peering connection. All other traffic is sent to the NAT gateway. Destination 0.0.0.0/0 pl-xxxxxxxx 10.25.0.0/16 Target nat-gateway-id vpce-id pcx-id For more information, see NAT devices. Example routing options 174 Amazon Virtual Private Cloud |
vpc-ug-067 | vpc-ug.pdf | 67 | traffic (pl-xxxxxxxx, a prefix list that contains the IP address ranges for Amazon S3 in a specific Region) is routed to a gateway VPC endpoint, and 10.25.0.0/16 traffic is routed to a VPC peering connection. These IP address ranges are more specific than 0.0.0.0/0. When instances send traffic to Amazon S3 or the peer VPC, the traffic is sent to the gateway VPC endpoint or the VPC peering connection. All other traffic is sent to the NAT gateway. Destination 0.0.0.0/0 pl-xxxxxxxx 10.25.0.0/16 Target nat-gateway-id vpce-id pcx-id For more information, see NAT devices. Example routing options 174 Amazon Virtual Private Cloud User Guide Routing to a virtual private gateway You can use an AWS Site-to-Site VPN connection to enable instances in your VPC to communicate with your own network. To do this, create and attach a virtual private gateway to your VPC. Then add a route in your subnet route table with the destination of your network and a target of the virtual private gateway (vgw-xxxxxxxxxxxxxxxxx). Destination 10.0.0.0/16 Target vgw-id You can then create and configure your Site-to-Site VPN connection. For more information, see What is AWS Site-to-Site VPN? and Route tables and VPN route priority in the AWS Site-to-Site VPN User Guide. A Site-to-Site VPN connection on a virtual private gateway does not support IPv6 traffic. However, we support IPv6 traffic routed through a virtual private gateway to an AWS Direct Connect connection. For more information, see the AWS Direct Connect User Guide. Routing to an AWS Outposts local gateway This section describes routing table configurations for routing to an AWS Outposts local gateway. Contents • Enable traffic between Outpost subnets and your on-premises network • Enable traffic between subnets in the same VPC across Outposts Enable traffic between Outpost subnets and your on-premises network Subnets that are in VPCs associated with AWS Outposts can have an additional target type of a local gateway. Consider the case where you want to have the local gateway route traffic with a destination address of 192.168.10.0/24 to the customer network. To do this, add the following route with the destination network and a target of the local gateway (lgw-xxxx). Destination 192.168.10.0/24 Example routing options Target lgw-id 175 Amazon Virtual Private Cloud User Guide Enable traffic between subnets in the same VPC across Outposts You can establish communication between subnets that are in the same VPC across different Outposts using Outpost local gateways and your on-premise network. You can use this feature to build architectures similar to multi-Availability Zone (AZ) architectures for your on-premise applications running on Outposts racks by establishing connectivity between Outposts racks that are anchored to different AZs. To enable this feature, add a route to your Outpost rack subnet route table that is more specific than the local route in that route table and has a target type of local gateway. The destination of the route must match the entire IPv4 block of the subnet in your VPC that is in another Outpost. Repeat this configuration for all the Outpost subnets that need to communicate. Example routing options 176 Amazon Virtual Private Cloud User Guide Important • To use this feature, you must use direct VPC routing. You cannot use your own customer- owned IP addresses. • Your on-premise network that the Outposts local gateways are connected to must have the required routing so that subnets can access to each other. • If you want to use security groups for resources in the subnets, you must use rules that include IP address ranges as source or destination in the Outpost subnets. You cannot use security group IDs. • Existing Outposts racks may require an update to enable support for intra-VPC communication across multiple Outposts. If this feature doesn't work for you, contact AWS Support. Example Example For a VPC with a CIDR of 10.0.0.0/16, an Outpost 1 subnet with a CIDR of 10.0.1.0/24, and an Outpost 2 subnet with a CIDR of 10.0.2.0/24, the entry for Outpost 1 subnet’s route table would be as follows: Destination 10.0.0.0/16 10.0.2.0/24 Target Local lgw-1-id The entry for Outpost 2 subnet’s route table would be as follows: Destination 10.0.0.0/16 10.0.1.0/24 Target Local lgw-2-id Example routing options 177 Amazon Virtual Private Cloud User Guide Routing to a VPC peering connection A VPC peering connection is a networking connection between two VPCs that allows you to route traffic between them using private IPv4 addresses. Instances in either VPC can communicate with each other as if they are part of the same network. To enable the routing of traffic between VPCs in a VPC peering connection, you must add a route to one or more of your subnet route tables that points to the VPC peering connection. This allows you to access all or part of the CIDR block of the other VPC in the peering connection. |
vpc-ug-068 | vpc-ug.pdf | 68 | to a VPC peering connection A VPC peering connection is a networking connection between two VPCs that allows you to route traffic between them using private IPv4 addresses. Instances in either VPC can communicate with each other as if they are part of the same network. To enable the routing of traffic between VPCs in a VPC peering connection, you must add a route to one or more of your subnet route tables that points to the VPC peering connection. This allows you to access all or part of the CIDR block of the other VPC in the peering connection. Similarly, the owner of the other VPC must add a route to their subnet route table to route traffic back to your VPC. For example, you have a VPC peering connection (pcx-11223344556677889) between two VPCs, with the following information: • VPC A: CIDR block is 10.0.0.0/16 • VPC B: CIDR block is 172.31.0.0/16 To enable traffic between the VPCs and allow access to the entire IPv4 CIDR block of either VPC, the VPC A route table is configured as follows. Destination 10.0.0.0/16 172.31.0.0/16 The VPC B route table is configured as follows. Destination 172.31.0.0/16 10.0.0.0/16 Target Local pcx-11223344556677889 Target Local pcx-11223344556677889 Your VPC peering connection can also support IPv6 communication between instances in the VPCs, if the VPCs and instances are enabled for IPv6 communication. To enable the routing of IPv6 traffic Example routing options 178 Amazon Virtual Private Cloud User Guide between VPCs, you must add a route to your route table that points to the VPC peering connection to access all or part of the IPv6 CIDR block of the peer VPC. For example, using the same VPC peering connection (pcx-11223344556677889) above, assume the VPCs have the following information: • VPC A: IPv6 CIDR block is 2001:db8:1234:1a00::/56 • VPC B: IPv6 CIDR block is 2001:db8:5678:2b00::/56 To enable IPv6 communication over the VPC peering connection, add the following route to the subnet route table for VPC A. Destination 10.0.0.0/16 172.31.0.0/16 Target Local pcx-11223344556677889 2001:db8:5678:2b00::/56 pcx-11223344556677889 Add the following route to the route table for VPC B. Destination 172.31.0.0/16 10.0.0.0/16 Target Local pcx-11223344556677889 2001:db8:1234:1a00::/56 pcx-11223344556677889 For more information about VPC peering connections, see the Amazon VPC Peering Guide. Routing to a gateway VPC endpoint A gateway VPC endpoint enables you to create a private connection between your VPC and another AWS service. When you create a gateway endpoint, you specify the subnet route tables in your VPC that are used by the gateway endpoint. A route is automatically added to each of the route Example routing options 179 Amazon Virtual Private Cloud User Guide tables with a destination that specifies the prefix list ID of the service (pl-xxxxxxxx), and a target with the endpoint ID (vpce-xxxxxxxxxxxxxxxxx). You cannot explicitly delete or modify the endpoint route, but you can change the route tables that are used by the endpoint. For more information about routing for endpoints, and the implications for routes to AWS services, see Routing for gateway endpoints. Routing to an egress-only internet gateway You can create an egress-only internet gateway for your VPC to enable instances in a private subnet to initiate outbound communication to the internet, but prevent the internet from initiating connections with the instances. An egress-only internet gateway is used for IPv6 traffic only. To configure routing for an egress-only internet gateway, add a route in the private subnet's route table that routes IPv6 internet traffic (::/0) to the egress-only internet gateway. Destination ::/0 Target eigw-id For more information, see Enable outbound IPv6 traffic using an egress-only internet gateway. Routing for a transit gateway When you attach a VPC to a transit gateway, you need to add a route to your subnet route table for traffic to route through the transit gateway. Consider the following scenario where you have three VPCs that are attached to a transit gateway. In this scenario, all attachments are associated with the transit gateway route table and propagate to the transit gateway route table. Therefore, all attachments can route packets to each other, with the transit gateway serving as a simple layer 3 IP hub. For example, you have two VPCs, with the following information: • VPC A: 10.1.0.0/16, attachment ID tgw-attach-11111111111111111 • VPC B: 10.2.0.0/16, attachment ID tgw-attach-22222222222222222 To enable traffic between the VPCs and allow access to the transit gateway, the VPC A route table is configured as follows. Example routing options 180 Amazon Virtual Private Cloud User Guide Destination 10.1.0.0/16 10.0.0.0/8 Target local tgw-id The following is an example of the transit gateway route table entries for the VPC attachments. Destination 10.1.0.0/16 10.2.0.0/16 Target tgw-attach-11111111111111111 tgw-attach-22222222222222222 For more information about transit gateway route tables, see Routing in Amazon VPC Transit Gateways. Routing for a middlebox appliance You can add middlebox appliances into the routing paths for your VPC. |
vpc-ug-069 | vpc-ug.pdf | 69 | tgw-attach-11111111111111111 • VPC B: 10.2.0.0/16, attachment ID tgw-attach-22222222222222222 To enable traffic between the VPCs and allow access to the transit gateway, the VPC A route table is configured as follows. Example routing options 180 Amazon Virtual Private Cloud User Guide Destination 10.1.0.0/16 10.0.0.0/8 Target local tgw-id The following is an example of the transit gateway route table entries for the VPC attachments. Destination 10.1.0.0/16 10.2.0.0/16 Target tgw-attach-11111111111111111 tgw-attach-22222222222222222 For more information about transit gateway route tables, see Routing in Amazon VPC Transit Gateways. Routing for a middlebox appliance You can add middlebox appliances into the routing paths for your VPC. The following are possible use cases: • Intercept traffic that enters your VPC through an internet gateway or a virtual private gateway by directing it to a middlebox appliance in your VPC. You can use the middlebox routing wizard to have AWS automatically configure the appropriate route tables for your gateway, middlebox, and destination subnet. For more information, see the section called “Middlebox routing wizard”. • Direct traffic between two subnets to a middlebox appliance. You can do so by creating a route for one subnet route table that matches the subnet CIDR of the other subnet and specifies a Gateway Load Balancer endpoint, NAT gateway, Network Firewall endpoint, or the network interface for an appliance as a target. Alternatively, to redirect all traffic from the subnet to any other subnet, replace the target of the local route with a Gateway Load Balancer endpoint, NAT gateway, or network interface. You can configure the appliance to suit your needs. For example, you can configure a security appliance that screens all traffic, or a WAN acceleration appliance. The appliance is deployed as an Example routing options 181 Amazon Virtual Private Cloud User Guide Amazon EC2 instance in a subnet in your VPC, and is represented by an elastic network interface (network interface) in your subnet. If you enable route propagation for the destination subnet route table, be aware of route priority. We prioritize the most specific route, and if the routes match, we prioritize static routes over propagated routes. Review your routes to ensure that traffic is routed correctly and that there are no unintended consequences if you enable or disable route propagation (for example, route propagation is required for an AWS Direct Connect connection that supports jumbo frames). To route inbound VPC traffic to an appliance, you associate a route table with the internet gateway or virtual private gateway, and specify the network interface of your appliance as the target for VPC traffic. For more information, see Gateway route tables. You can also route outbound traffic from your subnet to a middlebox appliance in another subnet. For middlebox routing examples, see Middlebox scenarios. Contents • Appliance considerations • Routing traffic between a gateway and an appliance • Routing inter-subnet traffic to an appliance Appliance considerations You can choose a third-party appliance from AWS Marketplace, or you can configure your own appliance. When you create or configure an appliance, take note of the following: • The appliance must be configured in a separate subnet to the source or destination traffic. • You must disable source/destination checking on the appliance. For more information, see Changing the Source or Destination Checking in the Amazon EC2 User Guide. • You cannot route traffic between hosts in the same subnet through an appliance. • The appliance does not have to perform network address translation (NAT). • You can add a route to your route tables that is more specific than the local route. You can use more specific routes to redirect traffic between subnets within a VPC (East-West traffic) to a middlebox appliance. The destination of the route must match the entire IPv4 or IPv6 CIDR block of a subnet in your VPC. • To intercept IPv6 traffic, ensure that your VPC, subnet, and appliance support IPv6. Example routing options 182 Amazon Virtual Private Cloud User Guide Routing traffic between a gateway and an appliance To route inbound VPC traffic to an appliance, you associate a route table with the internet gateway or virtual private gateway, and specify the network interface of your appliance as the target for VPC traffic. In the following example, the VPC has an internet gateway, an appliance, and a subnet with instances. Traffic from the internet is routed through an appliance. Associate this route table with your internet gateway or virtual private gateway. The first entry is the local route. The second entry sends IPv4 traffic destined for the subnet to the network interface for the appliance. This route is more specific than the local route. Destination VPC CIDR Subnet CIDR Target Local Appliance network interface ID Alternatively, you can replace the target for the local route with the network interface of the appliance. You can do this to ensure that |
vpc-ug-070 | vpc-ug.pdf | 70 | has an internet gateway, an appliance, and a subnet with instances. Traffic from the internet is routed through an appliance. Associate this route table with your internet gateway or virtual private gateway. The first entry is the local route. The second entry sends IPv4 traffic destined for the subnet to the network interface for the appliance. This route is more specific than the local route. Destination VPC CIDR Subnet CIDR Target Local Appliance network interface ID Alternatively, you can replace the target for the local route with the network interface of the appliance. You can do this to ensure that all traffic is automatically routed to the appliance, including traffic destined for subnets that you add to the VPC in the future. Example routing options 183 Amazon Virtual Private Cloud User Guide Destination VPC CIDR Target Appliance network interface ID To route traffic from your subnet to an appliance in another subnet, add a route to your subnet route table that routes traffic to the appliance's network interface. The destination must be less specific than the destination for the local route. For example, for traffic destined for the internet, specify 0.0.0.0/0 (all IPv4 addresses) for the destination. Destination VPC CIDR 0.0.0.0/0 Target Local Appliance network interface ID Then, in the route table associated with the appliance's subnet, add a route that sends the traffic back to the internet gateway or virtual private gateway. Destination VPC CIDR 0.0.0.0/0 Target Local igw-id Routing inter-subnet traffic to an appliance You can route traffic destined for a specific subnet to the network interface of an appliance. In the following example, the VPC contains two subnets and an appliance. Traffic between the subnets is routed through an appliance. Example routing options 184 Amazon Virtual Private Cloud User Guide Security groups When you route traffic between instances in different subnets through a middlebox appliance, the security groups for both instances must allow traffic to flow between the instances. The security group for each instance must reference the private IP address of the other instance, or the CIDR range of the subnet that contains the other instance, as the source. If you reference the security group of the other instance as the source, this does not allow traffic to flow between the instances. Routing The following is an example route table for subnet A. The first entry enables instances in the VPC to communicate with each other. The second entry routes all traffic from subnet A to subnet B to the network interface of the appliance. Destination VPC CIDR Target Local Subnet B CIDR Appliance network interface ID The following is an example route table for subnet B. The first entry enables instances in the VPC to communicate with each other. The second entry routes all traffic from subnet B to subnet A to the network interface of the appliance. Example routing options 185 Amazon Virtual Private Cloud User Guide Destination VPC CIDR Target Local Subnet A CIDR Appliance network interface ID Alternatively, you can replace the target for the local route with the network interface of the appliance. You can do this to ensure that all traffic is automatically routed to the appliance, including traffic destined for subnets that you add to the VPC in the future. Destination VPC CIDR Target Appliance network interface ID Routing using a prefix list If you frequently reference the same set of CIDR blocks across your AWS resources, you can create a customer-managed prefix list to group them together. You can then specify the prefix list as the destination in your route table entry. You can later add or remove entries for the prefix list without needing to update your route tables. For example, you have a transit gateway with multiple VPC attachments. The VPCs must be able to communicate with two specific VPC attachments that have the following CIDR blocks: • 10.0.0.0/16 • 10.2.0.0/16 You create a prefix list with both entries. In your subnet route tables, you create a route and specify the prefix list as the destination, and the transit gateway as the target. Destination 172.31.0.0/16 pl-123abc123abc123ab Target Local tgw-id Example routing options 186 Amazon Virtual Private Cloud User Guide The maximum number of entries for the prefix lists equals the same number of entries in the route table. Routing to a Gateway Load Balancer endpoint A Gateway Load Balancer enables you to distribute traffic to a fleet of virtual appliances, such as firewalls. You can create a Gateway Load Balancer, configure a Gateway Load Balancer endpoint service, and then create a Gateway Load Balancer endpoint in your VPC to connect it to the service. To route your traffic to the Gateway Load Balancer (for example, for security inspection), specify the Gateway Load Balancer endpoint as a target in your route tables. For an example of a |
vpc-ug-071 | vpc-ug.pdf | 71 | prefix lists equals the same number of entries in the route table. Routing to a Gateway Load Balancer endpoint A Gateway Load Balancer enables you to distribute traffic to a fleet of virtual appliances, such as firewalls. You can create a Gateway Load Balancer, configure a Gateway Load Balancer endpoint service, and then create a Gateway Load Balancer endpoint in your VPC to connect it to the service. To route your traffic to the Gateway Load Balancer (for example, for security inspection), specify the Gateway Load Balancer endpoint as a target in your route tables. For an example of a security appliances behind a Gateway Load Balancer, see the section called “Inspect traffic using security appliances”. To specify the Gateway Load Balancer endpoint in the route table, use the ID of the VPC endpoint. For example to route traffic for 10.0.1.0/24 to a Gateway Load Balancer endpoint, add the following route. Destination 10.0.1.0/24 Target vpc-endpoint-id When using a Gateway Load Balancer endpoint as a target, you cannot specify a prefix list as a destination. If you attempt to create or replace a prefix list route targeting a VPC Endpoint, you'll receive the error: "Cannot create or replace a prefix list route targeting a VPC Endpoint." For more information, see Gateway Load Balancers. Change a subnet route table This section explains how to work with route tables. Note that this section is a grouping of procedures all related to making changes in subnet route table. Contents • Determine the route table for a subnet • Determine which subnets and or gateways are explicitly associated • Create a custom route table • Add and remove routes from a route table Change a subnet route table 187 Amazon Virtual Private Cloud User Guide • Enable or disable route propagation • Change the route table for a subnet • Associate or disassociate a subnet with a route table Determine the route table for a subnet You can determine which route table a subnet is associated with by looking at the subnet details in the Amazon VPC console. To determine the route table for a subnet 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. In the navigation pane, choose Subnets. Select the subnet. 4. Choose the Route table tab to view information about the route table and its routes. To determine whether the association is to the main route table, and if that association is explicit, see Determine which subnets and or gateways are explicitly associated. Determine which subnets and or gateways are explicitly associated You can determine how many and which subnets or gateways are explicitly associated with a route table. The main route table can have explicit and implicit subnet associations. Custom route tables have only explicit associations. Subnets that aren't explicitly associated with any route table have an implicit association with the main route table. You can explicitly associate a subnet with the main route table. For an example of why you might do that, see Replace the main route table. To determine which subnets are explicitly associated using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. In the navigation pane, choose Route tables. 3. Check the Explicit subnet association column to determine the explicitly associated subnets and the Main column to determine whether this is the main route table. 4. Select the route table and choose the Subnet associations tab. Change a subnet route table 188 Amazon Virtual Private Cloud User Guide 5. The subnets under Explicit subnet associations are explicitly associated with the route table. The subnets under Subnets without explicit associations belong to the same VPC as the route table, but are not associated with any route table, so they are implicitly associated with the main route table for the VPC. To determine which gateways are explicitly associated using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. In the navigation pane, choose Route tables. Select the route table and choose the Edge associations tab. To describe one or more route tables and view its associations using the command line • describe-route-tables (AWS CLI) • Get-EC2RouteTable (AWS Tools for Windows PowerShell) Create a custom route table You can create a custom route table for your VPC using the Amazon VPC console. Note There is a quota on the number of route tables that you can create per VPC. There is also a quota on the number of routes that you can add per route table. For more information, see Amazon VPC quotas. To create a custom route table using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. In the navigation pane, choose Route tables. 3. Choose Create route table. 4. 5. 6. (Optional) For Name, enter a name for your route table. For VPC, choose your VPC. (Optional) |
vpc-ug-072 | vpc-ug.pdf | 72 | route table for your VPC using the Amazon VPC console. Note There is a quota on the number of route tables that you can create per VPC. There is also a quota on the number of routes that you can add per route table. For more information, see Amazon VPC quotas. To create a custom route table using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. In the navigation pane, choose Route tables. 3. Choose Create route table. 4. 5. 6. (Optional) For Name, enter a name for your route table. For VPC, choose your VPC. (Optional) To add a tag, choose Add new tag and enter the tag key and tag value. 7. Choose Create route table. Change a subnet route table 189 Amazon Virtual Private Cloud User Guide To create a custom route table using the command line • create-route-table (AWS CLI) • New-EC2RouteTable (AWS Tools for Windows PowerShell) Add and remove routes from a route table You can add, delete, and modify routes in your route tables. You can only modify routes that you've added. For more information about working with static routes for a Site-to-Site VPN connection, see Editing Static Routes for a Site-to-Site VPN Connection in the AWS Site-to-Site VPN User Guide. Note There is a quota on the number of route tables that you can create per VPC. There is also a quota on the number of routes that you can add per route table. For more information, see Amazon VPC quotas. To update the routes for a route table using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. In the navigation pane, choose Route tables, and select the route table. 3. Choose Actions, Edit routes. 4. 5. To add a route, choose Add route. For Destination enter the destination CIDR block, a single IP address, or the ID of a prefix list. To modify a route, for Destination, replace the destination CIDR block or single IP address. For Target, choose a target. 6. To delete a route, choose Remove. 7. Choose Save changes. To update the routes for a route table using the command line • create-route (AWS CLI) • replace-route (AWS CLI) Change a subnet route table 190 Amazon Virtual Private Cloud • delete-route (AWS CLI) • New-EC2Route (AWS Tools for Windows PowerShell) • Set-EC2Route (AWS Tools for Windows PowerShell) • Remove-EC2Route (AWS Tools for Windows PowerShell) User Guide Note If you add a route using a command line tool or the API, the destination CIDR block is automatically modified to its canonical form. For example, if you specify 100.68.0.18/18 for the CIDR block, we create a route with a destination CIDR block of 100.68.0.0/18. Enable or disable route propagation Route propagation allows a virtual private gateway to automatically propagate routes to your route tables. This means that you don't need to manually add or remove VPN routes. To complete this process, you must have a virtual private gateway. For more information, see Site-to-Site VPN routing options in the Site-to-Site VPN User Guide. To enable route propagation using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. In the navigation pane, choose Route tables, and then select the route table. 3. Choose Actions, Edit route propagation. 4. Select the Enable check box next to the virtual private gateway, and then choose Save. To enable route propagation using the command line • enable-vgw-route-propagation (AWS CLI) • Enable-EC2VgwRoutePropagation (AWS Tools for Windows PowerShell) To disable route propagation using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. Change a subnet route table 191 Amazon Virtual Private Cloud User Guide 2. In the navigation pane, choose Route tables, and then select the route table. 3. Choose Actions, Edit route propagation. 4. Clear the Enable check box next to the virtual private gateway, and then choose Save. To disable route propagation using the command line • disable-vgw-route-propagation (AWS CLI) • Disable-EC2VgwRoutePropagation (AWS Tools for Windows PowerShell) Change the route table for a subnet You can change the route table association for a subnet. When you change the route table, your existing connections in the subnet are dropped unless the new route table contains a route for the same traffic to the same target. To change a subnet route table association using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. 4. In the navigation pane, choose Subnets, and then select the subnet. From the Route table tab, choose Edit route table association. For Route table ID, select the new route table. 5. Choose Save. To change the route table associated with a subnet using the command line • replace-route-table-association (AWS CLI) • Set-EC2RouteTableAssociation (AWS Tools for Windows PowerShell) Associate or disassociate a subnet with a route table To apply route table routes to a |
vpc-ug-073 | vpc-ug.pdf | 73 | same traffic to the same target. To change a subnet route table association using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. 4. In the navigation pane, choose Subnets, and then select the subnet. From the Route table tab, choose Edit route table association. For Route table ID, select the new route table. 5. Choose Save. To change the route table associated with a subnet using the command line • replace-route-table-association (AWS CLI) • Set-EC2RouteTableAssociation (AWS Tools for Windows PowerShell) Associate or disassociate a subnet with a route table To apply route table routes to a particular subnet, you must associate the route table with the subnet. A route table can be associated with multiple subnets. However, a subnet can only be associated with one route table at a time. Any subnet not explicitly associated with a table is implicitly associated with the main route table by default. Change a subnet route table 192 Amazon Virtual Private Cloud User Guide You can disassociate a subnet from a route table. Until you associate the subnet with another route table, it's implicitly associated with the main route table. To associate or disassociate a route table with a subnet using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. In the navigation pane, choose Route tables, and then select the route table. 3. On the Subnet associations tab, choose Edit subnet associations. 4. Select or deselect the check box for the subnet to associate with the route table. 5. Choose Save associations. To associate a subnet with a route table using the command line • associate-route-table (AWS CLI) • Register-EC2RouteTable (AWS Tools for Windows PowerShell) To disassociate a subnet from a route table using the command line • disassociate-route-table (AWS CLI) • Unregister-EC2RouteTable (AWS Tools for Windows PowerShell) Replace the main route table This section describes how to change which route table is the main route table in your VPC. To replace the main route table using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. In the navigation pane, choose Route tables, and then select the new main route table. 3. Choose Actions, Set main route table. 4. When prompted for confirmation, enter set, and then choose OK. To replace the main route table using the command line • replace-route-table-association (AWS CLI) • Set-EC2RouteTableAssociation (AWS Tools for Windows PowerShell) Replace the main route table 193 Amazon Virtual Private Cloud User Guide The following procedure describes how to remove an explicit association between a subnet and the main route table. The result is an implicit association between the subnet and the main route table. The process is the same as disassociating any subnet from any route table. To remove an explicit association with the main route table 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. In the navigation pane, choose Route tables, and then select the route table. From the Subnet associations tab, choose Edit subnet associations. 4. Clear the checkbox for the subnet. 5. Choose Save associations. Control traffic entering your VPC with a gateway route table To control traffic entering your VPC with a gateway route table, you can associate or disassociate an internet gateway or a virtual private gateway with a route table. For more information, see Gateway route tables. To associate or disassociate a gateway with a route table using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. 4. In the navigation pane, choose Route tables, and then select the route table. From the Edge associations tab, choose Edit edge associations. Select or deselect the checkbox for the gateway. 5. Choose Save changes. To associate or disassociate a gateway with a route table using the AWS CLI Use the associate-route-table command. The following example associates internet gateway igw-11aa22bb33cc44dd1 with route table rtb-01234567890123456. aws ec2 associate-route-table --route-table-id rtb-01234567890123456 --gateway-id igw-11aa22bb33cc44dd1 To disassociate a gateway from a route table using the command line • disassociate-route-table (AWS CLI) Control traffic entering your VPC with a gateway route table 194 Amazon Virtual Private Cloud User Guide • Unregister-EC2RouteTable (AWS Tools for Windows PowerShell) Replace or restore the target for a local route You can change the target of the default local route. If you replace the target of a local route, you can later restore it to the default local target. If your VPC has multiple CIDR blocks, your route tables have multiple local routes—one per CIDR block. You can replace or restore the target of each of the local routes as needed. To update the local route using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. 4. In the navigation pane, choose Route tables, and then select the route table. From the Routes tab, choose Edit routes. For the local route, clear Target and |
vpc-ug-074 | vpc-ug.pdf | 74 | default local route. If you replace the target of a local route, you can later restore it to the default local target. If your VPC has multiple CIDR blocks, your route tables have multiple local routes—one per CIDR block. You can replace or restore the target of each of the local routes as needed. To update the local route using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. 4. In the navigation pane, choose Route tables, and then select the route table. From the Routes tab, choose Edit routes. For the local route, clear Target and then choose a new target. 5. Choose Save changes. To restore the target for a local route using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. In the navigation pane, choose Route tables, and then select the route table. 3. Choose Actions, Edit routes. 4. For the route, clear Target, and then choose local. 5. Choose Save changes. To replace the target for a local route using the AWS CLI Use the replace-route command. The following example replaces the target of the local route with eni-11223344556677889. aws ec2 replace-route --route-table-id rtb-01234567890123456 --destination-cidr-block 10.0.0.0/16 --network-interface-id eni-11223344556677889 To restore the target for a local route using the AWS CLI The following example restores the local target for route table rtb-01234567890123456. Replace or restore the target for a local route 195 Amazon Virtual Private Cloud User Guide aws ec2 replace-route --route-table-id rtb-01234567890123456 --destination-cidr-block 10.0.0.0/16 --local-target Dynamic routing in your VPC using VPC Route Server Amazon VPC Route Server simplifies routing for traffic between workloads that are deployed within a VPC and its internet gateways. With this feature, VPC Route Server dynamically updates VPC and internet gateway route tables with your preferred IPv4 or IPv6 routes to achieve routing fault tolerance for those workloads. This enables you to automatically reroute traffic within a VPC, which increases the manageability of VPC routing and interoperability with third-party workloads. Route server supports the following route table types: • VPC route tables not associated with subnets • Subnet route tables • Internet gateway route tables Route server does not support route tables associated with virtual private gateways. To propagate routes into a transit gateway route table, use Transit Gateway Connect. Quotas For quotas associated with Amazon VPC Route Server, see Route server quotas. Pricing For information about costs associated with Amazon VPC Route Server, see the VPC Route Server tab on the Amazon VPC pricing page. Contents • Terminology • How Amazon VPC Route Server works • Get started tutorial Terminology The following terms are used in this guide: Dynamic routing in your VPC 196 Amazon Virtual Private Cloud User Guide • FIB: The Forwarding Information Base (FIB) serves as a forwarding table for what route server has determined are the best-path routes in the RIB after evaluating all available routing information and policies. The FIB routes that are installed on the route tables. The FIB is recomputed whenever there are changes to the RIB. • RIB: The Routing Information Base (RIB) serves as a database that stores all the routing information and network topology data collected by a router or routing system, such as routes learned from BGP peers. The RIB is constantly updated as new routing information is received or existing routes change. This ensures that the route server always has the most current view of the network topology and can make optimal routing decisions. • Route server: The route server component updates your VPC and internet gateway route tables with the IPv4 or IPv6 routes in your Forwarding Information Base (FIB). The route server represents a single FIB and Routing Information Base (RIB). • Route server association: A route server association is the connection established between a route server and a VPC. • Route server endpoint: A route server endpoint is an AWS-managed component inside a subnet that facilitates BGP (Border Gateway Protocol) connections between your route server and your BGP peers. • Route server peer: A route server peer is a session between a route server endpoint and the device deployed in AWS (such as a firewall appliance or other network security function running on an EC2 instance). The device must meet these requirements: • Have an elastic network interface in the VPC • Support BGP (Border Gateway Protocol) • Can initiate BGP sessions • Route server propagation: When enabled, route server propagation installs the routes in the FIB on the route table you've specified. Route server supports IPv4 and IPv6 route propagation. How Amazon VPC Route Server works This section explains how Amazon VPC Route Server works and helps you understand how it achieves routing fault tolerance for your workloads running in subnets. Contents • Overview • Diagrams Dynamic routing in your VPC 197 Amazon Virtual Private Cloud Overview How |
vpc-ug-075 | vpc-ug.pdf | 75 | meet these requirements: • Have an elastic network interface in the VPC • Support BGP (Border Gateway Protocol) • Can initiate BGP sessions • Route server propagation: When enabled, route server propagation installs the routes in the FIB on the route table you've specified. Route server supports IPv4 and IPv6 route propagation. How Amazon VPC Route Server works This section explains how Amazon VPC Route Server works and helps you understand how it achieves routing fault tolerance for your workloads running in subnets. Contents • Overview • Diagrams Dynamic routing in your VPC 197 Amazon Virtual Private Cloud Overview How Amazon VPC Route Server works: User Guide 1. You configure a network device (like a firewall running on an EC2 instance in the VPC) to use Amazon VPC Route Server. 2. The network device fails. 3. The route server endpoints detect the failure through BFD (Bidirectional Forwarding Detection) configured on the route server peer. 4. The route server endpoints update the route server to withdraw routes in a Routing Information Base (RIB) where the failed device is the next hop. 5. The route server computes a Forwarding Information Base (FIB) from the RIB, selecting the best available routes. 6. Route server updates the configured route tables with the routes from the FIB. 7. All new traffic is forwarded to the standby device. Diagrams The following is an example diagram of VPC route server with route server endpoints configured for devices in two subnets. Dynamic routing in your VPC 198 Amazon Virtual Private Cloud User Guide Starting with the example above as a baseline, the example below shows a more detailed design, where both Device A and Device B advertise over BGP that they can accept any traffic with a destination IP in the range of 192.0.0.0/24 (from 192.0.0.0 to 192.0.0.255). The MED (Multi-Exit Discriminator) attribute of 0 tells route server that Device A should be preferred over Device B. The route server receives the route and the MED attribute from Device A and installs that route in the subnet route tables with the network interface of Device A as the "next hop". As a result, any traffic within the subnet with a destination IP in the 192.0.0.0/24 range is sent to Device A. Device A then processes the traffic and sends it onward. Traffic within either subnet (10.0.0.0/24 or 10.0.1.0/24) that is bound for 192.0.0.0/24 will be routed to Device A eni-abcd (10.0.0.1) as the next hop. Dynamic routing in your VPC 199 Amazon Virtual Private Cloud User Guide This last example below shows how route server handles failover. While the higher MED attribute tells route server that Device B is less preferred than Device A, if Device A eni-abcd (10.0.0.1) goes down, route server updates the subnet route tables, and traffic to 192.0.0.0/24 is routed to Device B eni-efgh (10.0.1.1) as the next hop. Dynamic routing in your VPC 200 Amazon Virtual Private Cloud User Guide Get started tutorial This tutorial walks you through the process of setting up and configuring VPC Route Server to enable dynamic routing in your VPC. You'll learn how to create and configure all the necessary components, establish BGP peering, and verify proper operation. The tutorial covers everything from initial IAM setup through testing and cleanup. Before beginning this tutorial, ensure you have: • Administrative access to your AWS account • A VPC with at least two subnets where you want to enable dynamic routing • Network devices (like firewalls running on EC2 instances) that support BGP and can serve as route server peer devices • Basic familiarity with BGP concepts and AWS networking The steps can be completed using either the AWS Management Console or AWS CLI. Both methods are provided for each step. Estimated time to complete: 15-30 minutes Dynamic routing in your VPC 201 User Guide Amazon Virtual Private Cloud Steps • Step 1: Configure required IAM Role permissions • Step 2: Create a route server • Step 3: Associate route server with a VPC • Step 4: Create route server endpoints • Step 5: Enable route server propagation • Step 6: Create route server peer • Step 7: Initiate BGP sessions from the devices • Step 8: Cleanup Step 1: Configure required IAM Role permissions To use VPC Route Server, ensure that the IAM user or role you are using has the required IAM permissions. Below is a guide to which permissions are required for each API: { "Version": "2012-10-17", "Statement": [ { "Sid": "CreateRouteServer", "Effect": "Allow", "Action": [ "sns:CreateTopic" ], "Resource": "*" }, { "Sid": "DeleteRouteServer", "Effect": "Allow", "Action": [ "sns:DeleteTopic" ], "Resource": "*" }, { "Sid": "CreateRouteServerEndpoint", "Effect": "Allow", "Action": [ "ec2:CreateNetworkInterface", Dynamic routing in your VPC 202 Amazon Virtual Private Cloud User Guide "ec2:CreateNetworkInterfacePermission", "ec2:CreateSecurityGroup", "ec2:DescribeSecurityGroups", "ec2:AuthorizeSecurityGroupIngress", "ec2:CreateTags", "ec2:DeleteTags" ], "Resource": "*" }, { "Sid": "DeleteRouteServerEndpoint", "Effect": |
vpc-ug-076 | vpc-ug.pdf | 76 | Configure required IAM Role permissions To use VPC Route Server, ensure that the IAM user or role you are using has the required IAM permissions. Below is a guide to which permissions are required for each API: { "Version": "2012-10-17", "Statement": [ { "Sid": "CreateRouteServer", "Effect": "Allow", "Action": [ "sns:CreateTopic" ], "Resource": "*" }, { "Sid": "DeleteRouteServer", "Effect": "Allow", "Action": [ "sns:DeleteTopic" ], "Resource": "*" }, { "Sid": "CreateRouteServerEndpoint", "Effect": "Allow", "Action": [ "ec2:CreateNetworkInterface", Dynamic routing in your VPC 202 Amazon Virtual Private Cloud User Guide "ec2:CreateNetworkInterfacePermission", "ec2:CreateSecurityGroup", "ec2:DescribeSecurityGroups", "ec2:AuthorizeSecurityGroupIngress", "ec2:CreateTags", "ec2:DeleteTags" ], "Resource": "*" }, { "Sid": "DeleteRouteServerEndpoint", "Effect": "Allow", "Action": [ "ec2:DeleteNetworkInterface", "ec2:DeleteSecurityGroup", "ec2:RevokeSecurityGroupIngress", "ec2:CreateTags", "ec2:DeleteTags" ], "Resource": "*" }, { "Sid": "CreateRouteServerPeer", "Effect": "Allow", "Action": [ "ec2:AuthorizeSecurityGroupIngress" ], "Resource": "*" }, { "Sid": "DeleteRouteServerPeer", "Effect": "Allow", "Action": [ "ec2:RevokeSecurityGroupIngress" ], "Resource": "*" } ] } Step 2: Create a route server Complete the steps in this section to create a route server. Dynamic routing in your VPC 203 Amazon Virtual Private Cloud User Guide The route server component updates your VPC and internet gateway route tables with the IPv4 or IPv6 routes in your Forwarding Information Base (FIB). The route server represents a single FIB and Routing Information Base (RIB). AWS Management Console To create a route server 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. In the navigation pane, under Virtual private cloud, choose Route servers. 3. On the Route servers page, choose Create route server. 4. On the Create route server page, configure the following settings: • For Name, enter a name for your route server (e.g., "my-route-server-01"). The name must be 255 characters or less in length. • For Amazon Side ASN, enter a BGP ASN value. This value must be in the range of 1-4294967295. We recommend using a private ASN in the 64512–65534 (16-bit ASN) or 4200000000–4294967294 (32-bit ASN) range. • For Persist routes, choose either Enable or Disable. This option determines whether routes should be maintained after all BGP sessions are terminated: • If enabled: Routes will be preserved in the route server's routing database even if all BGP sessions end • If disabled: Routes will be removed from the routing database when all BGP sessions end • If you enabled persist routes, for Persist duration, enter a value between 1-5 minutes. This duration specifies how long the route server will wait after BGP is re-established to unpersist the routes. For example, if you set it to 1 minute, your device has 1 minute after re-establishing BGP to relearn and advertise its routes before the route server resumes normal functionality. While 1 minute is typically sufficient, you can set up to 5 minutes if your BGP network needs more time to fully re-establish and re-learn all routes. • (Optional) To enable SNS notifications for BGP status changes, toggle the Enable SNS notifications switch. Enabling SNS notifications persists BGP or BFD session status changes on route server peers and maintenance notifications for route server endpoints to an SNS topic provisioned by AWS. For details about these notifications, see the SNS notification details table below. Dynamic routing in your VPC 204 Amazon Virtual Private Cloud User Guide 5. (Optional) To add tags to your route server, scroll down to the Tags - optional section and choose Add new tag. Enter a key and an optional value for each tag. You can add up to 50 tags. 6. Review your settings and choose Create route server. 7. Wait for the route server to be created. Once complete, you will be redirected to the Route servers page, where you can see your new route server listed with a status of Available. Command line Use the following procedure to create a new route server to manage dynamic routing in a VPC. For --amazon-side-asn, enter a BGP ASN value. This value must be in the range of 1-4294967295. We recommend using a private ASN in the 64512–65534 (16-bit ASN) or 4200000000–4294967294 (32-bit ASN) range. 1. Command: aws ec2 create-route-server --amazon-side-asn 65000 Response: { "RouteServer": { "RouteServerId": "rs-1", "AmazonSideAsn": 65000, "State": "pending" } } 2. Wait for the route server to be available. Command: aws ec2 describe-route-servers Response: { "RouteServer": { Dynamic routing in your VPC 205 Amazon Virtual Private Cloud User Guide "RouteServerId": "rs-1", "AmazonSideAsn": 65000, "State": "available" } } SNS notification details The following table shows details about the messages that Amazon VPC Route Server will send using Amazon SNS: Standard fields Message Message attributes (Metadata) When it is sent timestamp eventCode routeServ erEndpointId affectedR outeServe rPeerIds Route Server Endpoint Route server endpoint Format: 2025-02-1 ROUTE_SER VER_ENDPO Affected endpoint ID List of affected peer [ENDPOINT maintenance 7T15:55:00Z INT_MAINT IDs ID] is now undergoing maintenance. BFD and BGP sessions may be impacted. Message BGP for Route Server Peer [PEER ID] is now [UP/DOWN]. ENANCE When it |
vpc-ug-077 | vpc-ug.pdf | 77 | Amazon Virtual Private Cloud User Guide "RouteServerId": "rs-1", "AmazonSideAsn": 65000, "State": "available" } } SNS notification details The following table shows details about the messages that Amazon VPC Route Server will send using Amazon SNS: Standard fields Message Message attributes (Metadata) When it is sent timestamp eventCode routeServ erEndpointId affectedR outeServe rPeerIds Route Server Endpoint Route server endpoint Format: 2025-02-1 ROUTE_SER VER_ENDPO Affected endpoint ID List of affected peer [ENDPOINT maintenance 7T15:55:00Z INT_MAINT IDs ID] is now undergoing maintenance. BFD and BGP sessions may be impacted. Message BGP for Route Server Peer [PEER ID] is now [UP/DOWN]. ENANCE When it is sent Route server peer BGP status change timestamp eventCode Format: 2025-02-1 7T15:55:00Z ROUTE_SER VER_PEER_ BGP_STATU S_CHANGE routeServ erPeerId newBgpSta tus Affected peer ID UP or DOWN Dynamic routing in your VPC 206 Amazon Virtual Private Cloud User Guide Standard fields Message Message attributes (Metadata) When it is sent timestamp eventCode routeServ erPeerId newBfdSta tus BFD for Route Server Route server peer BFD Format: 2025-02-1 ROUTE_SER VER_PEER_ Affected peer ID UP or DOWN Peer [PEER ID] is now [UP/DOWN]. status change 7T15:55:00Z BFD_STATU S_CHANGE Step 3: Associate route server with a VPC Complete the steps in this section to associate the route server with a VPC. A route server association is the connection established between a route server and a VPC. This is a fundamental configuration step that enables the route server to work with appliances in your VPC. When you create a route server association: • It links the route server to a specific VPC. • It enables the route server to interact with route tables within the VPC’s subnets. • It allows the route server to receive and propagate routes within the associated VPC. • It establishes the scope of where the route server can operate. Key aspects of a route server association: • Each route server can be associated with one VPC. Each VPC can have up to 5 separate route server associations by default. For more information about quotas, see Route server quotas. • The association must be created before the route server can manage routes. • The association can be monitored to track its state (such as associating and associated). • The association can be removed (disassociated) if you no longer want the route server to operate in that VPC. Dynamic routing in your VPC 207 Amazon Virtual Private Cloud AWS Management Console Associate a route server with a VPC User Guide 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. In the navigation pane, under Virtual private cloud, choose Route servers. Select the route server you want to associate with a VPC. 4. On the Association tab, choose Associate route server. 5. In the Associate route server dialog box: • The Route server ID field is automatically populated with your selected route server • For VPC ID, choose the VPC you want to associate from the dropdown list 6. Choose Associate route server. 7. Wait for the association to complete. Once finished, the State will show as Associated on the Association tab. Command line Use the following procedure to associate a route server with a VPC. 1. Command: aws ec2 associate-route-server --route-server-id rs-1 --vpc-id vpc-1 Response: { "RouteServerAssociation": { "RouteServerId": "rs-1", "VpcId": "vpc-1", "State": "associating" } } 2. Wait for the association to complete. Command: Dynamic routing in your VPC 208 Amazon Virtual Private Cloud User Guide aws ec2 get-route-server-associations --route-server-id rs-1 Response: { "RouteServerAssociation": { "RouteServerId": "rs-1", "VpcId": "vpc-1", "State": "associated" } } Step 4: Create route server endpoints Complete the steps in this section to create route server endpoints. Create two endpoints per subnet for redundancy. A route server endpoint is an AWS-managed component inside a subnet that facilitates BGP (Border Gateway Protocol) connections between your route server and your BGP peers. Route server endpoints are the "contact points" where your network devices establish BGP sessions with the route server. They're the components that actually handle the BGP connections, while the route server itself manages the routing decisions and route propagation. Note Route server endpoints are charged $0.75 per hour. AWS Management Console To create route server endpoints 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. 4. In the navigation pane, under Virtual private cloud, choose Route servers. Select the route server for which you want to create endpoints. In the lower pane, choose the Route server endpoints tab. Dynamic routing in your VPC 209 Amazon Virtual Private Cloud User Guide 5. Choose Create route server endpoint. 6. On the Create route server endpoint page, configure the following settings: • For Name, enter a descriptive name for your endpoint. • For Route server, confirm that the correct route server is selected. • For Subnet, select the subnet in which you want to create the endpoint. 7. (Optional) To add |
vpc-ug-078 | vpc-ug.pdf | 78 | navigation pane, under Virtual private cloud, choose Route servers. Select the route server for which you want to create endpoints. In the lower pane, choose the Route server endpoints tab. Dynamic routing in your VPC 209 Amazon Virtual Private Cloud User Guide 5. Choose Create route server endpoint. 6. On the Create route server endpoint page, configure the following settings: • For Name, enter a descriptive name for your endpoint. • For Route server, confirm that the correct route server is selected. • For Subnet, select the subnet in which you want to create the endpoint. 7. (Optional) To add tags to your route server endpoint, scroll down to the Tags - optional section and choose Add new tag. Enter a key and an optional value for each tag. 8. Review your settings and choose Create route server endpoint. 9. Wait for the endpoint to be created. Once complete, you will see a success message. 10. Repeat steps 5-9 to create a second endpoint in the same subnet, using a different name. 11. Repeat steps 5-10 for each subnet where you need route server endpoints. 12. After creating the endpoints, return to the Route server endpoints tab for your route server. 13. Verify that you see two endpoints listed for each subnet. 14. Check that the State for each endpoint is Available. Command line Use the following procedure to create a route server endpoint. 1. Command: aws ec2 create-route-server-endpoint --route-server-id rs-1 --subnet-id subnet-1 Response: { "RouteServerEndpoint": { "RouteServerId": "rs-1", "RouteServerEndpointId": "rse-1", "VpcId": "vpc-1", "SubnetId": "subnet-1", "State": "pending" } } Dynamic routing in your VPC 210 Amazon Virtual Private Cloud User Guide 2. You may need to wait a few minutes for the endpoints to become fully available after creation. Command: aws ec2 describe-route-server-endpoints Response: { "RouteServerEndpoint": { "RouteServerId": "rs-1", "RouteServerEndpointId": "rse-1", "VpcId": "vpc-1", "SubnetId": "subnet-1", "EniId": "eni-123", "EniAddress": "10.1.2.3", "State": "available" } } Repeat the steps to create a second endpoint in the same subnet using a different name and create endpoints for each subnet where you need route server endpoints. Step 5: Enable route server propagation Complete this step to enable route server propagation. When enabled, route server propagation installs the routes in the FIB on the route table you've specified. Route server supports IPv4 and IPv6 route propagation. Route server propagation is the mechanism that automates route table updates - instead of manually updating route tables, the route server automatically propagates the appropriate routes to the configured route tables with routes from the FIB. Key aspects of route server propagation: • Configuration • Links a route server to specific route tables Dynamic routing in your VPC 211 Amazon Virtual Private Cloud User Guide • Determines which route tables will receive dynamic route updates • Can be enabled or disabled per route table • Functionality • Automatically updates route tables with routes learned from BGP peers • Propagates the best available routes based on BGP attributes • Maintains route consistency across specified route tables • Updates routes dynamically when network conditions change • States • Can be enabled (routes are being propagated) • Can be disabled (routes are not being propagated) AWS Management Console To enable route server propagation 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. Select the route server for which you want to enable propagation. 3. Choose the Propagations tab in the route server details panel. 4. Choose Enable propagation. 5. In the Enable propagation dialog: • The Route server ID will be pre-populated. • Under Route table, select the destination route table from the dropdown menu for newly propagated routes. 6. Choose Enable propagation to confirm. 7. Wait for the propagation status to change to Available in the Propagations list. 8. Verify that the selected route table appears in the Propagations list with a state of Available. Command line Use the following procedure to enable route server propagation. 1. Command: Dynamic routing in your VPC 212 Amazon Virtual Private Cloud User Guide aws ec2 enable-route-server-propagation --route-table-id rtb-1 --route-server-id rs-1 Response: { "RouteServerRoutePropagation": { "RouteServerId": "rs-1", "RouteTableId": "rtb-1", "State": "pending" } } 2. Wait for the propagation state to change to available. Command: aws ec2 get-route-server-propagations --route-server-id rs-1 Response: { "RouteServerRoutePropagation": { "RouteServerId": "rs-1", "RouteTableId": "rtb-1", "State": "available" } } Step 6: Create route server peer A route server peer is a session between a route server endpoint and the device deployed in AWS (such as a firewall appliance or other network security function running on an EC2 instance). The device must meet these requirements: • Have an elastic network interface in the VPC • Support BGP (Border Gateway Protocol) • Can initiate BGP sessions Dynamic routing in your VPC 213 Amazon Virtual Private Cloud User Guide Note We recommend you create one route server peer per route server endpoint for redundancy. AWS Management Console |
vpc-ug-079 | vpc-ug.pdf | 79 | "rtb-1", "State": "available" } } Step 6: Create route server peer A route server peer is a session between a route server endpoint and the device deployed in AWS (such as a firewall appliance or other network security function running on an EC2 instance). The device must meet these requirements: • Have an elastic network interface in the VPC • Support BGP (Border Gateway Protocol) • Can initiate BGP sessions Dynamic routing in your VPC 213 Amazon Virtual Private Cloud User Guide Note We recommend you create one route server peer per route server endpoint for redundancy. AWS Management Console To create a route server peer 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. In the navigation path, choose VPC > Route server peers > Create route server peer. 3. Under Details, configure the following: • Name: Enter a name for your route server peer (up to 255 characters). Example: my- route-server-peer-01 • Route server endpoint ID: Choose a route server endpoint from the dropdown. Optionally, choose Create a route server endpoint to create a new one. • Peer address: Enter the IPv4 address of the peer. Must be a valid IP address. The peer address must be reachable from the route server endpoint. • Peer ASN: Enter the ASN (Autonomous System Number) for the BGP peer. Value must be in range of 1-4294967295. The ASN should typically use private ranges (64512-65534 for 16-bit or 4200000000-4294967294 for 32-bit) • Peer liveness detection: • BGP keepalive (default): Standard BGP keep alive mechanism • BFD: Bidirectional Forwarding Detection for faster failover • (Optional) Under Tags, choose Add new tag to add key-value pair tags. Tags help identify and track AWS resources. 4. Review your settings and choose Create route server peer. Command line Use the following procedure to create a route server peer. 1. Command: Dynamic routing in your VPC 214 Amazon Virtual Private Cloud User Guide aws ec2 create-route-server-peer --route-server-endpoint-id rse-1 --peer-address 10.0.2.3 --bgp-options PeerAsn=65001,PeerLivenessDetection=bfd Response: In the response, the state values can be pending|available|deleting|deleted. { "RouteServerPeer": { "RouteServerPeerId": "rsp-1", "RouteServerId": "rs-1", "VpcId": "vpc-1", "SubnetId": "subnet-1", "State": "pending", "EndpointEniId": "eni-2, "EndpointEniAddress": "10.0.2.4", "PeerEniId": "eni-1", "PeerAddress": "10.0.2.3", "BgpOptions": { "PeerAsn": 65001, "PeerLivenessDetection": "bfd" }, "BgpStatus": { "Status": "Up" } } } 2. Wait for the propagation state to change to available. Command: aws ec2 describe-route-server-peers Response: { "RouteServerPeer": { "RouteServerPeerId": "rsp-1", "RouteServerId": "rs-1", "VpcId": "vpc-1", Dynamic routing in your VPC 215 Amazon Virtual Private Cloud User Guide "SubnetId": "subnet-1", "State": "available", "EndpointEniId": "eni-2, "EndpointEniAddress": "10.0.2.4", "PeerEniId": "eni-1", "PeerAddress": "10.0.2.3", "BgpOptions": { "PeerAsn": 65001, "PeerLivenessDetection": "bfd" }, "BgpStatus": { "Status": "down" } } } Step 7: Initiate BGP sessions from the devices When the status of route server peer is available, configure your workload to initiate the BGP session with the route server endpoint. Initiating a BGP session from the devices in your subnets is outside the scope of this guide. The route server endpoint does not initiate the BGP session. You can check that the VPC Route Server feature is working by verifying that the route table contains the best routes propagated by route server. Step 8: Cleanup The building portion of the tutorial is complete. Complete the steps in this section to remove the VPC Route Server components that you created. 7.1: Withdraw BGP advertisement on the devices Withdrawing BGP advertisement on the devices in your subnets is outside the scope of this guide. Refer to your third-party vendor for your BGP configurations as needed. 7.2: Disable route server propagation Use the following procedure to disable route server propagation. Dynamic routing in your VPC 216 Amazon Virtual Private Cloud AWS Management Console User Guide 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. Select the route server for which you want to disable propagation. 3. Choose Actions > Modify route server. 4. Choose the Propagations tab in the route server details panel. 5. Choose the propagation you want to disable and then choose Disable propagation. 6. In the dialog box, choose Disable route server propagation. Command line 1. Disable propagation: aws ec2 disable-route-server-route-propagation --route-table-id rtb-1 --route- server-id rs-1 2. Confirm that the propagation has been deleted: aws ec2 get-route-server-route-propagations --route-server-id rs-1 [--route- table-id rtb-1] 7.3: Delete route server peers Use the following procedure to delete route server peers. AWS Management Console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. In the navigation path, choose Route servers > Route server peers. Select a route server peer. 4. Choose Actions > Delete route server peer. Command line 1. Delete peers: Dynamic routing in your VPC 217 Amazon Virtual Private Cloud User Guide aws ec2 delete-route-server-peer --route-server-peer-id rsp-1 2. Confirm the deletion: aws ec2 describe-route-server-peers [--route-server-peer-ids rsp-1] [--filters Key=RouteServerId|RouteServerEndpointId|VpcId] 7.4: Delete route server endpoints Use the following procedure to delete route server endpoints. AWS Management Console 1. Open the Amazon VPC |
vpc-ug-080 | vpc-ug.pdf | 80 | the following procedure to delete route server peers. AWS Management Console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. In the navigation path, choose Route servers > Route server peers. Select a route server peer. 4. Choose Actions > Delete route server peer. Command line 1. Delete peers: Dynamic routing in your VPC 217 Amazon Virtual Private Cloud User Guide aws ec2 delete-route-server-peer --route-server-peer-id rsp-1 2. Confirm the deletion: aws ec2 describe-route-server-peers [--route-server-peer-ids rsp-1] [--filters Key=RouteServerId|RouteServerEndpointId|VpcId] 7.4: Delete route server endpoints Use the following procedure to delete route server endpoints. AWS Management Console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. Select the route server for which you want to delete endpoints. 3. Choose Route server endpoints. 4. 5. Select the endpoint and choose Actions > Delete route server endpoint. Enter delete and choose Delete. Command line 1. Describe endpoints: aws ec2 describe-route-server-endpoints 2. Delete route server endpoints: aws ec2 delete-route-server-endpoint --route-server-endpoint-id rse-1 3. Confirm that the endpoints have been deleted: aws ec2 describe-route-server-endpoints [--route-server-endpoint-ids rsp-1] [-- filters Key=RouteServerId|VpcId|SubnetId] 7.5: Disassociate route server from VPC Dynamic routing in your VPC 218 Amazon Virtual Private Cloud User Guide Use the following procedure to disassociate the route server from the VPC. AWS Management Console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. Select the route server for which you want to disassociate. 3. Choose Association. 4. Choose Disassociate route server. 5. Confirm the changes that will be made and choose Disassociate route server. Command line 1. Disassociate route server from the VPC: aws ec2 disassociate-route-server --route-server-id rs-1 --vpc-id vpc-1 2. Confirm the disassociation: aws ec2 get-route-server-associations --route-server-id rs-1 7.6 Delete route server Use the following procedure to delete the route server. AWS Management Console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. Select the route server to delete. 3. Choose Actions > Delete route server. 4. Enter delete and choose Delete. Command line 1. Delete route server: Dynamic routing in your VPC 219 Amazon Virtual Private Cloud User Guide aws ec2 delete-route-server --route-server-id rs-1 2. Confirm the deletion: aws ec2 describe-route-servers [--route-server-ids rs-1] [--filters Key=VpcId] The Amazon VPC Route Server tutorial is complete. Troubleshoot reachability issues Reachability Analyzer is a static configuration analysis tool. Use Reachability Analyzer to analyze and debug network reachability between two resources in your VPC. Reachability Analyzer produces hop-by-hop details of the virtual path between these resources when they are reachable, and identifies the blocking component otherwise. For example, it can identify missing or misconfigured route table routes. For more information, see the Reachability Analyzer Guide. Middlebox routing wizard If you want to configure fine-grain control over the routing path of traffic entering or leaving your VPC, for example, by redirecting traffic to a security appliance, you can use the middlebox routing wizard in the VPC console. The middlebox routing wizard helps you by automatically creating the necessary route tables and routes (hops) to redirect traffic as needed. The middlebox routing wizard can help you configure routing for the following scenarios: • Routing traffic to a middlebox appliance, for example, an Amazon EC2 instance that's configured as a security appliance. • Routing traffic to a Gateway Load Balancer. For more information, see the User Guide for Gateway Load Balancers. For more information, see the section called “Middlebox scenarios”. Contents • Middlebox routing wizard prerequisites Troubleshoot reachability issues 220 Amazon Virtual Private Cloud User Guide • Redirect VPC traffic to a security appliance • Middlebox routing wizard considerations • Middlebox scenarios Middlebox routing wizard prerequisites Review the section called “Middlebox routing wizard considerations”. Then, make sure that you have the following information before you use the middlebox routing wizard. • The VPC. • The resource where traffic originates from or enters the VPC, for example, an internet gateway, virtual private gateway, or network interface. • The middlebox network interface or Gateway Load Balancer endpoint. • The destination subnet for the traffic. Redirect VPC traffic to a security appliance The middlebox routing wizard is available in the Amazon Virtual Private Cloud Console. Contents • 1. Create routes using the middlebox routing wizard • 2. Modify middlebox routes • 3. Delete the middlebox routing wizard configuration 1. Create routes using the middlebox routing wizard To create routes using the middlebox routing wizard 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. In the navigation pane, choose Your VPCs. Select your VPC, and then choose Actions, Manage middlebox routes. 4. Choose Create routes. 5. On the Specify routes page, do the following: Middlebox routing wizard prerequisites 221 Amazon Virtual Private Cloud User Guide • For Source, choose the source for your traffic. If you choose a virtual private gateway, for Destination IPv4 CIDR, enter the CIDR for the on-premises traffic entering the VPC from the virtual private gateway. • For Middlebox, choose the network interface ID |
vpc-ug-081 | vpc-ug.pdf | 81 | routes using the middlebox routing wizard 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. In the navigation pane, choose Your VPCs. Select your VPC, and then choose Actions, Manage middlebox routes. 4. Choose Create routes. 5. On the Specify routes page, do the following: Middlebox routing wizard prerequisites 221 Amazon Virtual Private Cloud User Guide • For Source, choose the source for your traffic. If you choose a virtual private gateway, for Destination IPv4 CIDR, enter the CIDR for the on-premises traffic entering the VPC from the virtual private gateway. • For Middlebox, choose the network interface ID that is associated with your middlebox appliance, or when you use a Gateway Load Balancer endpoint, choose the VPC endpoint ID. • For Destination subnet, choose the destination subnet. 6. (Optional) To add another destination subnet, choose Add additional subnet, and then do the following: • For Middlebox, choose the network interface ID that is associated with your middlebox appliance, or when you use a Gateway Load Balancer endpoint, choose the VPC endpoint ID. You must use the same middlebox appliance for multiple subnets. • For Destination subnet, choose the destination subnet. 7. (Optional) To add another source, choose Add source, and then repeat the previous steps. 8. Choose Next. 9. On the Review and create page, verify the routes and then choose Create routes. 2. Modify middlebox routes You can edit your route configuration by changing the gateway, the middlebox, or the destination subnet. When you make any modifications, the middlebox routing wizard automatically perform the following operations: • Creates new route tables for the gateway, middlebox, and destination subnet. • Adds the necessary routes to the new route tables. • Disassociates the current route tables that the middlebox routing wizard associated with the resources. • Associates the new route tables that the middlebox routing wizard creates with the resources. To modify middlebox routes using the middlebox routing wizard 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. Redirect VPC traffic to a security appliance 222 Amazon Virtual Private Cloud User Guide 2. 3. In the navigation pane, choose Your VPCs. Select your VPC, and then choose Actions, Manage middlebox routes. 4. Choose Edit routes. 5. To change the gateway, for Source, choose the gateway through which traffic enters your VPC. If you choose a virtual private gateway, for Destination IPv4 CIDR, enter the destination subnet CIDR. 6. To add another destination subnet, choose Add additional subnet, and then do the following: • For Middlebox, choose the network interface ID that is associated with your middlebox appliance, or when you use a Gateway Load Balancer endpoint, choose the VPC endpoint ID. You must use the same middlebox appliance for multiple subnets. • For Destination subnet, choose the destination subnet. 7. Choose Next. 8. On the Review and update page, a list of route tables and their routes that will be created by the middlebox routing wizard is displayed. Verify the routes, and then in the confirmation dialog box, choose Update routes. 3. Delete the middlebox routing wizard configuration If you decide that you no longer want the middlebox routing wizard configuration, you must manually delete the route tables. To delete the middlebox routing wizard configuration 1. View the middlebox routing wizard route tables. After you perform the operation, the route tables that the middlebox routing wizard created are displayed on a separate route table page. 2. Delete each route table that is displayed. Middlebox routing wizard considerations Take the following into consideration when you use the middlebox routing wizard: • If you want to inspect traffic, you can use an internet gateway or a virtual private gateway for the source. Middlebox routing wizard considerations 223 Amazon Virtual Private Cloud User Guide • If you use the same middlebox in a multiple middlebox configuration within the same VPC, make sure that the middlebox is in the same hop position for both subnets. • The appliance must be configured in a separate subnet from the source or destination subnet. • You must disable source/destination checking on the appliance. For more information, see Changing the Source or Destination Checking in the Amazon EC2 User Guide. • The route tables and routes that the middlebox routing wizard creates count toward your quotas. For more information, see the section called “Route tables”. • If you delete a resource, for example a network interface, the route table associations with the resource are removed. If the resource is a target, the route destination is set to blackhole. The route tables are not deleted. • The middlebox subnet and the destination subnet must be associated with a non-default route table. Note We recommend that you use the middlebox routing wizard to modify or delete any route tables that you created using the middlebox routing wizard. • If you |
vpc-ug-082 | vpc-ug.pdf | 82 | middlebox routing wizard creates count toward your quotas. For more information, see the section called “Route tables”. • If you delete a resource, for example a network interface, the route table associations with the resource are removed. If the resource is a target, the route destination is set to blackhole. The route tables are not deleted. • The middlebox subnet and the destination subnet must be associated with a non-default route table. Note We recommend that you use the middlebox routing wizard to modify or delete any route tables that you created using the middlebox routing wizard. • If you use middlebox routing to route through a security appliance, security group referencing between the source and ultimate destination after inspection is not supported. Middlebox scenarios Amazon Virtual Private Cloud (VPC) provides a wide range of networking capabilities that allow you to customize and control the routing of traffic within your virtual network. One such feature is the middlebox routing wizard, which enables fine-grained control over the routing path of traffic entering or leaving your VPC. If you need to redirect traffic to a security appliance, load balancer, or other network device for inspection, monitoring, or optimization purposes, the middlebox routing wizard can simplify the process. This wizard automatically creates the necessary route tables and routes (hops) to redirect the specified traffic as needed, eliminating the manual effort required to set up complex routing configurations. The middlebox routing wizard supports several different scenarios. For example, you can use it to inspect traffic destined for a particular subnet, configure middlebox traffic routing and inspection across your entire VPC, or selectively inspect traffic between specific subnets. This granular control Middlebox scenarios 224 Amazon Virtual Private Cloud User Guide over traffic routing allows you to implement advanced security policies, enable centralized network monitoring, or optimize the performance of your cloud-based applications. The following examples describe scenarios for the middlebox routing wizard. Contents • Inspect traffic destined for a subnet • Configure middlebox traffic routing and inspection in a VPC • Inspect traffic between subnets Inspect traffic destined for a subnet Consider the scenario where you have traffic coming into the VPC through an internet gateway and you want to inspect all traffic that is destined for a subnet, say subnet B, using a firewall appliance installed on an EC2 instance. The firewall appliance should be installed and configured on an EC2 instance in a separate subnet from subnet B in your VPC, say subnet C. You can then use the middlebox routing wizard to configure routes for traffic between subnet B and the internet gateway. The middlebox routing wizard, automatically performs the following operations: • Creates the following route tables: • A route table for the internet gateway • A route table for the destination subnet • A route table for the middlebox subnet • Adds the necessary routes to the new route tables as described in the following sections. • Disassociates the current route tables associated with the internet gateway, subnet B, and subnet C. • Associates route table A with the internet gateway (the Source in the middlebox routing wizard), route table C with subnet C (the Middlebox in the middlebox routing wizard), and route table B with subnet B (the Destination in the middlebox routing wizard). • Creates a tag that indicates it was created by the middlebox routing wizard, and a tag that indicates the creation date. The middlebox routing wizard does not modify your existing route tables. It creates new route tables, and then associates them with your gateway and subnet resources. If your resources Middlebox scenarios 225 Amazon Virtual Private Cloud User Guide are already explicitly associated with existing route tables, the existing route tables are first disassociated, and then the new route tables are associated with your resources. Your existing route tables are not deleted. If you do not use the middlebox routing wizard, you must manually configure, and then assign the route tables to the subnets and internet gateway. Internet gateway route table Add the following routes to the route table for the internet gateway. Destination 10.0.0.0/16 Target Local Purpose Local route for IPv4 10.0.1.0/24 appliance-eni Route IPv4 traffic destined for subnet B to the middlebox 2001:db8:1234:1a00 Local Local route for IPv6 ::/56 2001:db8:1234:1a00 appliance-eni ::/64 Middlebox scenarios Route IPv6 traffic destined for subnet B to the middlebox 226 Amazon Virtual Private Cloud User Guide There is an edge association between the internet gateway and the VPC. When you use the middlebox routing wizard, it associates the following tags with the route table: • The key is "Origin" and the value is "Middlebox wizard" • The key is "date_created" and the value is the creation time (for example, "2021-02-18T22:25:49.137Z") Destination subnet route table Add the following routes to the route table for the destination subnet (subnet |
vpc-ug-083 | vpc-ug.pdf | 83 | 2001:db8:1234:1a00 Local Local route for IPv6 ::/56 2001:db8:1234:1a00 appliance-eni ::/64 Middlebox scenarios Route IPv6 traffic destined for subnet B to the middlebox 226 Amazon Virtual Private Cloud User Guide There is an edge association between the internet gateway and the VPC. When you use the middlebox routing wizard, it associates the following tags with the route table: • The key is "Origin" and the value is "Middlebox wizard" • The key is "date_created" and the value is the creation time (for example, "2021-02-18T22:25:49.137Z") Destination subnet route table Add the following routes to the route table for the destination subnet (subnet B in the example diagram). Destination 10.0.0.0/16 Target Local Purpose Local route for IPv4 0.0.0.0/0 appliance-eni Route IPv4 traffic destined for the internet to the middlebox 2001:db8:1234:1a00 Local Local route for IPv6 ::/56 ::/0 appliance-eni Route IPv6 traffic destined for the internet to the middlebox There is a subnet association with the middlebox subnet. When you use the middlebox routing wizard, it associates the following tags with the route table: • The key is "Origin" and the value is "Middlebox wizard" • The key is "date_created" and the value is the creation time (for example, "2021-02-18T22:25:49.137Z") Middlebox subnet route table Add the following routes to the route table for the middlebox subnet (subnet C in the example diagram). Middlebox scenarios 227 Amazon Virtual Private Cloud User Guide Destination 10.0.0.0/16 0.0.0.0/0 Target Local igw-id Purpose Local route for IPv4 Route IPv4 traffic to the internet gateway 2001:db8:1234:1a00 Local Local route for IPv6 ::/56 ::/0 eigw-id Route IPv6 traffic to the egress-only internet gateway There is a subnet association with the destination subnet. When you use the middlebox routing wizard, it associates the following tags with the route table: • The key is "Origin" and the value is "Middlebox wizard" • The key is "date_created" and the value is the creation time (for example, "2021-02-18T22:25:49.137Z") Configure middlebox traffic routing and inspection in a VPC Consider the scenario where you need to inspect the traffic entering a VPC from the internet gateway and destined for a subnet, using a fleet of security appliances configured behind a Gateway Load Balancer. The owner of the service consumer VPC creates a Gateway Load Balancer endpoint in a subnet in their VPC (represented by an endpoint network interface). All traffic entering the VPC through the internet gateway is first routed to the Gateway Load Balancer endpoint for inspection before it's routed to the application subnet. Similarly, all traffic leaving the application subnet is first routed to Gateway Load Balancer endpoint for inspection before it is routed to the internet. The middlebox routing wizard automatically performs the following operations: • Creates the route tables. • Adds the necessary routes to the new route tables. • Disassociates the current route tables associated with the subnets. Middlebox scenarios 228 Amazon Virtual Private Cloud User Guide • Associates the route tables that the middlebox routing wizard creates with the subnets. • Creates a tag that indicates it was created by the middlebox routing wizard, and a tag that indicates the creation date. The middlebox routing wizard does not modify your existing route tables. It creates new route tables, and then associates them with your gateway and subnet resources. If your resources are already explicitly associated with existing route tables, the existing route tables are first disassociated, and then the new route tables are associated with your resources. Your existing route tables are not deleted. If you do not use the middlebox routing wizard, you must manually configure, and then assign the route tables to the subnets and internet gateway. Internet gateway route table The route table for the internet gateway has the following routes. Destination Consumer VPC CIDR Target Local Purpose Local route Application subnet endpoint-id CIDR Routes traffic destined for the applicati on subnet to the Gateway Load Balancer endpoint Middlebox scenarios 229 Amazon Virtual Private Cloud User Guide There is an edge association with the gateway. When you use the middlebox routing wizard, it associates the following tags with the route table: • The key is "Origin" and the value is "Middlebox wizard" • The key is "date_created" and the value is the creation time (for example, "2021-02-18T22:25:49.137Z") Application subnet route table The route table for the application subnet has the following routes. Destination Consumer VPC CIDR Target Local Purpose Local route 0.0.0.0/0 endpoint-id Route traffic from the application servers to the Gateway Load Balancer endpoint before it is routed to the internet When you use the middlebox routing wizard, it associates the following tags with the route table: • The key is "Origin" and the value is "Middlebox wizard" • The key is "date_created" and the value is the creation time (for example, "2021-02-18T22:25:49.137Z") Provider subnet route table The route table for the provider subnet has the following |
vpc-ug-084 | vpc-ug.pdf | 84 | subnet route table The route table for the application subnet has the following routes. Destination Consumer VPC CIDR Target Local Purpose Local route 0.0.0.0/0 endpoint-id Route traffic from the application servers to the Gateway Load Balancer endpoint before it is routed to the internet When you use the middlebox routing wizard, it associates the following tags with the route table: • The key is "Origin" and the value is "Middlebox wizard" • The key is "date_created" and the value is the creation time (for example, "2021-02-18T22:25:49.137Z") Provider subnet route table The route table for the provider subnet has the following routes. Destination Provider VPC CIDR Target Local Purpose Local route. Ensures that traffic originati ng from the internet is routed to the application servers 0.0.0.0/0 igw-id Routes all traffic to the internet gateway Middlebox scenarios 230 Amazon Virtual Private Cloud User Guide When you use the middlebox routing wizard, it associates the following tags with the route table: • The key is "Origin" and the value is "Middlebox wizard" • The key is "date_created" and the value is the creation time (for example, "2021-02-18T22:25:49.137Z") Inspect traffic between subnets Consider the scenario where you have multiple subnets in a VPC and you want to inspect the traffic between them using a firewall appliance. Configure and install the firewall appliance on an EC2 instance in a separate subnet in your VPC. The following diagram shows a firewall appliance installed on an EC2 instance in subnet C. The appliance inspects all traffic that travels from subnet A to subnet B (see 1) and from subnet B to subnet A (see 2). Middlebox scenarios 231 Amazon Virtual Private Cloud User Guide You use the main route table for the VPC and the middlebox subnet. Subnets A and B each have a custom route table. The middlebox routing wizard, automatically performs the following operations: • Creates the route tables. • Adds the necessary routes to the new route tables. • Disassociates the current route tables associated with the subnets. • Associates the route tables that the middlebox routing wizard creates with the subnets. Middlebox scenarios 232 Amazon Virtual Private Cloud User Guide • Creates a tag that indicates it was created by the middlebox routing wizard, and a tag that indicates the creation date. The middlebox routing wizard does not modify your existing route tables. It creates new route tables, and then associates them with your gateway and subnet resources. If your resources are already explicitly associated with existing route tables, the existing route tables are first disassociated, and then the new route tables are associated with your resources. Your existing route tables are not deleted. If you do not use the middlebox routing wizard, you must manually configure, and then assign the route tables to the subnets and internet gateway. Custom route table for subnet A The route table for subnet A has the following routes. Destination VPC CIDR Target Local Purpose Local route Subnet B CIDR appliance-eni Route traffic destined for subnet B to the middlebox When you use the middlebox routing wizard, it associates the following tags with the route table: • The key is "Origin" and the value is "Middlebox wizard" • The key is "date_created" and the value is the creation time (for example, "2021-02-18T22:25:49.137Z") Custom route table for subnet B The route table for subnet B has the following routes. Destination VPC CIDR Middlebox scenarios Target Local Purpose Local route 233 Amazon Virtual Private Cloud User Guide Destination Target Purpose Subnet A CIDR appliance-eni Route traffic destined for subnet A to the middlebox When you use the middlebox routing wizard, it associates the following tags with the route table: • The key is "Origin" and the value is "Middlebox wizard" • The key is "date_created" and the value is the creation time (for example, "2021-02-18T22:25:49.137Z") Main route table Subnet C uses the main route table. The main route table has the following route. Destination VPC CIDR Target Local Purpose Local route When you use the middlebox routing wizard, it associates the following tags with the route table: • The key is "Origin" and the value is "Middlebox wizard" • The key is "date_created" and the value is the creation time (for example, "2021-02-18T22:25:49.137Z") Delete a subnet If you no longer need a subnet, you can delete it. You cannot delete a subnet if it contains any network interfaces. For example, you must terminate any instances in a subnet before you can delete it. When you delete a subnet, the CIDR block associated with that subnet is returned to the VPC's available IP address pool. This means that the IP addresses within the subnet's CIDR range can be reallocated to other subnets or resources within the same VPC. Delete a subnet 234 Amazon Virtual Private Cloud User Guide It's important |
vpc-ug-085 | vpc-ug.pdf | 85 | time (for example, "2021-02-18T22:25:49.137Z") Delete a subnet If you no longer need a subnet, you can delete it. You cannot delete a subnet if it contains any network interfaces. For example, you must terminate any instances in a subnet before you can delete it. When you delete a subnet, the CIDR block associated with that subnet is returned to the VPC's available IP address pool. This means that the IP addresses within the subnet's CIDR range can be reallocated to other subnets or resources within the same VPC. Delete a subnet 234 Amazon Virtual Private Cloud User Guide It's important to note that deleting a subnet does not automatically delete the resources within it. You must first terminate any EC2 instances, delete any network interfaces, and remove any other resources associated with the subnet before you can proceed with the subnet deletion. To delete a subnet using the console 1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/. 2. Terminate all instances in the subnet. For more information, see Terminate your instance in the Amazon EC2 User Guide. 3. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 4. 5. In the navigation pane, choose Subnets. Select the subnet and choose Actions, Delete subnet. 6. When prompted for confirmation, type delete and then choose Delete. To delete a subnet using the AWS CLI Use the delete-subnet command. Delete a subnet 235 Amazon Virtual Private Cloud User Guide Connect your VPC to other networks You can connect your virtual private cloud (VPC) to other networks, such as other VPCs, the internet, or your on-premises network. You can connect your virtual private cloud (VPC) to other networks, such as other VPCs, the internet, or your on-premises network. The diagram demonstrates some of these connectivity options. VPC A is connected to the internet through an internet gateway, and the EC2 instance in the private subnet can connect to the internet using a NAT gateway in the public subnet. VPC B is also connected to the internet, but through a direct internet gateway, allowing the EC2 instance in the public subnet to access the internet. 236 Amazon Virtual Private Cloud User Guide Moreover, VPC A and VPC B are connected to each other through a VPC peering connection and a transit gateway. The transit gateway has a VPN attachment to a data center, and VPC B has an AWS Direct Connect connection to the same data center. This interconnectivity enables organizations to integrate their cloud resources with on-premises infrastructure, creating a hybrid cloud environment. Connecting VPCs to other networks is an important aspect of building cloud infrastructure within AWS. It offers organizations flexibility and control over their networking configurations, allowing them to design VPC architectures that align with their business requirements and security needs. These connectivity options facilitate efficient data flow between various components of a distributed IT landscape, whether they are within the cloud or on-premises. AWS provides a range of tools and features to enable these VPC connections, including internet gateways, NAT gateways, VPC peering, transit gateways, and AWS Direct Connect. By leveraging these capabilities, organizations can create secure and integrated cloud environments that seamlessly integrate with their existing IT infrastructure. You can connect your virtual private cloud (VPC) to other networks. For example, other VPCs, the internet, or your on-premises network. For more information, see Amazon Virtual Private Cloud Connectivity Options. Contents • Enable internet access for a VPC using an internet gateway • Enable outbound IPv6 traffic using an egress-only internet gateway • Connect to the internet or other networks using NAT devices • Associate Elastic IP addresses with resources in your VPC • Connect your VPC to other VPCs and networks using a transit gateway • Connect your VPC to remote networks using AWS Virtual Private Network • Connect VPCs using VPC peering Enable internet access for a VPC using an internet gateway An internet gateway is a horizontally scaled, redundant, and highly available VPC component that allows communication between your VPC and the internet. It supports IPv4 and IPv6 traffic. It does not cause availability risks or bandwidth constraints on your network traffic. Internet gateways 237 Amazon Virtual Private Cloud User Guide An internet gateway enables resources in your public subnets (such as EC2 instances) to connect to the internet if the resource has a public IPv4 address or an IPv6 address. Similarly, resources on the internet can initiate a connection to resources in your subnet using the public IPv4 address or IPv6 address. For example, an internet gateway enables you to connect to an EC2 instance in AWS using your local computer. An internet gateway provides a target in your VPC route tables for internet-routable traffic. For communication using IPv4, the internet gateway also performs network address translation (NAT). For more information, see IP addresses and NAT. Pricing There is |
vpc-ug-086 | vpc-ug.pdf | 86 | (such as EC2 instances) to connect to the internet if the resource has a public IPv4 address or an IPv6 address. Similarly, resources on the internet can initiate a connection to resources in your subnet using the public IPv4 address or IPv6 address. For example, an internet gateway enables you to connect to an EC2 instance in AWS using your local computer. An internet gateway provides a target in your VPC route tables for internet-routable traffic. For communication using IPv4, the internet gateway also performs network address translation (NAT). For more information, see IP addresses and NAT. Pricing There is no charge for an internet gateway, but there are data transfer charges for EC2 instances that use internet gateways. For more information, see Amazon EC2 On-Demand Pricing. Contents • Internet gateway basics • Add internet access to a subnet • Delete an internet gateway Internet gateway basics To use an internet gateway, you must attach it to a VPC and configure routing. Routing configuration If a subnet is associated with a route table that has a route to an internet gateway, it's known as a public subnet. If a subnet is associated with a route table that does not have a route to an internet gateway, it's known as a private subnet. In your public subnet's route table, you can specify a route for the internet gateway to all destinations not explicitly known to the route table (0.0.0.0/0 for IPv4 or ::/0 for IPv6). Alternatively, you can scope the route to a narrower range of IP addresses; for example, the public IPv4 addresses of your company’s public endpoints outside of AWS, or the Elastic IP addresses of other Amazon EC2 instances outside your VPC. Internet gateway diagram In the following diagram, the subnet in Availability Zone A is a public subnet because its route table has a route that sends all internet-bound IPv4 traffic to the internet gateway. The instances Internet gateway basics 238 Amazon Virtual Private Cloud User Guide in the public subnet must have public IP addresses or Elastic IP addresses to enable communication with the internet over the internet gateway. For comparison, the subnet in Availability Zone B is a private subnet because its route table does not have a route to the internet gateway. Because there is no route to the internet gateway, instances in the private subnet can't communicate with the internet, even if they have public IP addresses. IP addresses and NAT To enable communication over the internet for IPv4, your instance must have a public IPv4 address. You can either configure your VPC to automatically assign public IPv4 addresses to your instances, or you can assign Elastic IP addresses to your instances. Your instance is only aware of the private (internal) IP address space defined within the VPC and subnet. The internet gateway logically provides the one-to-one NAT on behalf of your instance, so that when traffic leaves your VPC subnet and goes to the internet, the reply address field is set to the public IPv4 address or Elastic IP address of your instance, and not its private IP address. Conversely, traffic that's destined for the Internet gateway basics 239 Amazon Virtual Private Cloud User Guide public IPv4 address or Elastic IP address of your instance has its destination address translated into the instance's private IPv4 address before the traffic is delivered to the VPC. To enable communication over the internet for IPv6, your VPC and subnet must have an associated IPv6 CIDR block, and your instance must be assigned an IPv6 address from the range of the subnet. IPv6 addresses are globally unique, and therefore public by default. Internet access for default and nondefault VPCs The following table provides an overview of whether your VPC automatically comes with the components required for internet access over IPv4 or IPv6. Component Default VPC Nondefault VPC Internet gateway Route table with route to internet gateway for IPv4 traffic (0.0.0.0/0) Route table with route to internet gateway for IPv6 traffic (::/0) Yes Yes No No No No Public IPv4 address automatic ally assigned to instance launched into subnet IPv6 address automatically assigned to instance launched into subnet Yes (default subnet) No (nondefault subnet) No (default subnet) No (nondefault subnet) Add internet access to a subnet The following describes how to support internet access from a subnet in a nondefault VPC using an internet gateway. You must create the internet gateway, attach it to the VPC, and configure routing for the subnet. Create an internet gateway 240 Amazon Virtual Private Cloud User Guide After you configure internet access for your subnet, you must ensure that resources in the subnet can access the internet. For example, your EC2 instances must have a public IPv4 or IPv6 address, and the security groups for your instances must allow specific traffic |
vpc-ug-087 | vpc-ug.pdf | 87 | No (nondefault subnet) Add internet access to a subnet The following describes how to support internet access from a subnet in a nondefault VPC using an internet gateway. You must create the internet gateway, attach it to the VPC, and configure routing for the subnet. Create an internet gateway 240 Amazon Virtual Private Cloud User Guide After you configure internet access for your subnet, you must ensure that resources in the subnet can access the internet. For example, your EC2 instances must have a public IPv4 or IPv6 address, and the security groups for your instances must allow specific traffic to and from the internet. Alternatively, to provide your instances with internet access without assigning them a public IP address, use a NAT device instead. For more information, see NAT devices. To remove internet access, you can detach the internet gateway from your VPC and then delete it. For more information, see the section called “Delete an internet gateway”. Tasks • Step 1: Create an internet gateway • Step 2: Attach the internet gateway to the VPC • Step 3: Add a route to the subnet route table Step 1: Create an internet gateway Use the following procedure to create an internet gateway. To create an internet gateway using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. In the navigation pane, choose Internet gateways. 3. Choose Create internet gateway. 4. 5. (Optional) Enter a name for your internet gateway. (Optional) To add a tag, choose Add new tag and enter the tag key and value. 6. Choose Create internet gateway. 7. (Optional) To attach the internet gateway to a VPC now, choose Attach to a VPC from the banner at the top of the screen, select an available VPC, and then choose Attach internet gateway. Otherwise, you can attach your internet gateway to a VPC at another time. To create an internet gateway using the command line • create-internet-gateway (AWS CLI) • New-EC2InternetGateway (AWS Tools for Windows PowerShell) Create an internet gateway 241 Amazon Virtual Private Cloud User Guide Step 2: Attach the internet gateway to the VPC To use an internet gateway, you must attach it to a VPC. To attach an internet gateway to a VPC using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. 4. 5. In the navigation pane, choose Internet gateways. Select the check box for the internet gateway. To attach it, choose Actions, Attach to VPC, select an available VPC, and choose Attach internet gateway. To detach it, choose Actions, Detach from VPC and choose Detach internet gateway. When prompted for confirmation, choose Detach internet gateway. To attach an internet gateway to a VPC using the command line • attach-internet-gateway (AWS CLI) • Add-EC2InternetGateway (AWS Tools for Windows PowerShell) Step 3: Add a route to the subnet route table The route table for the subnet must have a route that sends internet traffic to the internet gateway. To configure the subnet route table using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. In the navigation pane, choose Route tables. Select the route table for the subnet. By default, a subnet uses the main route table for the VPC. Alternatively, you can create a custom route table and then associate the subnet with the new route table. 4. On the Routes tab, choose Edit routes and then choose Add route. 5. Enter 0.0.0.0/0 for Destination and select the internet gateway for Target. 6. Choose Save changes. Create an internet gateway 242 Amazon Virtual Private Cloud User Guide To configure the subnet route table using the command line • create-route (AWS CLI) • New-EC2Route (AWS Tools for Windows PowerShell) Delete an internet gateway If you no longer need internet access for a VPC, you can detach the internet gateway from the VPC and then delete it. You can't delete an internet gateway if it's still attached to a VPC. You can't detach an internet gateway if the VPC has resources with associated public IP addresses or Elastic IP addresses. To detach an internet gateway from a VPC using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. 4. 5. In the navigation pane, choose Internet gateways. Select the check box for the internet gateway. To attach it, choose Actions, Attach to VPC, select an available VPC, and choose Attach internet gateway. To detach it, choose Actions, Detach from VPC and choose Detach internet gateway. When prompted for confirmation, choose Detach internet gateway. To describe your internet gateways, including attachments, using the command line • describe-internet-gateways (AWS CLI) • Get-EC2InternetGateway (AWS Tools for Windows PowerShell) To detach an internet gateway from a VPC using the command line • detach-internet-gateway (AWS CLI) • Dismount-EC2InternetGateway (AWS Tools for Windows PowerShell) To delete an internet gateway |
vpc-ug-088 | vpc-ug.pdf | 88 | pane, choose Internet gateways. Select the check box for the internet gateway. To attach it, choose Actions, Attach to VPC, select an available VPC, and choose Attach internet gateway. To detach it, choose Actions, Detach from VPC and choose Detach internet gateway. When prompted for confirmation, choose Detach internet gateway. To describe your internet gateways, including attachments, using the command line • describe-internet-gateways (AWS CLI) • Get-EC2InternetGateway (AWS Tools for Windows PowerShell) To detach an internet gateway from a VPC using the command line • detach-internet-gateway (AWS CLI) • Dismount-EC2InternetGateway (AWS Tools for Windows PowerShell) To delete an internet gateway using the console 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. In the navigation pane, choose Internet gateways. Delete an internet gateway 243 Amazon Virtual Private Cloud User Guide 3. Select the check box for the internet gateway. 4. Choose Actions, Delete internet gateway. 5. When prompted for confirmation, enter delete, and then choose Delete internet gateway. To delete an internet gateway using the command line • delete-internet-gateway (AWS CLI) • Remove-EC2InternetGateway (AWS Tools for Windows PowerShell) Enable outbound IPv6 traffic using an egress-only internet gateway An egress-only internet gateway is a horizontally scaled, redundant, and highly available VPC component that allows outbound communication over IPv6 from instances in your VPC to the internet, and prevents the internet from initiating an IPv6 connection with your instances. An egress-only internet gateway is for use with IPv6 traffic only. To enable outbound-only internet communication over IPv4, use a NAT gateway instead. For more information, see NAT gateways. Pricing There is no charge for an egress-only internet gateway, but there are data transfer charges for EC2 instances that use internet gateways. For more information, see Amazon EC2 On-Demand Pricing. Contents • Egress-only internet gateway basics • Add egress-only internet access to a subnet Egress-only internet gateway basics IPv6 addresses are globally unique, and are therefore public by default. If you want your instance to be able to access the internet, but you want to prevent resources on the internet from initiating communication with your instance, you can use an egress-only internet gateway. To do this, create an egress-only internet gateway in your VPC, and then add a route to your route table that points all IPv6 traffic (::/0) or a specific range of IPv6 address to the egress-only internet gateway. IPv6 Egress-only internet gateways 244 Amazon Virtual Private Cloud User Guide traffic in the subnet that's associated with the route table is routed to the egress-only internet gateway. An egress-only internet gateway is stateful: it forwards traffic from the instances in the subnet to the internet or other AWS services, and then sends the response back to the instances. You can't associate a security group with an egress-only internet gateway to control the traffic that is allowed to reach or leave the egress-only internet gateway. You can use a network ACL to control the traffic to and from the subnet for which the egress-only internet gateway routes traffic. In the following diagram, the VPC has both IPv4 and IPv6 CIDR blocks, and the subnet both IPv4 and IPv6 CIDR blocks. The VPC has an egress-only internet gateway. The following is an example of the route table associated with the subnet. There is a route that sends all internet-bound IPv6 traffic (::/0) to the egress-only internet gateway. Destination 10.0.0.0/16 2001:db8:1234:1a00:/64 ::/0 Target Local Local eigw-id Egress-only internet gateway basics 245 Amazon Virtual Private Cloud User Guide Add egress-only internet access to a subnet The following tasks describe how to create an egress-only (outbound) internet gateway for your private subnet and to configure routing for the subnet. Tasks • 1. Create an egress-only internet gateway • 2. Create a custom route table • 3. Delete an egress-only internet gateway • Command line overview 1. Create an egress-only internet gateway You can create an egress-only internet gateway for your VPC using the Amazon VPC console. To create an egress-only internet gateway 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. In the navigation pane, choose Egress Only Internet Gateways. 3. Choose Create Egress Only Internet Gateway. 4. (Optional) Add or remove a tag. [Add a tag] Choose Add new tag and do the following: • For Key, enter the key name. • For Value, enter the key value. [Remove a tag] Choose Remove to the right of the tag’s Key and Value. 5. Select the VPC in which to create the egress-only internet gateway. 6. Choose Create. 2. Create a custom route table To send traffic destined outside the VPC to the egress-only internet gateway, you must create a custom route table, add a route that sends traffic to the gateway, and then associate it with your subnet. Add egress-only internet access to a subnet 246 Amazon Virtual Private Cloud User Guide To create a |
vpc-ug-089 | vpc-ug.pdf | 89 | For Key, enter the key name. • For Value, enter the key value. [Remove a tag] Choose Remove to the right of the tag’s Key and Value. 5. Select the VPC in which to create the egress-only internet gateway. 6. Choose Create. 2. Create a custom route table To send traffic destined outside the VPC to the egress-only internet gateway, you must create a custom route table, add a route that sends traffic to the gateway, and then associate it with your subnet. Add egress-only internet access to a subnet 246 Amazon Virtual Private Cloud User Guide To create a custom route table and add a route to the egress-only internet gateway 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. In the navigation pane, choose Route Tables, Create route table. In the Create route table dialog box, optionally name your route table, then select your VPC and choose Create route table. 4. Select the custom route table that you just created. The details pane displays tabs for working with its routes, associations, and route propagation. 5. On the Routes tab, choose Edit routes, specify ::/0 in the Destination box, select the egress- only internet gateway ID in the Target list, and then choose Save changes. 6. On the Subnet associations tab, choose Edit subnet associations, and select the check box for the subnet. Choose Save. Alternatively, you can add a route to an existing route table that's associated with your subnet. Select your existing route table, and follow steps 5 and 6 above to add a route for the egress-only internet gateway. For more information about route tables, see Configure route tables. 3. Delete an egress-only internet gateway If you no longer need an egress-only internet gateway, you can delete it. Any route in a route table that points to the deleted egress-only internet gateway remains in a blackhole status until you manually delete or update the route. To delete an egress-only internet gateway 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. In the navigation pane, choose Egress Only Internet Gateways, and select the egress-only internet gateway. 3. Choose Delete. 4. Choose Delete Egress Only Internet Gateway in the confirmation dialog box. Command line overview You can perform the tasks described on this page using the command line. Add egress-only internet access to a subnet 247 Amazon Virtual Private Cloud User Guide Create an egress-only internet gateway • create-egress-only-internet-gateway (AWS CLI) • New-EC2EgressOnlyInternetGateway (AWS Tools for Windows PowerShell) Describe an egress-only internet gateway • describe-egress-only-internet-gateways (AWS CLI) • Get-EC2EgressOnlyInternetGatewayList (AWS Tools for Windows PowerShell) Delete an egress-only internet gateway • delete-egress-only-internet-gateway (AWS CLI) • Remove-EC2EgressOnlyInternetGateway (AWS Tools for Windows PowerShell) Connect to the internet or other networks using NAT devices You can use a NAT device to allow resources in private subnets to connect to the internet, other VPCs, or on-premises networks. These instances can communicate with services outside the VPC, but they cannot receive unsolicited connection requests. For example, the following diagram shows a NAT device in a public subnet that allows the EC2 instances in a private subnet to connect to the internet through an internet gateway. The NAT device replaces the source IPv4 address of the instances with the address of the NAT device. When sending response traffic to the instances, the NAT device translates the addresses back to the original source IPv4 addresses. NAT devices 248 Amazon Virtual Private Cloud User Guide Important • We use the term NAT in this documentation to follow common IT practice, though the actual role of a NAT device is both address translation and port address translation (PAT). • You can use a managed NAT device offered by AWS, called a NAT gateway, or you can create your own NAT device on an EC2 instance, called a NAT instance. We recommend that you use NAT gateways because they provide better availability and bandwidth and require less effort on your part to administer. Contents • NAT gateways • NAT instances • Compare NAT gateways and NAT instances NAT devices 249 Amazon Virtual Private Cloud NAT gateways User Guide A NAT gateway is a Network Address Translation (NAT) service. You can use a NAT gateway so that instances in a private subnet can connect to services outside your VPC but external services can't initiate a connection with those instances. When you create a NAT gateway, you specify one of the following connectivity types: • Public – (Default) Instances in private subnets can connect to the internet through a public NAT gateway, but the instances can't receive unsolicited inbound connections from the internet. You create a public NAT gateway in a public subnet and must associate an elastic IP address with the NAT gateway at creation. You route traffic from the NAT gateway to the internet gateway for the VPC. |
vpc-ug-090 | vpc-ug.pdf | 90 | a private subnet can connect to services outside your VPC but external services can't initiate a connection with those instances. When you create a NAT gateway, you specify one of the following connectivity types: • Public – (Default) Instances in private subnets can connect to the internet through a public NAT gateway, but the instances can't receive unsolicited inbound connections from the internet. You create a public NAT gateway in a public subnet and must associate an elastic IP address with the NAT gateway at creation. You route traffic from the NAT gateway to the internet gateway for the VPC. Alternatively, you can use a public NAT gateway to connect to other VPCs or your on- premises network. In this case, you route traffic from the NAT gateway through a transit gateway or a virtual private gateway. • Private – Instances in private subnets can connect to other VPCs or your on-premises network through a private NAT gateway, but the instances can't receive unsolicited inbound connections from the other VPCs or the on-premises network. You can route traffic from the NAT gateway through a transit gateway or a virtual private gateway. You can't associate an elastic IP address with a private NAT gateway. You can attach an internet gateway to a VPC with a private NAT gateway, but if you route traffic from the private NAT gateway to the internet gateway, the internet gateway drops the traffic. A NAT gateway is for use with IPv4 or IPv6 traffic (using DNS64 and NAT64 ). Another option for enabling outbound-only internet communication over IPv6 is using an egress-only internet gateway. Both private and public NAT gateways map the source private IPv4 address of the instances to the private IPv4 address of the NAT gateway, but in the case of a public NAT gateway, the internet gateway then maps the private IPv4 address of the public NAT gateway to the Elastic IP address associated with the NAT gateway. When sending response traffic to the instances, whether it's a public or private NAT gateway, the NAT gateway translates the address back to the original source IP address. Important Connections must always be initiated from within the VPC containing the NAT Gateway. NAT gateways 250 Amazon Virtual Private Cloud User Guide You can use either a public or private NAT gateway to route traffic to transit gateways and virtual private gateways. If you use a private NAT gateway to connect to a transit gateway or virtual private gateway, traffic to the destination will come from the private IP address of the private NAT gateway. If you use a public NAT gateway to connect to a transit gateway or virtual private gateway, traffic to the destination will come from the private IP address of the public NAT gateway. The public NAT gateway will only use its EIP as the source IP address when used in conjunction with an internet gateway in the same VPC. NAT gateways support traffic with a maximum transmission unit (MTU) of 8500. For more information, see NAT gateway basics. Contents • NAT gateway basics • Work with NAT gateways • NAT gateway use cases • DNS64 and NAT64 • Monitor NAT gateways with Amazon CloudWatch • Troubleshoot NAT gateways • Pricing for NAT gateways NAT gateway basics Each NAT gateway is created in a specific Availability Zone and implemented with redundancy in that zone. There is a quota on the number of NAT gateways that you can create in each Availability Zone. For more information, see Amazon VPC quotas. If you have resources in multiple Availability Zones and they share one NAT gateway, and if the NAT gateway’s Availability Zone is down, resources in the other Availability Zones lose internet access. To improve resiliency, create a NAT gateway in each Availability Zone, and configure your routing to ensure that resources use the NAT gateway in the same Availability Zone. The following characteristics and rules apply to NAT gateways: • A NAT gateway supports the following protocols: TCP, UDP, and ICMP. NAT gateways 251 Amazon Virtual Private Cloud User Guide • NAT gateways are supported for IPv4 or IPv6 traffic. For IPv6 traffic, NAT gateway performs NAT64. By using this in conjunction with DNS64 (available on Route 53 resolver), your IPv6 workloads in a subnet in Amazon VPC can communicate with IPv4 resources. These IPv4 services may be present in the same VPC (in a separate subnet) or a different VPC, on your on-premises environment or on the internet. • A NAT gateway supports 5 Gbps of bandwidth and automatically scales up to 100 Gbps. If you require more bandwidth, you can split your resources into multiple subnets and create a NAT gateway in each subnet. • A NAT gateway can process one million packets per second and automatically scales up to ten |
vpc-ug-091 | vpc-ug.pdf | 91 | DNS64 (available on Route 53 resolver), your IPv6 workloads in a subnet in Amazon VPC can communicate with IPv4 resources. These IPv4 services may be present in the same VPC (in a separate subnet) or a different VPC, on your on-premises environment or on the internet. • A NAT gateway supports 5 Gbps of bandwidth and automatically scales up to 100 Gbps. If you require more bandwidth, you can split your resources into multiple subnets and create a NAT gateway in each subnet. • A NAT gateway can process one million packets per second and automatically scales up to ten million packets per second. Beyond this limit, a NAT gateway will drop packets. To prevent packet loss, split your resources into multiple subnets and create a separate NAT gateway for each subnet. • Each IPv4 address can support up to 55,000 simultaneous connections to each unique destination. A unique destination is identified by a unique combination of destination IP address, the destination port, and protocol (TCP/UDP/ICMP). You can increase this limit by associating up to 8 IPv4 addresses to your NAT gateways (1 primary IPv4 address and 7 secondary IPv4 addresses). You are limited to associating 2 Elastic IP addresses to your public NAT gateway by default. You can increase this limit by requesting a quota adjustment. For more information, see Elastic IP addresses. • You can pick the private IPv4 address to assign to the NAT gateway or have it automatically assigned from the IPv4 address range of the subnet. The assigned private IPv4 address persists until you delete the private NAT gateway. You can't detach the private IPv4 address and you can't attach additional private IPv4 addresses. • You can't associate a security group with a NAT gateway. You can associate security groups with your instances to control inbound and outbound traffic. • You can use a network ACL to control the traffic to and from the subnet for your NAT gateway. NAT gateways use ports 1024–65535. For more information, see Control subnet traffic with network access control lists. • A NAT gateway receives a network interface. You can pick the private IPv4 address to assign to the interface or have it automatically assigned from the IPv4 address range of the subnet. You can view the network interface for the NAT gateway using the Amazon EC2 console. For more information, see Viewing details about a network interface. You can't modify the attributes of this network interface. • You can't route traffic to a NAT gateway through a VPC peering connection. NAT gateways 252 Amazon Virtual Private Cloud User Guide • You can't route traffic to a NAT gateway from Site-to-Site VPN or Direct Connect using a virtual private gateway. You can route traffic to a NAT gateway from Site-to-Site VPN or Direct Connect if you use a transit gateway instead of a virtual private gateway. • NAT gateways support traffic with a maximum transmission unit (MTU) of 8500, but it's important to note the following: • The MTU of a network connection is the size, in bytes, of the largest permissible packet that can be passed over the connection. The larger the MTU of a connection, the more data that can be passed in a single packet. • Packets larger than 8500 bytes that arrive at the NAT gateway are dropped (or fragmented, if applicable). • To prevent potential packet loss when communicating with resources over the internet using a public NAT gateway, the MTU setting for your EC2 instances should not exceed 1500 bytes. For more information about checking and setting the MTU on an instance, see Check and set the MTU on your Linux instance in the Amazon EC2 User Guide. • NAT gateways support Path MTU Discovery (PMTUD) via FRAG_NEEDED ICMPv4 packets and Packet Too Big (PTB) ICMPv6 packets. • NAT gateways enforce Maximum Segment Size (MSS) clamping for all packets. For more information, see RFC879. Work with NAT gateways You can use the Amazon VPC console to create and manage your NAT gateways. Tasks • Control the use of NAT gateways • Create a NAT gateway • Edit secondary IP address associations • Tag a NAT gateway • Delete a NAT gateway • Command line overview NAT gateways 253 Amazon Virtual Private Cloud Control the use of NAT gateways User Guide By default, users do not have permission to work with NAT gateways. You can create an IAM role with a policy attached that grants users permissions to create, describe, and delete NAT gateways. For more information, see Identity and access management for Amazon VPC. Create a NAT gateway Use the following procedure to create a NAT gateway. Related quotas • You won't be able to create a public NAT gateway if you've exhausted the number of EIPs allocated to your account. For more |
vpc-ug-092 | vpc-ug.pdf | 92 | line overview NAT gateways 253 Amazon Virtual Private Cloud Control the use of NAT gateways User Guide By default, users do not have permission to work with NAT gateways. You can create an IAM role with a policy attached that grants users permissions to create, describe, and delete NAT gateways. For more information, see Identity and access management for Amazon VPC. Create a NAT gateway Use the following procedure to create a NAT gateway. Related quotas • You won't be able to create a public NAT gateway if you've exhausted the number of EIPs allocated to your account. For more information on EIP quotas and how to adjust them, see Elastic IP addresses. • You can assign up to 8 private IPv4 addresses to your private NAT gateway. This limit is not adjustable. • You are limited to associating 2 Elastic IP addresses to your public NAT gateway by default. You can increase this limit by requesting a quota adjustment. For more information, see Elastic IP addresses. To create a NAT gateway 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. In the navigation pane, choose NAT gateways. 3. Choose Create NAT gateway. 4. 5. 6. (Optional) Specify a name for the NAT gateway. This creates a tag where the key is Name and the value is the name that you specify. Select the subnet in which to create the NAT gateway. For Connectivity type, leave the default Public selection to create a public NAT gateway or choose Private to create a private NAT gateway. For more information about the difference between a public and private NAT gateway, see NAT gateways. 7. If you chose Public, do the following; otherwise, skip to step 8: 1. Choose an Elastic IP allocation ID to assign an EIP to the NAT gateway or choose Allocate Elastic IP to automatically allocate an EIP for the public NAT gateway. You are limited to NAT gateways 254 Amazon Virtual Private Cloud User Guide associating 2 Elastic IP addresses to your public NAT gateway by default. You can increase this limit by requesting a quota adjustment. For more information, see Elastic IP addresses. Important When you assign an EIP to a public NAT gateway, the network border group of the EIP must match the network border group of the Availability Zone (AZ) that you're launching the public NAT gateway into. If it's not the same, the NAT gateway will fail to launch. You can see the network border group for the subnet's AZ by viewing the details of the subnet. Similarly, you can view the network border group of an EIP by viewing the details of the EIP address. For more information about network border groups and EIPs, see 1. Allocate an Elastic IP address. 2. (Optional) Choose Additional settings and, under Private IP address - optional, enter a private IPv4 address for the NAT gateway. If you don't enter an address, AWS will automatically assign a private IPv4 address to your NAT gateway at random from the subnet that your NAT gateway is in. 3. Skip to step 11. 8. If you chose Private, for Additional settings, Private IPv4 address assigning method, choose one of the following: • Auto-assign: AWS chooses the primary private IPv4 address for the NAT gateway. For Number of auto-assigned private IPv4 addresses, you can optionally specify the number of secondary private IPv4 addresses for the NAT gateway. AWS chooses these IP addresses at random from the subnet for your NAT gateway. • Custom: For Primary private IPv4 address, choose the primary private IPv4 address for the NAT gateway. For Secondary private IPv4 addresses, you can optionally specify up to 7 secondary private IPv4 addresses for the NAT gateway. 9. If you chose Custom in Step 8, skip this step. If you chose Auto-assign, under Number of auto-assigned private IP addresses, choose the number of secondary IPv4 addresses that you want AWS assign to this private NAT gateway. You can choose up to 7 IPv4 addresses. Note Secondary IPv4 addresses are optional and should be assigned or allocated when your workloads that use a NAT gateway exceed 55,000 concurrent connections to a single destination (the same destination IP, destination port, and protocol). Secondary IPv4 NAT gateways 255 Amazon Virtual Private Cloud User Guide addresses increase the number of available ports, and therefore they increase the limit on the number of concurrent connections that your workloads can establish using a NAT gateway. 10. If you chose Auto-assign in Step 9, skip this step. If you chose Custom, do the following: 1. Under Primary private IPv4 address, enter a private IPv4 address. 2. Under Secondary private IPv4 address, enter up to 7 secondary private IPv4 addresses. 11. (Optional) To add a tag to the NAT gateway, choose Add new tag and enter the key |
vpc-ug-093 | vpc-ug.pdf | 93 | Secondary IPv4 NAT gateways 255 Amazon Virtual Private Cloud User Guide addresses increase the number of available ports, and therefore they increase the limit on the number of concurrent connections that your workloads can establish using a NAT gateway. 10. If you chose Auto-assign in Step 9, skip this step. If you chose Custom, do the following: 1. Under Primary private IPv4 address, enter a private IPv4 address. 2. Under Secondary private IPv4 address, enter up to 7 secondary private IPv4 addresses. 11. (Optional) To add a tag to the NAT gateway, choose Add new tag and enter the key name and value. You can add up to 50 tags. 12. Choose Create a NAT gateway. 13. The initial status of the NAT gateway is Pending. After the status changes to Available, the NAT gateway is ready for you to use. Be sure to update your route tables as needed. For examples, see the section called “Use cases”. If the status of the NAT gateway changes to Failed, there was an error during creation. For more information, see NAT gateway creation fails. Edit secondary IP address associations Each IPv4 address can support up to 55,000 simultaneous connections to each unique destination. A unique destination is identified by a unique combination of destination IP address, the destination port, and protocol (TCP/UDP/ICMP). You can increase this limit by associating up to 8 IPv4 addresses to your NAT gateways (1 primary IPv4 address and 7 secondary IPv4 addresses). You are limited to associating 2 Elastic IP addresses to your public NAT gateway by default. You can increase this limit by requesting a quota adjustment. For more information, see Elastic IP addresses. You can use the NAT gateway CloudWatch metrics ErrorPortAllocation and PacketsDropCount to determine if your NAT gateway is generating port allocation errors or dropping packets. To resolve this issue, add secondary IPv4 addresses to your NAT gateway. Considerations • You can add secondary private IPv4 addresses when you create a private NAT gateway or after you create the NAT gateway using the procedure in this section. You can add secondary EIP addresses to public NAT gateways only after you create the NAT gateway by using the procedure in this section. NAT gateways 256 Amazon Virtual Private Cloud User Guide • Your NAT gateway can have up to 8 IPv4 addresses associated with it (1 primary IPv4 address and 7 secondary IPv4 addresses). You can assign up to 8 private IPv4 addresses to your private NAT gateway. You are limited to associating 2 Elastic IP addresses to your public NAT gateway by default. You can increase this limit by requesting a quota adjustment. For more information, see Elastic IP addresses. To edit secondary IPv4 address associations 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. In the navigation pane, choose NAT gateways. Select the NAT gateway whose secondary IPv4 address associations you want to edit. 4. Choose Actions, and then choose Edit secondary IP address associations. 5. If you are editing the secondary IPv4 address associations of a private NAT gateway, under Action, choose Assign new IPv4 addresses or Unassign existing IPv4 addresses. If you are editing the secondary IPv4 address associations of a public NAT gateway, under Action, choose Associate new IPv4 addresses or Disassociate existing IPv4 addresses. 6. Do one of the following: • If you chose to assign or associate new IPv4 addresses, do the following: 1. This step is required. You must select a private IPv4 address. Choose the Private IPv4 address assigning method: • Auto-assign: AWS automatically chooses a primary private IPv4 address and you choose if you want AWS to assign up to 7 secondary private IPv4 addresses to assign to the NAT gateway. AWS automatically chooses and assigns them for you at random from the subnet that your NAT gateway is in. • Custom: Choose the primary private IPv4 address and up to 7 secondary private IPv4 addresses to assign to the NAT gateway. 2. Under Elastic IP allocation ID, choose an EIP to add as a secondary IPv4 address. This step is required. You must select an EIP along with a private IPv4 address. If you chose Custom for the Private IP address assigning method, you also must enter a private IPv4 address for each EIP that you add. NAT gateways 257 Amazon Virtual Private Cloud User Guide Important When you assign a secondary EIP to a public NAT gateway, the network border group of the EIP must match the network border group of the Availability Zone (AZ) that the public NAT gateway is in. If it's not the same, the EIP will fail to assign. You can see the network border group for the subnet's AZ by viewing the details of the subnet. Similarly, you can view the network border group of an |
vpc-ug-094 | vpc-ug.pdf | 94 | method, you also must enter a private IPv4 address for each EIP that you add. NAT gateways 257 Amazon Virtual Private Cloud User Guide Important When you assign a secondary EIP to a public NAT gateway, the network border group of the EIP must match the network border group of the Availability Zone (AZ) that the public NAT gateway is in. If it's not the same, the EIP will fail to assign. You can see the network border group for the subnet's AZ by viewing the details of the subnet. Similarly, you can view the network border group of an EIP by viewing the details of the EIP address. For more information about network border groups and EIPs, see 1. Allocate an Elastic IP address. Your NAT gateway can have up to 8 IP addresses associated with it. If this is a public NAT gateway, there is a default quota limit for EIPs per Region. For more information, see Elastic IP addresses. • If you chose to unassign or disassociate new IPv4 addresses, complete the following: 1. Under Existing secondary IP address to unassign, select the secondary IP addresses that you want to unassign. 2. (optional) Under Connection drain duration, enter the maximum amount of time to wait (in seconds) before forcibly releasing the IP addresses if connections are still in progress. If you don't enter a value, the default value is 350 seconds. 7. Choose Save changes. If the status of the NAT gateway changes to Failed, there was an error during creation. For more information, see NAT gateway creation fails. Tag a NAT gateway You can tag your NAT gateway to help you identify it or categorize it according to your organization's needs. For information about working with tags, see Tagging your Amazon EC2 resources in the Amazon EC2 User Guide. Cost allocation tags are supported for NAT gateways. Therefore, you can also use tags to organize your AWS bill and reflect your own cost structure. For more information, see Using cost allocation tags in the AWS Billing User Guide. For more information about setting up a cost allocation report with tags, see Monthly cost allocation report in About AWS Account Billing. NAT gateways 258 Amazon Virtual Private Cloud To tag a NAT gateway User Guide 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. In the navigation pane, choose NAT gateways. Select the NAT gateway that you want to tag and choose Actions. Then choose Manage tags. 4. Choose Add new tag, and define a Key and Value for the tag. You can add up to 50 tags. 5. Choose Save. Delete a NAT gateway If you no longer need a NAT gateway, you can delete it. After you delete a NAT gateway, its entry remains visible in the Amazon VPC console for about an hour, after which it's automatically removed. You can't remove this entry yourself. Deleting a NAT gateway disassociates its Elastic IP address, but does not release the address from your account. If you delete a NAT gateway, the NAT gateway routes remain in a blackhole status until you delete or update the routes. To delete a NAT gateway 1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 2. 3. In the navigation pane, choose NAT gateways. Select the radio button for the NAT gateway, and then choose Actions, Delete NAT gateway. 4. When prompted for confirmation, enter delete and then choose Delete. 5. If you no longer need the Elastic IP address that was associated with a public NAT gateway, we recommend that you release it. For more information, see 5. Release an Elastic IP address. Command line overview You can perform the tasks described on this page using the command line. Assign a private IPv4 address to a private NAT gateway • assign-private-nat-gateway-address (AWS CLI) • Register-EC2PrivateNatGatewayAddress (AWS Tools for Windows PowerShell) NAT gateways 259 Amazon Virtual Private Cloud User Guide Associate Elastic IP addresses (EIPs) and private IPv4 addresses with a public NAT gateway • associate-nat-gateway-address (AWS CLI) • Register-EC2NatGatewayAddress (AWS Tools for Windows PowerShell) Create a NAT gateway • create-nat-gateway (AWS CLI) • New-EC2NatGateway (AWS Tools for Windows PowerShell) Delete a NAT gateway • delete-nat-gateway (AWS CLI) • Remove-EC2NatGateway (AWS Tools for Windows PowerShell) Describe a NAT gateway • describe-nat-gateways (AWS CLI) • Get-EC2NatGateway (AWS Tools for Windows PowerShell) Disassociate secondary Elastic IP addresses (EIPs) from a public NAT gateway • disassociate-nat-gateway-address (AWS CLI) • Unregister-EC2NatGatewayAddress (AWS Tools for Windows PowerShell) Tag a NAT gateway • create-tags (AWS CLI) • New-EC2Tag (AWS Tools for Windows PowerShell) Unassign secondary IPv4 addresses from a private NAT gateway • unassign-private-nat-gateway-address (AWS CLI) • Unregister-EC2PrivateNatGatewayAddress (AWS Tools for Windows PowerShell) NAT gateways 260 Amazon Virtual Private Cloud NAT gateway use cases User Guide The following are example use cases for public and private NAT |
vpc-ug-095 | vpc-ug.pdf | 95 | Tools for Windows PowerShell) Describe a NAT gateway • describe-nat-gateways (AWS CLI) • Get-EC2NatGateway (AWS Tools for Windows PowerShell) Disassociate secondary Elastic IP addresses (EIPs) from a public NAT gateway • disassociate-nat-gateway-address (AWS CLI) • Unregister-EC2NatGatewayAddress (AWS Tools for Windows PowerShell) Tag a NAT gateway • create-tags (AWS CLI) • New-EC2Tag (AWS Tools for Windows PowerShell) Unassign secondary IPv4 addresses from a private NAT gateway • unassign-private-nat-gateway-address (AWS CLI) • Unregister-EC2PrivateNatGatewayAddress (AWS Tools for Windows PowerShell) NAT gateways 260 Amazon Virtual Private Cloud NAT gateway use cases User Guide The following are example use cases for public and private NAT gateways. Scenarios • Access the internet from a private subnet • Access your network using allow-listed IP addresses • Enable communication between overlapping networks Access the internet from a private subnet You can use a public NAT gateway to enable instances in a private subnet to send outbound traffic to the internet, while preventing the internet from establishing connections to the instances. Contents • Overview • Routing • Test the public NAT gateway Overview The following diagram illustrates this use case. There are two Availability Zones, with two subnets in each Availability Zone. The route table for each subnet determines how traffic is routed. In Availability Zone A, the instances in the public subnet can reach the internet through a route to the internet gateway, while the instances in the private subnet have no route to the internet. In Availability Zone B, the public subnet contains a NAT gateway, and the instances in the private subnet can reach the internet through a route to the NAT gateway in the public subnet. Both private and public NAT gateways map the source private IPv4 address of the instances to the private IPv4 address of the private NAT gateway, but in the case of a public NAT gateway, the internet gateway then maps the private IPv4 address of the public NAT gateway to the Elastic IP address associated with the NAT gateway. When sending response traffic to the instances, whether it's a public or private NAT gateway, the NAT gateway translates the address back to the original source IP address. NAT gateways 261 Amazon Virtual Private Cloud User Guide Note that if the instances in the private subnet in Availability Zone A also need to reach the internet, you can create a route from this subnet to the NAT gateway in Availability Zone B. Alternatively, you can improve resiliency by creating a NAT gateway in each Availability Zone that contains resources that require internet access. For an example diagram, see the section called “Private servers”. Routing The following is the route table associated with the public subnet in Availability Zone A. The first entry is the local route; it enables the instances in the subnet to communicate with other instances in the VPC using private IP addresses. The second entry sends all other subnet traffic to the internet gateway, which enables the instances in the subnet to access the internet. NAT gateways 262 Amazon Virtual Private Cloud User Guide Destination VPC CIDR 0.0.0.0/0 Target local internet-gateway-id The following is the route table associated with the private subnet in Availability Zone A. The entry is the local route, which enables the instances in the subnet to communicate with other instances in the VPC using private IP addresses. The instances in this subnet have no access to the internet. Destination VPC CIDR Target local The following is the route table associated with the public subnet in Availability Zone B. The first entry is the local route, which enables the instances in the subnet to communicate with other instances in the VPC using private IP addresses. The second entry sends all other subnet traffic to the internet gateway, which enables the NAT gateway in the subnet to access the internet. Destination VPC CIDR 0.0.0.0/0 Target local internet-gateway-id The following is the route table associated with the private subnet in Availability Zone B. The first entry is the local route; it enables the instances in the subnet to communicate with other instances in the VPC using private IP addresses. The second entry sends all other subnet traffic to the NAT gateway. Destination VPC CIDR 0.0.0.0/0 NAT gateways Target local nat-gateway-id 263 Amazon Virtual Private Cloud User Guide For more information, see the section called “Change a subnet route table”. Test the public NAT gateway After you've created your NAT gateway and updated your route tables, you can ping remote addresses on the internet from an instance in your private subnet to test whether it can connect to the internet. For an example of how to do this, see Test the internet connection. If you can connect to the internet, you can also test whether internet traffic is routed through the NAT gateway: • Trace the route of |
vpc-ug-096 | vpc-ug.pdf | 96 | Target local nat-gateway-id 263 Amazon Virtual Private Cloud User Guide For more information, see the section called “Change a subnet route table”. Test the public NAT gateway After you've created your NAT gateway and updated your route tables, you can ping remote addresses on the internet from an instance in your private subnet to test whether it can connect to the internet. For an example of how to do this, see Test the internet connection. If you can connect to the internet, you can also test whether internet traffic is routed through the NAT gateway: • Trace the route of traffic from an instance in your private subnet. To do this, run the traceroute command from a Linux instance in your private subnet. In the output, you should see the private IP address of the NAT gateway in one of the hops (usually the first hop). • Use a third-party website or tool that displays the source IP address when you connect to it from an instance in your private subnet. The source IP address should be the elastic IP address of the NAT gateway. If these tests fail, see Troubleshoot NAT gateways. Test the internet connection The following example demonstrates how to test whether an instance in a private subnet can connect to the internet. 1. Launch an instance in your public subnet (use this as a bastion host). In the launch wizard, ensure that you select an Amazon Linux AMI, and assign a public IP address to your instance. Ensure that your security group rules allow inbound SSH traffic from the range of IP addresses for your local network, and outbound SSH traffic to the IP address range of your private subnet (you can also use 0.0.0.0/0 for both inbound and outbound SSH traffic for this test). 2. Launch an instance in your private subnet. In the launch wizard, ensure that you select an Amazon Linux AMI. Do not assign a public IP address to your instance. Ensure that your security group rules allow inbound SSH traffic from the private IP address of your instance that you launched in the public subnet, and all outbound ICMP traffic. You must choose the same key pair that you used to launch your instance in the public subnet. 3. Configure SSH agent forwarding on your local computer, and connect to your bastion host in the public subnet. For more information, see To configure SSH agent forwarding for Linux or macOS or To configure SSH agent forwarding for Windows. NAT gateways 264 Amazon Virtual Private Cloud User Guide 4. From your bastion host, connect to your instance in the private subnet, and then test the internet connection from your instance in the private subnet. For more information, see To test the internet connection. To configure SSH agent forwarding for Linux or macOS 1. From your local machine, add your private key to the authentication agent. For Linux, use the following command. ssh-add -c mykeypair.pem For macOS, use the following command. ssh-add -K mykeypair.pem 2. Connect to your instance in the public subnet using the -A option to enable SSH agent forwarding, and use the instance's public address, as shown in the following example. ssh -A [email protected] To configure SSH agent forwarding for Windows You can use the OpenSSH client available in Windows, or install your preferred SSH client (for example, PuTTY). OpenSSH Install OpenSSH for Windows as described in this article: Getting started with OpenSSH for Windows. Then add your key to the authentication agent. For more information, see Key-based authentication in OpenSSH for Windows. PuTTY 1. Download and install Pageant from the PuTTY download page, if not already installed. 2. Convert your private key to .ppk format. For more information, see Convert your private key using PuTTYgen in the Amazon EC2 User Guide. NAT gateways 265 Amazon Virtual Private Cloud User Guide 3. Start Pageant, right-click the Pageant icon on the taskbar (it may be hidden), and choose Add Key. Select the .ppk file that you created, enter the passphrase if necessary, and choose Open. 4. Start a PuTTY session and connect to your instance in the public subnet using its public IP address. For more information, see Connect to your Linux instance using PuTTY. In the Auth category, ensure that you select the Allow agent forwarding option, and leave the Private key file for authentication box blank. To test the internet connection 1. From your instance in the public subnet, connect to your instance in your private subnet by using its private IP address as shown in the following example. ssh [email protected] 2. From your private instance, test that you can connect to the internet by running the ping command for a website that has ICMP enabled. ping ietf.org PING ietf.org (4.31.198.44) 56(84) bytes of data. 64 bytes from mail.ietf.org |
vpc-ug-097 | vpc-ug.pdf | 97 | Linux instance using PuTTY. In the Auth category, ensure that you select the Allow agent forwarding option, and leave the Private key file for authentication box blank. To test the internet connection 1. From your instance in the public subnet, connect to your instance in your private subnet by using its private IP address as shown in the following example. ssh [email protected] 2. From your private instance, test that you can connect to the internet by running the ping command for a website that has ICMP enabled. ping ietf.org PING ietf.org (4.31.198.44) 56(84) bytes of data. 64 bytes from mail.ietf.org (4.31.198.44): icmp_seq=1 ttl=47 time=86.0 ms 64 bytes from mail.ietf.org (4.31.198.44): icmp_seq=2 ttl=47 time=75.6 ms ... Press Ctrl+C on your keyboard to cancel the ping command. If the ping command fails, see Instances cannot access the internet. 3. (Optional) If you no longer require your instances, terminate them. For more information, see Terminate your instance in the Amazon EC2 User Guide. Access your network using allow-listed IP addresses You can use a private NAT gateway to enable communication from your VPCs to your on-premises network using a pool of allow-listed addresses. Instead of assigning each instance a separate IP address from the allow-listed IP address range, you can route traffic from the subnet that is destined for the on-premises network through a private NAT gateway with an IP address from the allow-listed IP address range. NAT gateways 266 Amazon Virtual Private Cloud User Guide Contents • Overview • Resources • Routing Overview The following diagram shows how instances can access on-premises resources through AWS VPN. Traffic from the instances is routed to a virtual private gateway, over the VPN connection, to the customer gateway, and then to the destination in the on-premises network. However, suppose that the destination allows traffic only from a specific IP address range, such as 100.64.1.0/28. This would prevent traffic from these instances from reaching the on-premises network. The following diagram shows the key components of the configuration for this scenario. The VPC has its original IP address range plus the allowed IP address range. The VPC has a subnet from the allowed IP address range with a private NAT gateway. Traffic from the instances that is destined for the on-premises network is sent to the NAT gateway before being routed to the VPN connection. The on-premises network receives the traffic from the instances with the source IP address of the NAT gateway, which is from the allowed IP address range. NAT gateways 267 Amazon Virtual Private Cloud User Guide Resources Create or update resources as follows: • Associate the allowed IP address range with the VPC. • Create a subnet in the VPC from the allowed IP address range. • Create a private NAT gateway in the new subnet. • Update the route table for the subnet with the instances to send traffic destined for the on- premises network to the NAT gateway. Add a route to the route table for the subnet with the private NAT gateway that sends traffic destined for the on-premises network to the virtual private gateway. Routing The following is the route table associated with the first subnet. There is a local route for each VPC CIDR. Local routes enable resources in the subnet to communicate with other resources in the VPC using private IP addresses. The third entry sends traffic destined for the on-premises network to the private NAT gateway. Destination 10.0.0.0/16 100.64.1.0/24 192.168.0.0/16 Target local local nat-gateway-id NAT gateways 268 Amazon Virtual Private Cloud User Guide The following is the route table associated with the second subnet. There is a local route for each VPC CIDR. Local routes enable resources in the subnet to communicate with other resources in the VPC using private IP addresses. The third entry sends traffic destined for the on-premises network to the virtual private gateway. Destination 10.0.0.0/16 100.64.1.0/24 192.168.0.0/16 Target local local vgw-id Enable communication between overlapping networks You can use a private NAT gateway to enable communication between networks even if they have overlapping CIDR ranges. For example, suppose that the instances in VPC A need to access the services provided by the instances in VPC B. Contents • Overview • Resources • Routing NAT gateways 269 Amazon Virtual Private Cloud Overview User Guide The following diagram shows the key components of the configuration for this scenario. First, your IP management team determines which address ranges can overlap (non-routable address ranges) and which can't (routable address ranges). The IP management team allocates address ranges from the pool of routable address ranges to projects on request. Each VPC has its original IP address range, which is non-routable, plus the routable IP address range assigned to it by the IP management team. VPC A has a subnet from its routable range with a private NAT |
vpc-ug-098 | vpc-ug.pdf | 98 | Routing NAT gateways 269 Amazon Virtual Private Cloud Overview User Guide The following diagram shows the key components of the configuration for this scenario. First, your IP management team determines which address ranges can overlap (non-routable address ranges) and which can't (routable address ranges). The IP management team allocates address ranges from the pool of routable address ranges to projects on request. Each VPC has its original IP address range, which is non-routable, plus the routable IP address range assigned to it by the IP management team. VPC A has a subnet from its routable range with a private NAT gateway. The private NAT gateway gets its IP address from its subnet. VPC B has a subnet from its routable range with an Application Load Balancer. The Application Load Balancer gets its IP addresses from its subnets. Traffic from an instance in the non-routable subnet of VPC A that is destined for the instances in the non-routable subnet of VPC B is sent through the private NAT gateway and then routed to the transit gateway. The transit gateway sends the traffic to the Application Load Balancer, which routes the traffic to one of the target instances in the non-routable subnet of VPC B. The traffic from the transit gateway to the Application Load Balancer has the source IP address of the private NAT gateway. Therefore, response traffic from the load balancer uses the address of the private NAT gateway as its destination. The response traffic is sent to the transit gateway and then routed to the private NAT gateway, which translates the destination to the instance in the non-routable subnet of VPC A. NAT gateways 270 Amazon Virtual Private Cloud User Guide Resources Create or update resources as follows: • Associate the assigned routable IP address ranges with their respective VPCs. • Create a subnet in VPC A from its routable IP address range, and create a private NAT gateway in this new subnet. • Create a subnet in VPC B from its routable IP address range, and create an Application Load Balancer in this new subnet. Register the instances in the non-routable subnet with the target group for the load balancer. • Create a transit gateway to connect the VPCs. Be sure to disable route propagation. When you attach each VPC to the transit gateway, use the routable address range of the VPC. • Update the route table of the non-routable subnet in VPC A to send all traffic destined for the routable address range of VPC B to the private NAT gateway. Update the route table of the routable subnet in VPC A to send all traffic destined for the routable address range of VPC B to the transit gateway. • Update the route table of the routable subnet in VPC B to send all traffic destined for the routable address range of VPC A to the transit gateway. NAT gateways 271 Amazon Virtual Private Cloud Routing User Guide The following is the route table for the non-routable subnet in VPC A. Destination 10.0.0.0/16 100.64.1.0/24 100.64.2.0/24 Target local local nat-gateway-id The following is the route table for the routable subnet in VPC A. Destination 10.0.0.0/16 100.64.1.0/24 100.64.2.0/24 Target local local transit-gateway-id The following is the route table for the non-routable subnet in VPC B. Destination 10.0.0.0/16 100.64.2.0/24 Target local local The following is the route table for the routable subnet in VPC B. Destination 10.0.0.0/16 100.64.2.0/24 Target local local NAT gateways 272 Amazon Virtual Private Cloud Destination 100.64.1.0/24 User Guide Target transit-gateway-id The following is the transit gateway route table. CIDR Attachment Route type 100.64.1.0/24 Attachment for VPC A 100.64.2.0/24 Attachment for VPC B Static Static DNS64 and NAT64 A NAT gateway supports network address translation from IPv6 to IPv4, popularly known as NAT64. NAT64 helps your IPv6 AWS resources communicate with IPv4 resources in the same VPC or a different VPC, in your on-premises network or over the internet. You can use NAT64 with DNS64 on Amazon Route 53 Resolver or use your own DNS64 server. Contents • What is DNS64? • What is NAT64? • Configure DNS64 and NAT64 What is DNS64? Your IPv6-only workloads running in VPCs can only send and receive IPv6 network packets. Without DNS64, a DNS query for an IPv4-only service will yield an IPv4 destination address in response and your IPv6-only service can't communicate with it. To bridge this communication gap, you can enable DNS64 for a subnet and it applies to all the AWS resources within that subnet. With DNS64, the Amazon Route 53 Resolver looks up the DNS record for the service you queried for and does one of the following: • If the record contains an IPv6 address, it returns the original record and the connection is established without any translation over IPv6. NAT gateways 273 Amazon Virtual |
vpc-ug-099 | vpc-ug.pdf | 99 | Without DNS64, a DNS query for an IPv4-only service will yield an IPv4 destination address in response and your IPv6-only service can't communicate with it. To bridge this communication gap, you can enable DNS64 for a subnet and it applies to all the AWS resources within that subnet. With DNS64, the Amazon Route 53 Resolver looks up the DNS record for the service you queried for and does one of the following: • If the record contains an IPv6 address, it returns the original record and the connection is established without any translation over IPv6. NAT gateways 273 Amazon Virtual Private Cloud User Guide • If there is no IPv6 address associated with the destination in the DNS record, the Route 53 Resolver synthesizes one by prepending the well-known /96 prefix, defined in RFC6052 (64:ff9b::/96), to the IPv4 address in the record. Your IPv6-only service sends network packets to the synthesized IPv6 address. You will then need to route this traffic through the NAT gateway, which performs the necessary translation on the traffic to allow IPv6 services in your subnet to access IPv4 services outside that subnet. You can enable or disable DNS64 on a subnet using the modify-subnet-attribute using the AWS CLI or with the VPC console by selecting a subnet and choosing Actions > Edit subnet settings. What is NAT64? NAT64 enables your IPv6-only services in Amazon VPCs to communicate with IPv4-only services within the same VPC (in different subnets) or connected VPCs, in your on-premises networks, or over the internet. NAT64 is automatically available on your existing NAT gateways or on any new NAT gateways you create. It's not a feature you enable or disable. The subnet that the NAT gateway is in does not need to be a dual-stack subnet for NAT64 to work. After you enable DNS64, if your IPv6-only service sends network packets to a synthesized IPv6 address through the NAT gateway, the following happens: • From the 64:ff9b::/96 prefix, the NAT gateway recognizes that the original destination is IPv4 and translates the IPv6 packets to IPv4 by replacing: • Source IPv6 with its own private IP which is translated to Elastic IP address by the internet gateway. • Destination IPv6 to IPv4 by truncating the 64:ff9b::/96 prefix. • The NAT gateway sends the translated IPv4 packets to the destination through the internet gateway, virtual private gateway, or transit gateway and initiates a connection. • The IPv4-only host sends back IPv4 response packets. After a connection is established, NAT gateway accepts the response IPv4 packets from the external hosts. • The response IPv4 packets are destined for NAT gateway, which receives the packets and de- NATs them by replacing its IP (destination IP) with the host’s IPv6 address and prepending back 64:ff9b::/96 to the source IPv4 address. The packet then flows to the host following the local route. NAT gateways 274 Amazon Virtual Private Cloud User Guide In this way, the NAT gateway enables your IPv6-only workloads in a subnet to communicate with IPv4-only services outside the subnet. Configure DNS64 and NAT64 Follow the steps in this section to configure DNS64 and NAT64 to enable communication with IPv4-only services. Contents • Enable communication with IPv4-only services on the internet with the AWS CLI • Enable communication with IPv4-only services in your on-premises environment Enable communication with IPv4-only services on the internet with the AWS CLI If you have a subnet with IPv6-only workloads that needs to communicate with IPv4-only services outside the subnet, this example shows you how to enable these IPv6-only services to communicate with IPv4-only services on the internet. You should first configure a NAT gateway in a public subnet (separate from the subnet containing the IPv6-only workloads). For example, the subnet containing the NAT gateway should have a 0.0.0.0/0 route pointing to the internet gateway. Complete these steps to enable these IPv6-only services to connect with IPv4-only services on the internet: 1. Add the following three routes to the route table of the subnet containing the IPv6-only workloads: • IPv4 route (if any) pointing to the NAT gateway. • 64:ff9b::/96 route pointing to the NAT gateway. This will allow traffic from your IPv6- only workloads destined for IPv4-only services to be routed through the NAT gateway. • IPv6 ::/0 route pointing to the egress-only internet gateway (or the internet gateway). Note that pointing ::/0 to the internet gateway will allow external IPv6 hosts (outside the VPC) to initiate connection over IPv6. aws ec2 create-route --route-table-id rtb-34056078 --destination-cidr-block NAT gateways 275 Amazon Virtual Private Cloud User Guide 0.0.0.0/0 --nat-gateway-id nat-05dba92075d71c408 aws ec2 create-route --route-table-id rtb-34056078 --destination-ipv6-cidr-block 64:ff9b::/96 --nat-gateway-id nat-05dba92075d71c408 aws ec2 create-route --route-table-id rtb-34056078 --destination-ipv6-cidr-block ::/0 --egress-only-internet-gateway-id eigw-c0a643a9 2. Enable DNS64 capability in the subnet containing the IPv6-only workloads. aws ec2 modify-subnet-attribute --subnet-id subnet-1a2b3c4d --enable-dns64 Now, resources in your private subnet can |
vpc-ug-100 | vpc-ug.pdf | 100 | routed through the NAT gateway. • IPv6 ::/0 route pointing to the egress-only internet gateway (or the internet gateway). Note that pointing ::/0 to the internet gateway will allow external IPv6 hosts (outside the VPC) to initiate connection over IPv6. aws ec2 create-route --route-table-id rtb-34056078 --destination-cidr-block NAT gateways 275 Amazon Virtual Private Cloud User Guide 0.0.0.0/0 --nat-gateway-id nat-05dba92075d71c408 aws ec2 create-route --route-table-id rtb-34056078 --destination-ipv6-cidr-block 64:ff9b::/96 --nat-gateway-id nat-05dba92075d71c408 aws ec2 create-route --route-table-id rtb-34056078 --destination-ipv6-cidr-block ::/0 --egress-only-internet-gateway-id eigw-c0a643a9 2. Enable DNS64 capability in the subnet containing the IPv6-only workloads. aws ec2 modify-subnet-attribute --subnet-id subnet-1a2b3c4d --enable-dns64 Now, resources in your private subnet can establish stateful connections with both IPv4 and IPv6 services on the internet. Configure your security group and NACLs appropriately to allow egress and ingress traffic to 64:ff9b::/96 traffic. Enable communication with IPv4-only services in your on-premises environment Amazon Route 53 Resolver enables you to forward DNS queries from your VPC to an on-premises network and vice versa. You can do this by doing the following: • You create a Route 53 Resolver outbound endpoint in a VPC and assign it the IPv4 addresses that you want Route 53 Resolver to forward queries from. For your on-premises DNS resolver, these are the IP addresses that the DNS queries originate from and, therefore, should be IPv4 addresses. • You create one or more rules which specify the domain names of the DNS queries that you want Route 53 Resolver to forward to your on-premises resolvers. You also specify the IPv4 addresses of the on-premises resolvers. • Now that you have set up a Route 53 Resolver outbound endpoint, you need to enable DNS64 on the subnet containing your IPv6-only workloads and route any data destined for your on- premises network through a NAT gateway. How DNS64 works for IPv4-only destinations in on-premises networks: 1. You assign an IPv4 address to the Route 53 Resolver outbound endpoint in your VPC. NAT gateways 276 Amazon Virtual Private Cloud User Guide 2. The DNS query from your IPv6 service goes to Route 53 Resolver over IPv6. Route 53 Resolver matches the query against the forwarding rule and gets an IPv4 address for your on-premises resolver. 3. Route 53 Resolver converts the query packet from IPv6 into IPv4 and forwards it to the outbound endpoint. Each IP address of the endpoint represents one ENI that forwards the request to the on-premises IPv4 address of your DNS resolver. 4. The on-premises resolver sends the response packet over IPv4 back through the outbound endpoint to Route 53 Resolver. 5. Assuming the query was made from a DNS64-enabled subnet, Route 53 Resolver does two things: a. Checks the content of the response packet. If there’s an IPv6 address in the record, it keeps the content as is, but if it contains only an IPv4 record. It synthesizes an IPv6 record as well by prepending 64:ff9b::/96 to the IPv4 address. b. Repackages the content and sends it to the service in your VPC over IPv6. Monitor NAT gateways with Amazon CloudWatch You can monitor your NAT gateway using CloudWatch, which collects information from your NAT gateway and creates readable, near real-time metrics. You can use this information to monitor and troubleshoot your NAT gateway. These metrics give you visibility into the health and performance of your NAT gateway, enabling you to closely monitor its operation and quickly troubleshoot any issues. The NAT gateway metrics collected by CloudWatch include data points such as bytes processed, packet counts, connection counts, and error rates. This enables you to thoroughly understand the traffic flowing through your NAT gateway and identify any anomalies or bottlenecks. CloudWatch delivers this metric data at 1-minute intervals, giving you a granular, up-to-the-minute view of your NAT gateway's behavior. Additionally, CloudWatch retains this NAT gateway metric data for an extended period of 15 months, enabling you to analyze trends and patterns over time. You can use this historical data for capacity planning, performance optimization, and understanding the long-term evolution of your NAT gateway usage. To leverage these powerful monitoring capabilities, you can create custom CloudWatch dashboards and alarms tailored to your specific needs. For example, you could set up alerts to notify you NAT gateways 277 Amazon Virtual Private Cloud User Guide whenever your NAT gateway's outbound data transfer exceeds a certain threshold, allowing you to proactively address potential bandwidth constraints. For more information about pricing, see Amazon CloudWatch Pricing. Contents • NAT gateway metrics and dimensions • View NAT gateway CloudWatch metrics • Create CloudWatch alarms to monitor a NAT gateway NAT gateway metrics and dimensions The following metrics are available for your NAT gateways. The description column includes a description of each metrics as well as the units and statistics. Metric Description ActiveConnectionCount BytesInFromDestination The total number of concurrent active TCP connections through the NAT gateway. A value |
vpc-ug-101 | vpc-ug.pdf | 101 | User Guide whenever your NAT gateway's outbound data transfer exceeds a certain threshold, allowing you to proactively address potential bandwidth constraints. For more information about pricing, see Amazon CloudWatch Pricing. Contents • NAT gateway metrics and dimensions • View NAT gateway CloudWatch metrics • Create CloudWatch alarms to monitor a NAT gateway NAT gateway metrics and dimensions The following metrics are available for your NAT gateways. The description column includes a description of each metrics as well as the units and statistics. Metric Description ActiveConnectionCount BytesInFromDestination The total number of concurrent active TCP connections through the NAT gateway. A value of zero indicates that there are no active connections through the NAT gateway. Units: Count Statistics: The most useful statistic is Max. The number of bytes received by the NAT gateway from the destination. If the value for BytesOutToSource is less than the value for BytesInFromDestina tion , there might be data loss during NAT gateway processing, or traffic being actively blocked by the NAT gateway. Units: Bytes Statistics: The most useful statistic is Sum. NAT gateways 278 Amazon Virtual Private Cloud User Guide Metric Description BytesInFromSource BytesOutToDestination The number of bytes received by the NAT gateway from clients in your VPC. If the value for BytesOutToDestinat ion is less than the value for BytesInFr omSource , there might be data loss during NAT gateway processing. Units: Bytes Statistics: The most useful statistic is Sum. The number of bytes sent out through the NAT gateway to the destination. A value greater than zero indicates that there is traffic going to the internet from clients that are behind the NAT gateway. If the value for BytesOutToDestination value for BytesInFromSource , there might be data loss during NAT gateway processing. is less than the Unit: Bytes Statistics: The most useful statistic is Sum. NAT gateways 279 Amazon Virtual Private Cloud User Guide Metric Description BytesOutToSource ConnectionAttemptCount The number of bytes sent through the NAT gateway to the clients in your VPC. A value greater than zero indicates that there is traffic coming from the internet to clients that are behind the NAT gateway. If the value for BytesOutToSource is less than the value for BytesInFromDestination , there might be data loss during NAT gateway processing, or traffic being actively blocked by the NAT gateway. Units: Bytes Statistics: The most useful statistic is Sum. The number of connection attempts made through the NAT gateway. This includes only the initial SYN. In some cases, Connectio nAttemptCount may be lower than ConnectionEstablishedCount SYN retransmission. due to If the value for ConnectionEstablis hedCount is less than the value for , this ConnectionAttemptCount indicates that clients behind the NAT gateway attempted to establish new connections for which there was no response. Unit: Count Statistics: The most useful statistic is Sum. NAT gateways 280 Amazon Virtual Private Cloud User Guide Metric Description ConnectionEstablishedCount ErrorPortAllocation The number of connections established through the NAT gateway. This includes SYN and SYN retransmissions. If the value for ConnectionEstablis hedCount is less than the value for , this ConnectionAttemptCount indicates that clients behind the NAT gateway attempted to establish new connections for which there was no response. Unit: Count Statistics: The most useful statistic is Sum. The number of times the NAT gateway could not allocate a source port. A value greater than zero indicates that too many concurrent connections are open through the NAT gateway. Units: Count Statistics: The most useful statistic is Sum. NAT gateways 281 Amazon Virtual Private Cloud User Guide Metric Description IdleTimeoutCount PacketsDropCount The number of connections that transitio ned from the active state to the idle state. An active connection transitions to idle if it was not closed gracefully and there was no activity for the last 350 seconds. A value greater than zero indicates that there are connections that have been moved to an idle state. If the value for IdleTimeo utCount increases, it might indicate that clients behind the NAT gateway are re-using stale connections. Unit: Count Statistics: The most useful statistic is Sum. The number of packets dropped by the NAT gateway. To calculate the number of dropped packets as a percentage of the overall packet traffic, use this formula: PacketsDropCount/ (PacketsInFromSource+Packets InFromDestination)*100 exceeds 0.01 percent of the total traffic on . If this value the NAT gateway, there may be an issue with Amazon VPC service. Use the AWS service health dashboard to identify any issues with the service that may be causing NAT gateways to drop packets. Units: Count Statistics: The most useful statistic is Sum. NAT gateways 282 Amazon Virtual Private Cloud User Guide Metric Description PacketsInFromDestination PacketsInFromSource The number of packets received by the NAT gateway from the destination. If the value for PacketsOutToSource is less than the value for PacketsIn FromDestination loss during NAT gateway processing, or traffic , |
vpc-ug-102 | vpc-ug.pdf | 102 | 0.01 percent of the total traffic on . If this value the NAT gateway, there may be an issue with Amazon VPC service. Use the AWS service health dashboard to identify any issues with the service that may be causing NAT gateways to drop packets. Units: Count Statistics: The most useful statistic is Sum. NAT gateways 282 Amazon Virtual Private Cloud User Guide Metric Description PacketsInFromDestination PacketsInFromSource The number of packets received by the NAT gateway from the destination. If the value for PacketsOutToSource is less than the value for PacketsIn FromDestination loss during NAT gateway processing, or traffic , there might be data being actively blocked by the NAT gateway. Unit: Count Statistics: The most useful statistic is Sum. The number of packets received by the NAT gateway from clients in your VPC. If the value for PacketsOutToDestin ation is less than the value for PacketsIn FromSource during NAT gateway processing. , there might be data loss Unit: Count Statistics: The most useful statistic is Sum. NAT gateways 283 Amazon Virtual Private Cloud User Guide Metric Description PacketsOutToDestination The number of packets sent out through the NAT gateway to the destination. A value greater than zero indicates that there is traffic going to the internet from clients that are behind the NAT gateway. If the value for PacketsOutToDestination the value for PacketsInFromSource there might be data loss during NAT gateway is less than , PacketsOutToSource processing. Unit: Count Statistics: The most useful statistic is Sum. The number of packets sent through the NAT gateway to the clients in your VPC. A value greater than zero indicates that there is traffic coming from the internet to clients that are behind the NAT gateway. If the value for PacketsOutToSource is less than the value for PacketsInFromDestination , there might be data loss during NAT gateway processing, or traffic being actively blocked by the NAT gateway. Unit: Count Statistics: The most useful statistic is Sum. NAT gateways 284 Amazon Virtual Private Cloud User Guide Metric Description PeakBytesPerSecond This metric reports the highest 10-second bytes per second average in a given minute. PeakPacketsPerSecond Units: Count Statistics: The most useful statistic is Maximum. This metric calculates the average packet rate (packets processed per second) every 10 seconds for 60 seconds and then reports the maximum of the six rates (the highest average packet rate). Units: Count Statistics: The most useful statistic is Maximum. To filter the metric data, use the following dimension. Dimension NatGatewayId Description Filter the metric data by the NAT gateway ID. View NAT gateway CloudWatch metrics NAT gateway metrics are sent to CloudWatch at 1-minute intervals. Metrics are grouped first by the service namespace, and then by the possible combinations of dimensions within each namespace. You can view the metrics for your NAT gateways as follows. To view metrics using the CloudWatch console 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Metrics, All metrics. 3. Choose the NATGateway metric namespace. NAT gateways 285 Amazon Virtual Private Cloud 4. Choose a metric dimension. To view metrics using the AWS CLI User Guide At a command prompt, use the following command to list the metrics that are available for the NAT gateway service. aws cloudwatch list-metrics --namespace "AWS/NATGateway" Create CloudWatch alarms to monitor a NAT gateway You can create a CloudWatch alarm that sends an Amazon SNS message when the alarm changes state. An alarm watches a single metric over a time period that you specify. It sends a notification to an Amazon SNS topic based on the value of the metric relative to a given threshold over a number of time periods. For example, you can create an alarm that monitors the amount of traffic coming in or leaving the NAT gateway. The following alarm monitors the amount of outbound traffic from clients in your VPC through the NAT gateway to the internet. It sends a notification when the number of bytes reaches a threshold of 5,000,000 during a 15-minute period. To create an alarm for outbound traffic through the NAT gateway 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Alarms, All alarms. 3. Choose Create alarm. 4. Choose Select metric. 5. Choose the NATGateway metric namespace and then choose a metric dimension. When you get to the metrics, select the check box next to the BytesOutToDestination metric for the NAT gateway, and then choose Select metric. 6. Configure the alarm as follows, and then choose Next: • For Statistic, choose Sum. • For Period, choose 15 minutes. • For Whenever, choose Greater/Equal and enter 5000000 for the threshold. 7. For Notification, select an existing SNS topic or choose Create new topic to create a new one. Choose Next. NAT gateways 286 Amazon Virtual Private Cloud User Guide 8. Enter a name |
vpc-ug-103 | vpc-ug.pdf | 103 | Choose the NATGateway metric namespace and then choose a metric dimension. When you get to the metrics, select the check box next to the BytesOutToDestination metric for the NAT gateway, and then choose Select metric. 6. Configure the alarm as follows, and then choose Next: • For Statistic, choose Sum. • For Period, choose 15 minutes. • For Whenever, choose Greater/Equal and enter 5000000 for the threshold. 7. For Notification, select an existing SNS topic or choose Create new topic to create a new one. Choose Next. NAT gateways 286 Amazon Virtual Private Cloud User Guide 8. Enter a name and description for the alarm and choose Next. 9. When you done configuring the alarm, choose Create alarm. As another example, you can create an alarm that monitors port allocation errors and sends a notification when the value is greater than zero (0) for three consecutive 5-minute periods. To create an alarm to monitor port allocation errors 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Alarms, All alarms. 3. Choose Create alarm. 4. Choose Select metric. 5. Choose the NATGateway metric namespace and then choose a metric dimension. When you get to the metrics, select the check box next to the ErrorPortAllocation metric for the NAT gateway, and then choose Select metric. 6. Configure the alarm as follows, and then choose Next: • For Statistic, choose Maximum. • For Period, choose 5 minutes. • For Whenever, choose Greater and enter 0 for the threshold. • For Additional configuration, Datapoints to alarm, enter 3. 7. For Notification, select an existing SNS topic or choose Create new topic to create a new one. Choose Next. 8. Enter a name and description for the alarm and choose Next. 9. When you are done configuring the alarm, choose Create alarm. For more information, see Using Amazon CloudWatch alarms in the Amazon CloudWatch User Guide. Troubleshoot NAT gateways The following topics help you to troubleshoot common issues that you might encounter when creating or using a NAT gateway. Issues NAT gateways 287 User Guide Amazon Virtual Private Cloud • NAT gateway creation fails • NAT gateway quota • Elastic IP address quota • Availability Zone is unsupported • NAT gateway is no longer visible • NAT gateway doesn't respond to a ping command • Instances cannot access the internet • TCP connection to a destination fails • Traceroute output does not display NAT gateway private IP address • Internet connection drops after 350 seconds • IPsec connection cannot be established • Cannot initiate more connections NAT gateway creation fails Problem You create a NAT gateway and it goes to a state of Failed. Note A failed NAT gateway is automatically deleted, usually in about an hour. Cause There was an error when the NAT gateway was created. The returned state message provides the reason for the error. Solution To view the error message, open the Amazon VPC console, and then choose NAT Gateways. Select the radio button for your NAT gateway, and then find State message on the Details tab. The following table lists the possible causes of the failure as indicated in the Amazon VPC console. After you've applied any of the remedial steps indicated, you can try to create a NAT gateway again. NAT gateways 288 Amazon Virtual Private Cloud User Guide Displayed error Cause Solution Subnet has insufficient free addresses to create this NAT The subnet that you specified does not have any free gateway private IP addresses. The NAT gateway requires a network interface with a private IP address allocated from the subnet's range. Check how many IP addresses are available in your subnet by going to the Subnets page in the Amazon VPC console. You can view the Available IPs in the details pane for your subnet. To create free IP addresses in your subnet, you can delete unused network interfaces, or terminate instances that you do not require. Network vpc-xxxxxxxx has no internet gateway attached A NAT gateway must be created in a VPC with an Create and attach an internet gateway to your VPC. For internet gateway. Elastic IP address eipalloc- xxxxxxxx is already associated The Elastic IP address that you specified is already associated with another resource, and cannot be associated with the NAT gateway. more information, see Add internet access to a subnet. Check which resource is associated with the Elastic IP address. Go to the Elastic IPs page in the Amazon VPC console, and view the values specified for the instance ID or network interface ID. If you do not require the Elastic IP address for that resource, you can disassociate it. Alternati vely, allocate a new Elastic IP address to your account. For more information, see Start using Elastic IP addresses. NAT gateways 289 Amazon Virtual Private Cloud NAT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.