EC2 Network Features
EC2 Network offers many features such as low latency, high performance computing, enhanced networking, and more.
VPC and EC2
All EC2 instance types are possible to be launched from a VPC
The instance types C4, M4 &T2 can only be launched in VPC and not in EC2-Classic.
These are the benefits of launching an EC2 instance from within a VPC:
Multiple IP addresses can be assigned to the instances
Define network interfaces and attach one or several network interfaces to the instances
Change the security group membership of the instances while they are running
Control the outbound traffic to the instances (egress filtering), as well as the inbound traffic (ingress filtering).
Network access control lists (ACL), add an additional layer to access control for the instances
Run the instances on dedicated hardware for a single tenantEC2 Instance IP Addressing
Private IP address and Internal DNS HostnamesPrivateIP address is an IP address that can only be reached within the network.
An instance is launched by assigning a default network interface eth0 a private IP adrese and an internal DNS hostname. This resolves to the private address and can be used to communicate between instances within the same network.
Private IP address and DNS hostname can’t be resolved outside of the network where the instance is located.
Private IP address behavior remains associated with the instance even if it is stopped or restarted
Disassociated only when the instance has been terminated
An instance can be assigned a private address when it is launched. EC2 will assign an IP address to the instance if it falls within the address range of a subnet.
You can also assign secondary private IP addresses to private IP addresses. Secondary private IP addresses are not available for reassignment.
Public IP address and External DNS hostnamesA public address can be reached via the Internet
Each instance is assigned a public IP address and given an External DNS hostname.
An external DNS hostname resolves both to the public IP address outside of the network and to the private address within it.
Through NAT, the primary Private IP address is associated to the Public IP address.
An instance within a VPC may or not be assigned an IP address, depending on the subnet Assign Private IP attribute
Public IP address assigned by the pool comes from the public IP address pool. It is assigned to the instance and not to the AWS account. It is not possible to reuse it once disassociated.
Public IP address behavior cannot be manually associated with or disassociated from an instance
When an instance is terminated or stopped, it is released.
A new public IP address will be assigned to an instance that has been stopped.
When an instance is assigned an ElasticIP address, it is released
If more than one network interface is attached to an instance, the assignment is not given
Multiple private IP addresses in EC2-VPC
This is useful in the following situations: Host multiple websites on one server by using multiple SSL certificate on a single server, associating each certificate to a specific IP address.
Network appliances such as load balancers and firewalls that have multiple private IP addresses can be used to operate.
In case the instance fails, redirect internal traffic to a backup instance by assigning the secondary private IP address of the standby instance.
Multiple IP addresses can be used with Network Interfaces. A secondary IP address can also be assigned to any network interface. These interfaces can be attached or detached from an instance.
Secondary IP addresses must be assigned from the CIDR range of the subnet to the network interface
EC2 Network Features