Scenario D: IPv6 Architecture
Learn how to set up on IPv6 architecture with a dual-stack VCN.
This scenario explains how to set up an IPv6 architecture within a dual-stack virtual cloud network (VCN) using regional IPv6-only public subnet to host internet facing resources (like web servers), and a regional dual-stack private subnet to connect private resources (like databases). Place your servers in separate availability domains (AD)and fault domains (FD) for redundancy (not shown).
Compute instances in both subnets can connect to each other over IPv6 automatically. Instances in the public subnet have direct access to the internet by way of an internet gateway over IPv6. Instances in the private subnet can initiate internet destined connections over IPv4 by way of a NAT gateway, while avoiding connections initiated from the internet directly on both IPv4 and IPv6. Also, the resources in the private subnet can connect to Oracle Services Network over IPv4 and IPv6 through a service gateway. The Oracle Services Network is a conceptual network in Oracle Cloud Infrastructure reserved for Oracle services. These services have public IP addresses that you typically reach over the public internet. However, you can access the Oracle Services Network without the traffic going over the public internet through a service gateway over both IPv4 and IPv6 as long as the service offers IPv6 support.
Each subnet uses the default security list, which has default rules for IPv4 and IPv6 protocols that are designed to make it easy to get started with Oracle Cloud Infrastructure. The rules enable typical required access (for example, inbound SSH connections and any type of outbound connections). The public subnet also has an additional security list to allow HTTPS traffic inbound over IPv6, while the private subnet has an extra security list to allow intra-VCN IPv6 traffic for SQL.
Security lists are one way to control traffic in and out of the VCN's resources. You can also use Network Security Groups.
The following figure shows a compute instance with public (GUA) and private (ULA) IPv6 addresses in a regional public subnet. The public subnet uses Oracle-GUA prefixes to enable internet accessibility over IPv6 with ULA for intra-VCN communications. In this scenario, the VCN's default route table (which is always empty to start with) is used for the public subnet, which requires only a single IPv6 rule for the internet gateway. It also has an implicit set of route rules that enable the public subnet to route to the private subnet. The subnet has two security lists applied, to allow flexibility in rule management and granular access controls for each subnet. The on-premises administrators must have public IPv6 addresses to communicate with VCN resources over the internet.
The figure also shows a compute instance with ULA IPv6 and IPv4 addresses in a regional private subnet. The private subnet uses IPv6 ULA to privately communicate with the public subnet compute instances and the Oracle Services Network. It also has IPv4 for egress-only OSN and internet connectivity. Similar to the public subnet, the private subnet also has two security lists: the VCN default and another custom security list to allow internal application connectivity across subnets.
Not shown is deployment of redundant instances across several availability domains and fault domains as a recommended best practice.
| Destination CIDR | Route target |
|---|---|
| 0.0.0.0/0 | NAT Gateway |
| All OSN services in the region | Service Gateway |
| Destination CIDR | Route target |
|---|---|
| ::/0 | Internet Gateway |
Required IAM Policy
To use Oracle Cloud Infrastructure, an administrator must be a member of a group granted security access in a policy by a tenancy administrator. This access is required whether you're using the Console or the REST API with an SDK, CLI, or another tool. If you get a message that you don't have permission or are unauthorized, verify with the tenancy administrator what type of access you have, and which compartment your access works in.
If you're a member of the Administrators group, you already have the required access to implement Scenario D. Otherwise, you need access to Networking, and you need the ability to create instances. See IAM Policies for Networking.
Setting Up Scenario D in the Console
Setup is easy in the Console. Alternatively, you can use the Oracle Cloud Infrastructure API, which lets you implement the individual operations yourself.
Task 1: Create the VCN
Task 2: Create the public subnet security list
For example: For a public subnet with an internet gateway, the (web server) instances you create might need to receive inbound HTTPS connections from the internet. Here's how to create a new security list in your VCN and add a security rule to allow HTTPS traffic from the internet:
Task 3: Create the private subnet security list
For example: A private subnet for hosting a database might require client connections from public subnet clients. Here's how to create a new security list in your VCN and add a security rule to allow SQL traffic from the public subnet:
Task 4: Create the internet gateway
Task 5: Create the NAT gateway
Task 6: Create the service gateway
Task 7: Create a custom private route table
No route rule is required to route traffic within the VCN itself.
Task 8: Update the VCN Default route table
The default route table starts out with no rules. You apply this route table to the public subnet. Here you add a rule that routes all IPv6 traffic destined for addresses outside the VCN to the internet gateway. The existence of this rule also allows inbound connections to come from the internet to the subnet's GUA prefixes, through the internet gateway. You use security list rules to control the types of traffic that are allowed in and out of the instances in the subnet.
No route rule is required to route traffic within the VCN itself.
Task 9: Create the regional public subnet
Task 10: Create the regional private subnet
Task 11: Create instances in separate availability domains
Each instance VNIC can have an automatic or manually assigned IP addresses. For public subnet instances, you must assign IPv6 addresses from the Oracle-GUA prefix to have internet accessibility. We recommend provisioning several instances across several availability domains and fault domains for high availability (Not shown).
After creating an instance in this scenario, you can connect using IPv6 from the internet with SSH. Additionally, you can SSH to the private instance from the public instance or set up Bastion service using IPv4 connectivity. For more instructions on deploying instances, see Creating an Instance. For more information and instructions with Bastions, see Bastion Overview.
Using the API
For information about using the API and signing requests, see REST API documentation and Security Credentials. For information about SDKs, see SDKs and the CLI.
Use the following operations:
- CreateVcn: Always include a DNS label if you want the VCN to use the VCN Resolver (see DNS in a Virtual Cloud Network).
- CreateSecurityList: Call it to create the public subnet security list with these rules:
- Stateful ingress: Source type = CIDR, source ::/0 on TCP, source port = all, destination port = 443 (HTTPS)
- CreateSecurityList: Call it again to create the private subnet security list with these rules:
- Stateful ingress: Source type = CIDR, source IPv6 ULA prefix of public subnet on TCP, source port = all, destination port = 1521 (for Oracle databases)
- CreateInternetGateway
- CreateNatGateway
- CreateServiceGateway
- CreateRouteTable: Call it to create the private subnet route table. To enable IPv4 communication by way of the NAT gateway, add a route rule with destination = 0.0.0.0/0, and destination target = the NAT gateway you created earlier. Also add a route toward OSN Services prefixes.
- UpdateRouteTable Call it to update the default VCN route table associated with the public subnet. To enable communication by way of the internet gateway, add a route rule with destination = ::/0, and destination target = the internet gateway you created earlier.
- CreateSubnet: Call it to create regional public subnet. Include a DNS label for the subnet if you want the VCN Resolver to resolve hostnames for VNICs in the subnet. Use the public subnet route table you created earlier. Use both the default security list and the public subnet security list that you created earlier. Use the default set of DHCP options.
- CreateSubnet: Call it again to create regional private subnet. Include a DNS label for the subnet if you want the VCN Resolver to resolve hostnames for VNICs in the subnet. Use the private subnet route table you created earlier. Use both the default security list and the private subnet security list that you created earlier. Use the default set of DHCP options.
- First call GetRouteTable to get the private subnet route table. Then call UpdateRouteTable to add a route rule with destination = the on-premises network CIDR (10.0.0.0/16 in this example), and destination target = the DRG you created earlier.
- LaunchInstance: Launch at least one instance in each subnet. By default, the instances in the public subnets are assigned public IP addresses. For more information, see Creating an Instance.
You can now communicate from your on-premises network with the instances in the public subnet over the internet gateway.
