Technology 👤 KP Expert 📅 Sep 15, 2026 👁️ 403 views

IPv6 on Oracle OCI: Configuring and Testing Cross-VCN Communication with ICMPv6

A step-by-step walkthrough of enabling IPv6 on two OCI VCNs, connecting them, and validating cross-VCN reachability with ICMPv6 — including the one protocol mistake that trips up almost everyone.

/56
IPv6 GUA prefix per VCN
/64
IPv6 prefix per subnet
6
Setup steps covered below

IPv6 adoption inside Oracle Cloud Infrastructure (OCI) tends to expose a gap most engineers don't hit until they're already mid-deployment: enabling IPv6 on a VCN is straightforward, but getting two separate VCNs to actually talk to each other over IPv6 — and proving it with something as simple as a ping6 — involves several layers most IPv4-only deployments never touch. This post walks through configuring IPv6 on two OCI VCNs end to end, connecting them, and validating connectivity with ICMPv6.

Why This Isn't Just “IPv4 With Longer Addresses”

It's tempting to treat IPv6 configuration in OCI as a drop-in replacement for IPv4 — same VCN, same subnets, just bigger addresses. In practice, three things make cross-VCN IPv6 its own configuration surface.

Difference
Why It Matters
ICMPv6 is a distinct protocol
Security lists and NSGs treat ICMP and ICMPv6 as separate options — allowing one does nothing for the other
Prefix-based addressing
A VCN gets a /56 GUA prefix (Oracle-allocated, ULA, or BYOIPv6); each subnet gets a /64 carved from it
Explicit cross-VCN routing
Enabling IPv6 on two VCNs independently does not connect them — a DRG or LPG plus route and security rules on both sides is required
Step 1: Enable IPv6 on Both VCNs

IPv6 is enabled at VCN creation or added to an existing VCN. Via the OCI CLI:

create-vcn-ipv6.sh
# Create a new VCN with IPv6 enabled (Oracle-allocated GUA)
oci network vcn create \
  --compartment-id "ocid1.compartment.oc1...." \
  --display-name "vcn-a" \
  --cidr-blocks '["10.0.0.0/16"]' \
  --is-ipv6-enabled true

# Or add an IPv6 CIDR to an existing VCN
oci network vcn add-ipv6-vcn-cidr \
  --vcn-id "ocid1.vcn.oc1...." \
  --is-oracle-gua-allocation-enabled true

Repeat this for the second VCN (vcn-b), using a separate IPv4 CIDR block. Each VCN receives its own /56 IPv6 GUA prefix from Oracle — you don't choose the prefix yourself unless you're using ULA or BYOIPv6.

Step 2: Carve Out IPv6 Subnets

Each subnet needs its own /64 slice of the VCN's /56. In Terraform, this is typically done with cidrsubnet() against the VCN's allocated IPv6 block:

subnet_a.tf
resource "oci_core_subnet" "subnet_a" {
  compartment_id    = var.compartment_id
  vcn_id            = oci_core_vcn.vcn_a.id
  display_name      = "subnet-a"
  cidr_block        = "10.0.1.0/24"
  ipv6cidr_block    = cidrsubnet(oci_core_vcn.vcn_a.ipv6cidr_blocks[0], 8, 0)
  route_table_id    = oci_core_route_table.rt_a.id
  security_list_ids = [oci_core_security_list.sl_a.id]
}

Do the same for subnet_b in vcn_b. At this point both subnets are IPv6-capable, but no instance has an IPv6 address yet, and the two VCNs still can't route to each other.

Step 3: Assign IPv6 Addresses to Instances

Launching an instance into an IPv6-enabled subnet does not automatically give it an IPv6 address — you have to request one explicitly at VNIC creation:

vnic_block.tf
create_vnic_details {
  subnet_id        = oci_core_subnet.subnet_a.id
  assign_public_ip = true
  assign_ipv6ip    = true
}
If you're provisioning through the console instead, this is the Assign button under the instance's VNIC IPv6 addresses tab — you can let OCI auto-assign an address from the subnet's /64 or specify one manually.

Inside the instance itself, the address often still needs to be fetched via DHCPv6, depending on the OS image:

fetch-ipv6.sh
sudo dhclient -6 ens3
ip -6 addr show

Confirm the address actually landed on the interface before moving on — a surprising number of “connectivity” issues later in this process turn out to be a VNIC with an IPv6 address assigned by OCI but never picked up by the guest OS.

Step 4: Connect the Two VCNs

For two VCNs in the same region, the simplest path is a Local Peering Gateway (LPG) on each VCN, peered to each other. For cross-region or hub-and-spoke topologies, a Dynamic Routing Gateway (DRG) with both VCNs attached is the standard approach. Either way, IPv6 traffic needs its own route rules — dual-stack VCNs don't inherit IPv6 routing from their IPv4 route rules.

Route table entry on vcn-a, pointing IPv6 traffic destined for vcn-b's prefix at the peering connection:

route-table-a.sh
oci network route-table update \
  --rt-id "ocid1.routetable.oc1...." \
  --route-rules '[
    {
      "destination": "<vcn-b-ipv6-prefix>/56",
      "destinationType": "CIDR_BLOCK",
      "networkEntityId": "<lpg-or-drg-ocid>"
    }
  ]'
Mirror this on vcn-b's route table, pointing back at vcn-a's IPv6 prefix. Both directions need explicit rules — OCI routing is not automatically bidirectional just because a peering connection exists.
Step 5: Configure Security Rules for ICMPv6

This is where most cross-VCN IPv6 setups actually fail, and it's almost always the same mistake: security lists configured for ICMP instead of ICMPv6. In the OCI console or CLI, these are distinct protocol options, and permitting one does nothing for the other.

Ingress rule on vcn-a's security list, allowing ICMPv6 from vcn-b's prefix:

Field
Value
Source
<vcn-b-ipv6-prefix>/56
IP Protocol
ICMPv6
Type
All (or restrict to Echo Request/Reply for a tighter rule)

Egress rule, permitting outbound IPv6 traffic to vcn-b: destination <vcn-b-ipv6-prefix>/56, IP Protocol All. Repeat symmetrically on vcn-b's security list.

If you're using network security groups (NSGs) instead of security lists, the same ICMPv6-specific rule applies. A tighter production rule restricts ICMPv6 to just Echo Request (128) and Echo Reply (129) — though ICMPv6 also carries essential functions like Neighbor Discovery, so avoid blanket-blocking the whole protocol without understanding the effect on address resolution within the subnet.
Step 6: Validate Connectivity

From an instance in vcn-a, ping the IPv6 address of an instance in vcn-b:

validate.sh
ping6 -c 4 <vcn-b-instance-ipv6-address>

If this fails, work through the failure points in order rather than guessing:

#
Check
1
Confirm the IPv6 address is actually assigned on both instances (ip -6 addr show)
2
Check the route table on both VCNs — is there an explicit IPv6 route rule pointing at the LPG/DRG, in both directions?
3
Check both security lists — is the rule specifically ICMPv6, not ICMP? This is the failure mode that catches almost everyone the first time.
4
Check the guest OS firewall — ip6tables -L INPUT -n -v on Linux images
5
Check for a Network Security Group attached to the VNIC that might be overriding or supplementing the security list with a more restrictive rule

Once ping6 succeeds in both directions, you've confirmed the full path: IPv6 addressing, subnet allocation, inter-VCN routing, and security rules are all correctly aligned.

Where This Fits in a Broader Architecture

Cross-VCN IPv6 connectivity matters beyond the lab exercise of getting ping6 to succeed. It's the same underlying mechanism used for IPv6-enabled hybrid connectivity over FastConnect or Site-to-Site VPN, for resolving overlapping IPv4 CIDR conflicts between VCNs by routing over IPv6 instead, and for any architecture where dual-stack support is a compliance or interoperability requirement rather than a preference. Getting the fundamentals right at the two-VCN scale — correct prefix allocation, explicit routing in both directions, and protocol-correct security rules — is what makes those larger topologies tractable rather than a fresh source of the same ICMP/ICMPv6 mistake at greater scale.

Recap: what to take away

  • A VCN gets a /56 IPv6 GUA prefix; each subnet gets a /64 carved from it — and instances still need an explicit IPv6 address assignment.
  • Connecting two VCNs requires an LPG (same region) or DRG (cross-region), plus explicit IPv6 route rules in both directions.
  • ICMP and ICMPv6 are separate protocol options in Oracle OCI security lists and NSGs — this mismatch is the most common reason ping6 fails.
  • When troubleshooting, check address assignment, routing, security rules, and the guest OS firewall — in that order.
OCI NETWORKING SERIES Published by KP Expert →
Recently Enrolled

Student enrolled in this course.

View course
Explore Courses

Latest from @kp__expert

Follow on Instagram
Loading Instagram posts...

AI Course Assistant

Share your details and goals to get the best course recommendations.

Recommended Courses

Select a course name to view full details.

Course Details
Enrollment & Contact
  • Review selected course and confirm your enrollment request.
  • Click checkout to move into the full payment process.
  • After payment submission, your enrollment is processed by our team.
Admissions Contact
Email: info@kpexpert.com
Phone: +91 92708 37105
Your submitted details
Name, email and phone will appear here.
Your request has been submitted successfully. Our team will contact you shortly.