- IPV4 has 3.7 Billion addresses
- Machines in a private network can connect to internet using NAT + Internet gateway that act as a proxy
- Elastic IP - start and stop (does not change the public IP), mask the failure. Elastic IP is bad idea
- if you don’t use elastic IP, stop will change the public IP
- Load balancer , no public IP at all
Elastic Network Interfaces (ENI)
- Network Interface
- This is what gets you the IP
- ENI can have following attributes
- Primary IpV4
- Secondary IpV4
- One Elastic IP per private IPv4
- Security groups (1 or more)
- A MAC address
- Src or destination check flag
- Delete on Termination flag
- ENIs can be created independently of EC2 and attached to EC2
- ENIs are bound to a AZ
- Helpful for Network failover
- ENI that are created with EC2 will be deleted with the deletion of instance
- ENIs are associated with a subnet
Usage
- The instance’s first ENI would be attached to a public subnet, routing 0.0.0.0/0 (all traffic) to the VPC’s Internet Gateway. The instance’s second ENI would be attached to a private subnet, with 0.0.0.0 routed to the VPN Gateway connected to your corporate network. You would use the private network for SSH access, management, logging, and so forth. You can apply different security groups to each ENI so that traffic port 80 is allowed through the first ENI, and traffic from the private subnet on port 22 is allowed through the second ENI.
- Multi-Interface Applications – You can host load balancers, proxy servers, and NAT servers on an EC2 instance, carefully passing traffic from one subnet to the other. In this case you would clear the Source/Destination Check Flag to allow the instances to handle traffic that wasn’t addressed to them. We expect vendors of networking and security products to start building AMIs that make use of two ENIs.
ENI