Introduction
In the world of networking, IP addresses play a crucial role in identifying devices on a network. There are two primary versions of IP addresses: IPv4 and IPv6. Understanding the differences between these two versions is essential for network administrators, developers, and anyone involved in managing IT infrastructure. This blog post will explain the differences between IPv4 and IPv6 addresses and dive into the concepts of private, public, and Elastic IPs on AWS, including how to obtain IPv6 EIP and IPv6 addresses.
IPv4 vs. IPv6
IPv4
IPv4, or Internet Protocol version 4, is the fourth version of the Internet Protocol (IP). It is the most widely used IP version and was introduced in 1981. An IPv4 address is a 32-bit number, typically represented in decimal format as four octets separated by periods (e.g., 192.168.0.1). This format provides approximately 4.3 billion unique addresses.
Key Characteristics of IPv4:
- Address Format: 32-bit numeric address divided into four octets.
- Address Space: Approximately 4.3 billion addresses.
- Notation: Decimal (e.g., 192.168.1.1).
- Usage: Predominantly used in most networks today.
- Subnetting: Uses subnet masks to divide the network into smaller subnetworks.
IPv6
IPv6, or Internet Protocol version 6, was developed to address the exhaustion of IPv4 addresses. It was introduced in 1998 and provides a vastly larger address space. An IPv6 address is a 128-bit number represented in hexadecimal format and separated by colons (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334).
Key Characteristics of IPv6:
- Address Format: 128-bit numeric address divided into eight groups of four hexadecimal digits.
- Address Space: Approximately 340 undecillion addresses.
- Notation: Hexadecimal (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334).
- Usage: Increasingly adopted in new networks and systems.
- Subnetting: Uses prefix lengths to divide the network.
Private, Public, and Elastic IPs on AWS
Private IPs
Private IP addresses are used within a private network and are not routable online. They allow devices within the same network to communicate with each other. AWS automatically assigns a private IP address to each instance within a VPC (Virtual Private Cloud).
Public IPs
Public IP addresses are routable online, allowing instances to communicate with external networks. AWS can assign a public IP address to an instance at launch, enabling it to be accessible from the internet.
Elastic IPs (EIP)
Elastic IP addresses are static public IP addresses provided by AWS. They can be associated with any instance within your account, allowing you to maintain a consistent IP address even if it is stopped and restarted.
Key Benefits of Elastic IPs:
- Static IP Address: Remains constant through instance reboots and stops.
- Reassociation: Can be reassigned to another instance quickly.
- Fault Tolerance: Helps maintain connectivity during instance failures.
Obtaining IPv6 EIP and IPv6 Addresses on AWS
IPv6 Addresses
To obtain IPv6 addresses in AWS:
- Enable IPv6 on Your VPC:
- Navigate to the VPC dashboard in the AWS Management Console.
- Select the VPC and choose “Actions” > “Edit CIDRs.”
- Add an IPv6 CIDR block to your VPC.
- Assign IPv6 Addresses to Instances:
- Go to the EC2 dashboard.
- Select the instance and choose “Actions” > “Networking” > “Manage IP Addresses.”
- Assign an IPv6 address from the available IPv6 CIDR block.
IPv6 Elastic IPs (EIP)
AWS also supports Elastic IPv6 addresses, which can be allocated and associated with instances similar to IPv4 EIPs.
- Allocate an IPv6 EIP:
- Open the “Elastic IPs” section in the EC2 dashboard.
- Click on “Allocate new address” and choose “Amazon’s pool of IPv6 addresses.”
- Associate the IPv6 EIP:
- Select the allocated IPv6 EIP.
- Choose “Actions” > “Associate address.”
- Select the instance and network interface to associate the IPv6 EIP.
Conclusion
Understanding the differences between IPv4 and IPv6 addresses and the types of IP addresses available on AWS is essential for managing modern networks. IPv6 addresses offer a much larger address space and are increasingly important as IPv4 addresses become scarce. To meet your networking needs, AWS provides flexible options for assigning IPv4 and IPv6 addresses, including private, public, and Elastic IPs.