Week 3
Week 3
Cloud Networking
3.1 Introduction
Cloud networking is a type of IT infrastructure in which some or all of an organization’s network
capabilities and resources are hosted in a public or private cloud platform, managed in-house or by a service
provider, and available on demand.
Companies can either use on-premises cloud networking resources to build a private cloud network or use
cloud-based networking resources in the public cloud, or a hybrid cloud combination of both. These network
resources can include virtual routers, firewalls, and bandwidth and network management software, with
other tools and functions available as required.
Classless Inter-Domain Routing (CIDR) is an IP address allocation method that improves data routing
efficiency on the internet. Every machine, server, and end-user device that connects to the internet has a
unique number, called an IP address, associated with it. Devices find and communicate with one another by
using these IP addresses. Organizations use CIDR to allocate IP addresses flexibly and efficiently in their
networks.
Private IP address of a system is the IP address that is used to communicate within the same network.
Using private IP data or information can be sent or received within the same network.
Public IP address of a system is the IP address that is used to communicate outside the network. A public
IP address is basically assigned by the ISP (Internet Service Provider).
Range:
10.0.0.0 – 10.255.255.255,
Range: Besides private IP addresses, the rest are
172.16.0.0 – 172.31.255.255, public.
192.168.0.0 – 192.168.255.255
8.
Private IP uses numeric code that is not Public IP uses a numeric code that is unique and
9. unique and can be used again cannot be used by other
For a real-world example, suppose an IP packet is addressed to the IP address 192.0.2.15. This IP address
is a Class C network, so the network is identified by "192.0.2" (or to be technically precise, 192.0.2.0/24).
Network routers forward the packet to a host on the network indicated by "192.0.2."
Once the packet arrives at that network, a router within the network consults its routing table. It does some
binary mathematics using its subnet mask of 255.255.255.0, sees the device address "15" (the rest of the IP
address indicates the network), and calculates which subnet the packet should go to. It forwards the packet
to the router or switch responsible for delivering packets within that subnet, and the packet arrives at IP
address 192.0.2.15
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.
The following figure illustrates the key components that we set up for a default VPC.
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 launch AWS resources, such as Amazon EC2
instances, into your VPC.
Your account contains a default VPC for each AWS Region. You can also create additional VPCs.
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.
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.
VPC diagram
The following diagram shows an example VPC. The VPC has one subnet in each of
the Availability Zones in the Region, EC2 instances in each subnet, and an internet
gateway to allow communication between the resources in your VPC and the internet.
VPC resources
3.7 Lab VPC - 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. For Resources to create, choose VPC only.
4. (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 What is IPAM? in 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. Choose Create VPC.
7. After you create a VPC, you can add subnets. For more information, see Create a subnet.
An internet gateway is a service that allows for internet traffic to actually enter into a VPC. An Internet
Gateway is a logical connection between an AWS VPC and the Internet. It is not a physical device. Each
VPC has only one Internet Gateway. If a VPC doesn’t have an Internet Gateway, then the resources cannot
be accessed from the Internet. Conversely, resources within your VPC need an Internet Gateway to access
the Internet.
In order to allow internet traffic to our VPC, we can use an Internet Gateway.
Routing is a big part of networking. In AWS, it's very easy to setup. Every VPC has an implied router,
you don’t need to create it, it's already there. It routes the traffic within the VPC and then we also have route
tables that contain routing entries. Think of a road and road-signs analogy; the router is the road and road-
signs are the route table entries.
A route table specifies how packets are forwarded between subnets within your VPC, the internet, and
your VPN connection.
A route table contains a set of rules called routes which determine where traffic has to be directed. You
can create as many route tables in a VPC as you want. Route tables act at the subnet level, not the VPC
level. A route table can be associated with one or several subnets. By default, all route tables in a VPC have
a local route for communication within the VPC. You can add custom routes in a route table by creating a
new route defining which traffic (IP destination) must go where (target).
This will allow traffic to enter the VPC, but we can lock it down. That’s where Security Groups are going
to come into play (we will talk about those a little bit later).
Notice that the first entry (10.0.0.0/16) is for VPC local traffic and we added a catch-all route (0.0.0.0/0) and
set its target to our Internet Gateway, which we created earlier.
Associate Custom Route Table to Public Subnet (for Internet)
Our custom route table now has a route with Internet Gateway. Next, we will associate it with the public
subnet.
VPC –> Subnets –> Select Public Subnet –> RouteTables –> Edit Route Tables Association
The following screenshot shows the association of the route table with the public subnet.
In the above architecture, we have public and private subnet. NAT instance exists behind the security
group, and NAT Gateway exists after the security group as NAT instance is configured with the security
group while NAT Gateway does not require any security group and it is also redundant. When an instance in
a private subnet wants to access the internet, they do so either by NAT instance or NAT Gateway. Now, if
we want to administer an environment, what typically happens?. We have got SSH or RDP where SSH is for
Linux and RDP is for windows. It is going through internet gateway, router, route table, network ACL,
security group, and finally to the Bastion server. Bastion server creates a connection to a private EC2
instance through SSH or RDP. We need to harden the Bastion host as strong as possible, then we do not
have to worry about hardening our instances as long as Bastion host is hardened. Hardening a Bastion host
reduces the surface area that we want to harden.
4. For the desired Amazon Linux AMI image and click Select. The Choose an Instance Type window
appears.
5. Check the t2.micro entry and click Next: Configure Instance Details. The Configure Instance
Details window appears.
6. In the Number of instances field, type 1
7. From the Network drop down list, select the VPC with the database you wish to scan.
8. Set Auto-assign Public IP to Enable.
18. You can either choose an existing key pair or create a new key pair.
To create a new key pair:
a. Select Create new key pair.
b. Select a Key pair type.
c. Type a Key pair name and make a note of it.
d. Click Download Key Pair.
The file is downloaded to your browser.
Click Launch Instances. The Launch Status window appears while the instance is launched.
Click View Instances. The Instances window appears and the new instance is located there.
Click the Instance ID to see the details. Make a note of the Public IPv4 address.
If you want to find this instance later:
a. In the AWS Management Console, under Compute, select EC2.
b. Under Instances, find the new instance by typing the Tag name you gave, e.g. Scuba Bastion in the
search box. Make a note of its Public IPv4 address.
Verify that you have the PEM file, which is needed by Scuba.
You can use a NAT instance to allow resources in a private subnet to communicate with destinations
outside the virtual private cloud (VPC), such as the internet or an on-premises network. The resources in the
private subnet can initiate outbound IPv4 traffic to the internet, but they can't receive inbound traffic
initiated on the internet.
Let's first start with NAT instance and how to create them.
Launch an instance.
Move to the community AMI appearing on the left side of the console.
Type the nat in a search box, and then it will show all the NAT instances. Select the first NAT instance.
Now, configure the instance details. Leave all the details as default except that keep the VPC as custom
VPC and choose the public subnet.
Add tags.
Click the Review and Launch button. On clicking on the Review and Launch button, a dialog box appears.
Click on the Next button to create an instance.
NAT Gateway, also known as Network Address Translation Gateway, is used to enable instances present
in a private subnet to help connect to the internet or AWS services. In addition to this, the gateway makes
sure that the internet doesn’t initiate a connection with the instances. NAT Gateway service is a fully
managed service by Amazon, that doesn’t require any efforts from the administrator.They don’t support
IPV4 traffic.
A NAT gateway in a device forwards the traffic from instances present in the private subnet to the
internet/AWS services, and sends back the response from the server back to the instance. When the traffic
moves to the internet, an IPV4 address gets replaced with the NAT’s device address. Once the response is
obtained, it has to be sent to the instance, and in this case, the NAT device translates the address back to the
IPV4 and it is given to the IPV4 address.
It adds a security layer to EC2 instances that control both inbound and outbound traffic at the instance
level.
What is NACL?
NACL refers to Network Access Control List, which provides a layer of security to the Amazon Web
Services stack.NACL provids a firewall by securing the VPCs and subnets. It is an optional layer for VPC,
which adds another security layer to the Amazon service.
Components of NACL
Following are the components of Network Access Control List (NACL):
Rule number: Every rule is assigned a unique number. The rule’s priority is also based on the
number it is assigned.
Type: This tells about the type of traffic, like SSH, HTTP, HTTPS.
Protocol: Protocol is a set of rules, that is applied to every request, ex: http, https, ICMP, SSH.
Portrange: The listening port, which takes in the request from the user, such as HTTP is associated
with port 80.
Inboundrules: Also known as source. These rules talk about the source from where the request or
traffic is coming from, and about the destination port/ the port through which the response is sent.
Outboundrules: Also known as destination. These rules talk about where the response should be
sent and about the destination port.
Allow/Deny: Whether the specific traffic has to be allowed or denied.
There are two types of NACL:
1. Customized NACL: It can also be understood as a user-defined NACL, and its inherent
characteristic is to deny any incoming and outgoing traffic until a rule is added to handle the traffic.
2. Default NACL: This is the opposite of customized NACL, which allows all the traffic to flow in and
out of the network. It also comes with a specific rule which is associated with a rule number, and it
can’t be modified or deleted. When the request doesn’t match with its associated rule, the access to it
is denied.
3.16 Lab - NACL & Security Groups
Security groups and NACL both act as virtual firewalls which control the traffic from Inbound and
Outbound.
Security Group:
Security groups are virtual shields or protectors of EC2 instances. Unless specifically allowed By
default all Inbound traffic is blocked whereas all Outbound traffic is allowed from the Instance.
We can edit inbound and outbound rules after creating the Security Group. Here is an example of default
outbound rules which allow all traffic for all protocols.
It is virtual firewall for your EC2 instances to control incoming and outgoing traffic
Security Group -Outbound
Here, we are adding inbound rules for protocol SSH with the default port of 22 for our current IP
address here.
NACL- Outbound
Limit of NACL :
1. The Maximum rules in a single NACL can have 20 rules.
Tasks
Step 1: Create and analyze a path
Step 2: View the results of the path analysis
Specify the path for the traffic from a source to a destination. After you create the
path, Reachability Analyzer analyzes the path once. You can analyze a path at any
time to determine whether your intended connectivity is supported, even as your
network configuration changes.
To create a path
1. Open the Network Manager console
at https://console.aws.amazon.com/networkmanager/home.
2. In the navigation pane, choose Reachability Analyzer.
3. Choose Create and analyze path.
4. (Optional) For Name tag, enter a descriptive name for the analysis.
5. To specify the source resource, choose the resource type from Source type, and
then choose the specific
resource from Source.
6. To specify the destination resource, choose the resource type from Destination
type, and then choose
the specific resource from Destination.
7. For Protocol, choose TCP or UDP.
8. (Optional) To add a tag, choose Add new tag and then enter the tag key and tag
value.
9. Choose Create and analyze path.
After the path analysis completes, you can view the result of the analysis.
To view the results of the path analysis
1. Choose the ID of the path in the Path ID column to view the path details page.
2. In the Analysis explorer panel, find Reachability status and check whether it
is Reachable or Not reachable. If the path is reachable, the console displays the
shortest route found between the source and destination. Otherwise,
expand Explanations, Details for information about the blocking component.
3. If the reachability status matches your intent, there is no further action required.
Consider running the analysis again if you change your network configuration so that
you can ensure that the reachability status still matches your intent. Otherwise,
proceed to Step 3.
If the reachability status does not match your intent, you can change your network
configuration. Then you can analyze the path again to confirm that the reachability
status matches your intent.
2. Identify the component that is overly permissive and update its configuration.
3. Choose Analyze path to confirm that the path is no longer reachable.
If you no longer need the path, you can delete it. When you delete a path, you also
delete all its analyses. If you keep the path, note that Reachability Analyzer will
automatically delete the analysis 120 days after its creation date.
AWS uses the existing infrastructure of a VPC to create a VPC peering connection; it
is neither a gateway nor a VPN connection, and does not rely on a separate piece of
physical hardware. There is no single point of failure for communication or a
bandwidth bottleneck.
A VPC peering connection helps you to facilitate the transfer of data. For example, if
you have more than one AWS account, you can peer the VPCs across those accounts
to create a file sharing network. You can also use a VPC peering connection to allow
other VPCs to access resources you have in one of your VPCs.
When you establish peering relationships between VPCs across different AWS
Regions, resources in the VPCs (for example, EC2 instances and Lambda functions) in
different AWS Regions can communicate with each other using private IP addresses,
without using a gateway, VPN connection, or network appliance.
To activate the request, the owner of the accepter VPC must accept the request. For
an inter-Region VPC peering connection, the request must be accepted in the Region
of the accepter VPC.
Prerequisites
Review the limitations and rules for VPC peering connections.
Ensure that your VPCs do not have overlapping IPv4 CIDR blocks. If they overlap,
the status of the VPC peering connection immediately goes to failed. This limitation
applies even if the VPCs have unique IPv6 CIDR blocks.
a.Create with VPCs in the same account and Region
To create a VPC peering connection with VPCs in the same account and Region
1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.
2. In the navigation pane, choose Peering connections.
3. Choose Create peering connection.
4. Configure the following information, and choose Create peering
connection when you are done:
Name: You can optionally name your VPC peering connection.
VPC ID (Requester): Select the VPC in your account with which you want to
create the VPC
peering connection.
For Select another VPC to peer with, choose My account and select
another of your VPCs.
(Optional) To add a tag, choose Add new tag and enter the tag key and value.
5. Choose Actions, Accept request.
6. When prompted for confirmation, choose Accept request.
7. Choose Modify my route tables now to add a route to the VPC route table so
that you can send and receive traffic across the peering connection.
You can create a VPC peering connection using the following commands:
create-vpc-peering-connection
(AWS CLI)
New-EC2VpcPeeringConnection (AWS Tools for Windows PowerShell)
o Interface Endpoints
o Gateway Endpoints
Interface Endpoints
o Interface Endpoint is an Elastic Network Interface with a private IP address which will
act as an entry point for the traffic destined to a particular service.
o An interface endpoint supports services such as Amazon CloudWatch, Amazon SNS,
etc.
Gateway Endpoints
o Gateway Endpoint is a gateway which is targetted for a specific route in your route
table.
o It can be used to route the traffic to a destined service.
o Amazon S3 and DynamoDB are the only services which are supported by Gateway
Endpoints.
Service category: I select the AWS services that I will use through the VPC
Endpoint.
Service name: Select the service that you want to use. Suppose I choose AWS S3
service.
VPC: Select the VPC that you have created. I have created javatpointvpc, so choose
the javatpointvpc from the VPC drop-down menu.
Configure route tables: Choose the main route table that has been created in a
javatpointvpc.
o The below screen shows that the VPC Endpoint has been created.
Amazon VPC Flow Logs is a feature that enables you to capture and log the information about the
network traffic going to and from the designated network interfaces within your VPC. It can be used as a
centralized, single source of information to monitor different network aspects of your VPC.
Kinds of VPC Flow Logs
It is very much important to understand what is monitored and how the logs compile the data. Amazon
Web Service (AWS) Offers flow logging at three separate levels:
Virtual Private Cloud (VPC): Flow logs can be enabled to a particular VPC and can monitor all the
activity within your cloud environment.
Subnet: VPCs are often divided into subnets spanning multiple availability zones in a region.
A subnet is a range of IP addresses in your VPC. It can be a private or a public one. Flow Logs can be
created for a specific subnet to monitor all the activity within your subnet.
Elastic Network Interface (ENI): ENIs are virtual network cards you can attach to your EC2
instances. They are used to enable network connectivity for your instances. One can monitor and capture
full flow logs from these interfaces to stay ahead of issues like latency and malicious activities.
3.24 Lab - VPC Flow Logs
VPC FlowLogs can be created at three levels:
o VPC
o Subnet
o Network Interface Level
how to create a VPC FlowLog
o Sign in to the AWS Management Console.
o Move to the VPC service and we can see from the below screen that VPC with the name
javatpointvpc has already been created.
o Click on the custom VPC and then click on the Actions drop-down menu. Click on the create
FlowLog.
Where,
Filter: It determines the type of traffic to be logged. There are three types of filters: All, Accept and Reject.
'All' is used to log both accepted and rejected traffic. 'Accept' is used to log only accepted traffic while
'Reject' logs only rejected traffic.
Destination: Destination determines where you want to send your traffic. Two types of destinations are
available: Send to CloudWatch Logs and Send to an S3 bucket. I choose "Send to CloudWatch Logs" as a
destination.
Destination log group: It determines the name of the destination. Till now, we have not created the
CloudWatch Log. First, we create CloudWatch Log and then add the name of the Log to this Log group.
o Click on the CloudWatch.
o Finally, CloudWatch log is created. Enter the log name in FlowLog console.
From the above screen, we have observed that "No IAM role selected". To select the IAM role, we need to
create an IAM role first. Click on the Set Up Permissions.
o To create an IAM role, enter the role name and then click on the Allow button.
o After creating the IAM role, enter the IAM role in the FlowLog console.
o The below screen shows that the flowlog has been created.
3.25 Site to Site VPN, Virtual Private Gateway & Customer Gateway
Site to Site VPN:
A site-to-site virtual private network (VPN) refers to a connection set up between multiple networks.
This could be a corporate network where multiple offices work in conjunction with each other or a branch
office network with a central office and multiple branch locations.
Site-to-site VPNs are useful for companies that prioritize private, protected traffic and are particularly
helpful for organizations with more than one office spread out over large geographical locations. These
businesses often have to access resources housed on a primary network, which could include servers that
facilitate email or store data. In some instances, a server may be the operational hub of an application
essential to the company’s business. A site-to-site VPN can, in that case, give all sites full access to the
application—as if it were housed within their physical facility.
When you create a virtual private gateway, you can specify the private Autonomous System Number
(ASN) for the Amazon side of the gateway. If you don't specify an ASN, the virtual private gateway is
created with the default ASN (64512). You cannot change the ASN after you've created the virtual private
gateway. To check the ASN for your virtual private gateway, view its details in the Virtual Private
Gateways screen in the Amazon VPC console, or use the describe-vpn-gateways AWS CLI command.
Customer Gateway
A customer gateway is a resource that you create in AWS that represents the customer gateway device in
your on-premises network. When you create a customer gateway, you provide information about your
device to AWS. A customer gateway device is a physical device or software application on your side of the
Site-to-Site VPN connection. You configure the device to work with the Site-to-Site VPN connection.
To use Amazon VPC with a Site-to-Site VPN connection, you or your network administrator must also
configure the customer gateway device or application in your remote network.
3.26 Lab - Site to Site VPN, Virtual Private Gateway & Customer Gateway
Getting started with AWS Site-to-Site VPN
Use the following procedure to set up an AWS Site-to-Site VPN connection. During
creation, you will specify a virtual private gateway, a transit gateway, or "Not
associated" as the target gateway type. If you specify "Not associated", you can
choose the target gateway type at a later time, or you can use it as a VPN attachment
for AWS Cloud WAN. This tutorial helps you create a VPN connection using a virtual
private gateway. It assumes that you have an existing VPC with one or more subnets.
To set up a VPN connection using a virtual private gateway, complete the following
steps:
Tasks
Prerequisites
Prerequisites
You need the following information to set up and configure the components of a VPN connection.
Item Information
Customer gateway device The physical or software device on your side of the VPN
connection. You need the vendor (for example, Cisco),
platform (for example, ISR Series Routers), and software
version (for example, IOS 12.4).
Customer gateway To create the customer gateway resource in AWS, you need
the following information:
The internet-routable IP address for the device's external
interface
The type of routing: static or dynamic
For dynamic routing, the Border Gateway Protocol
(BGP) Autonomous System Number (ASN)
(Optional) Private certificate from AWS Private
Certificate Authority to authenticate your VPN
VPN connection To create the VPN connection, you need the following
information:
For static routing, the IP prefixes for your private
network.
(Optional) Tunnel options for each VPN tunnel..
Permissions
To properly load the download configuration screen from the AWS Management Console, you must
ensure that your IAM role or user has permission for the following Amazon EC2
APIs: GetVpnConnectionDeviceTypes and GetVpnConnectionDeviceSampleConfiguration.
AWS Direct Connect links your internal network to an AWS Direct Connect location over a standard
Ethernet fiber-optic cable. One end of the cable is connected to your router, the other to an AWS Direct
Connect router. With this connection, you can create virtual interfaces directly to public AWS services (for
example, to Amazon S3) or to Amazon VPC, bypassing internet service providers in your network path. An
AWS Direct Connect location provides access to AWS in the Region with which it is associated. You can
use a single connection in a public Region or AWS GovCloud (US) to access public AWS services in all
other public Regions.
The following diagram shows a high-level overview of how AWS Direct Connect interfaces with your
network.
Direct Connect Gateway
AWS Direct Connect gateway is aimed at making it easier to connect from a single Direct Connect location
to multiple AWS regions or VPCs.
The Direct Connect Gateway is a device used to connect multiple AWS VPCs in different AWS regions via
Virtual private Gateways. The Direct Connect Gateway is in turn connected to the Direct Connect via a
virtual private interface. This allows multiple VPCs to be connected to the customer network via one virtual
private interface.
To use AWS PrivateLink, create a VPC endpoint in your VPC, specifying the name of
the service and a subnet. This creates an elastic network interface in the subnet that
serves as an entry point for traffic destined to the service.
You can create your own VPC endpoint service, powered by AWS PrivateLink and
enable other AWS customers to access your service.
The following diagram shows the common use cases for AWS PrivateLink. The VPC
on the left has several EC2 instances in a private subnet and three interface VPC
endpoints. The top-most VPC endpoint connects to an AWS service. The middle VPC
endpoint connects to a service hosted by another AWS account (a VPC endpoint
service). The bottom VPC endpoint connects to an AWS Marketplace partner service.
3.29 AWS Classic Link
ClassicLink allows you to link EC2-Classic instances to a VPC in your account, within
the same Region. If you associate the VPC security groups with a EC2-Classic
instance, this enables communication between your EC2-Classic instance and
instances in your VPC using private IPv4 addresses. ClassicLink removes the need to
make use of public IPv4 addresses or Elastic IP addresses to enable communication
between instances in these platforms.
You can take advantage of several Transit Gateway route tables, associations, and propagations to segment
your traffic within the same Transit Gateway. You can also take advantage of the hub-and-spoke
architecture created by Transit Gateway to centralize access to shared services such as traffic inspection,
interface VPC endpoint access, or egress traffic through a NAT gateway or NAT instances. This
centralization simplifies the complexity of managing these resources in several VPCs, and allow for a better
control as you extend your footprint in AWS.
Transit Gateways can be peered with each other within the same AWS Region or between different AWS
Regions. AWS Transit Gateway traffic always stays on the global AWS backbone.
With a large number of VPCs, Transit Gateway provides simpler VPC-to-VPC communication
management over VPC Peering, as shown in the following figure.
For a central visibility of IP traffic going to and from your Transit Gateways, you can publish Transit
Gateway Flow Logs to Amazon CloudWatch Logs and Amazon S3. Flow log data is collected outside of the
path of your network traffic, and therefore does not affect network throughput or latency.
Content inspection
Threat monitoring
Troubleshooting
Traffic Mirroring supports filters and packet truncation, so that you can extract only the traffic of interest,
using the monitoring tools of your choice.
Simplified operation — Mirror any range of your VPC traffic without having to manage packet
forwarding agents on your EC2 instances.
Enhanced security — Capture packets at the elastic network interface, which cannot be disabled or
tampered with from a user space.
Increased monitoring options — Send your mirrored traffic to any security device.
When you create a virtual private cloud (VPC), you can specify an IPv4 CIDR block and specify
whether to assign an IPv6 CIDR block to the VPC. After you enable IPv6 for a VPC, the system
automatically creates an IPv6 gateway of Free Edition for the VPC. You can use the IPv6 gateway to
manage IPv6 Internet bandwidth and configure egress-only rules.
The number of IPv4 addresses is limited. In scenarios in which IPv4 addresses are used, it takes
much time and effort for network engineers to resolve IP address conflicts. In this case, you can
enable IPv6. IPv6 provides significantly more IP addresses than IPv4. IPv6 helps solve the issue of IP
address shortage, and allows various types of devices to access the Internet.
4. In the Enable IPv6 CIDR Block dialog box, select Enable IPv6 CIDR Block of all VSwitches in
VPC, and click OK.
If you do not select Enable IPv6 CIDR Block of all VSwitches in VPC, you must enable IPv6 for each
vSwitch..
3.33 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 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.
An egress-only internet gateway has the following characteristics:
You cannot associate a security group with an egress-only internet gateway. You can use security groups
for your instances in the private subnet to control the traffic to and from those instances.
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.
You can create an egress-only internet gateway for your VPC using the Amazon VPC console.
[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.
You can view information about your egress-only internet gateway in the Amazon VPC console.
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.
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. In the navigation pane, choose Route Tables, Create route table.
3. 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.
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.
AWS data transfer costs are what AWS charges to transfer data either:
For some AWS services, the cost for moving data in or out is accounted for in the cost of the service itself,
rather than billed as a separate data transfer fee. Sometimes this means that there won’t be a distinct data
transfer cost in either direction, such as with Amazon Kinesis. Sometimes there will be a specific cost to
move data one way (out) but not the other way (in), such as when transferring to and from AWS S3 across
different regions. Other times, there will be a cost to transfer data in and transfer data out, such as when
transferring data between EC2 instances in different availability zones (AZs) of the same region.
All those variables mean that controlling data transfer costs means knowing exactly how your data is
moving around.
Data transfer rates from AWS out to the internet are highly dependent on the region. For example, for
resources located in the US West (Oregon) region, the first 100 GB per month is free, and the next 9.999 TB
per month costs $0.09 per GB. However, if a resource is located in the South America (São Paolo) region,
the first 100 GB per month is still free, but the next 9.999 TB per month costs $0.15 per GB.
Within AWS, you can transfer data across regions or within a region.
Transferring data between AWS services across regions has the same cost structure (although the rates are
a lot lower) as transferring data between AWS and the internet. These costs also depend on the region, but
data transfer into an AWS region from any other AWS region is free. In other words, you only pay for the
outbound transfer of the originating region, not the inbound transfer in the target region.
Data transfer charges between AWS services within a region depend on whether you’re transferring data
within or across AZs.
Data transfers are free if you remain within a region and the same availability zone, and you use a private
IP address. Data transfers within the same region but crossing availability zones have associated costs.
To help you visualize how this all fits together, here’s a diagram that shows the various types of data
transfer for EC2 instances. Rates are for US West (Oregon). NOTE: the $0.09 per GB charge for moving
data out of AWS is up to the first 10TB per month.