Home / OCI

OCITroubleshootingAdvanced

OCI instance has no IPv6 connectivity: VCN prefix, subnet /64, VNIC address, ::/0 route and ICMPv6 rules

Work layer by layer through why an OCI instance has no IPv6 address or can't reach the internet over IPv6. Covers VCN and subnet prefixes, VNIC addresses, the ::/0 route, security rules and the guest OS.

Deepak Bhardwaj7 min read

Applies toOCI VCN with IPv6 (Oracle GUA, ULA or BYOIPv6), OCI Compute (Oracle Linux 8/9, Windows Server), OCI CLI 3.x

Symptom

You enabled IPv6 on a VCN, but the instance shows only a link-local fe80:: address. Or it has an IPv6 address, but curl -6 and ping -6 time out, and an external IPv6-only client can't reach the service. IPv4 works fine.

On OCI, IPv6 has to be in place at six layers before a packet leaves the instance:

  1. The VCN has an IPv6 prefix.
  2. The subnet has a /64 from that prefix.
  3. The VNIC has an IPv6 address object.
  4. The guest OS has picked that address up over DHCPv6.
  5. The route table has a ::/0 rule to the internet gateway (or a route to a DRG or LPG for private paths).
  6. Security lists or NSGs allow IPv6. IPv4 rules don't cover IPv6.

Work through them in order. Most cases are layer 3, 4 or 6.

Warning

Adding an IPv6 prefix to a VCN can't be undone. You can't remove or modify it afterward, and an IPv6-enabled subnet can't go back to IPv4-only. If Terraform manages the VCN, set IPv6 in code. Setting the Oracle GUA flag to false in Terraform removes the prefix.

Quick triage table

What you see Layer Fix
Only fe80:: in ip -6 addr 1–4 Check the VCN prefix, subnet /64 and VNIC IPv6 object, then renew DHCPv6
Address shows in the Console but not in the OS 4 Run dhclient -6, check the NetworkManager ipv6.method, open the DHCPv6 client port in firewalld
Address in the OS, outbound IPv6 times out 5, 6 Add a ::/0 route to the IGW and an IPv6 egress rule
Outbound works, inbound from the internet fails 6, OS Add an IPv6 ingress rule, then check firewalld/ip6tables
Private subnet, outbound IPv6 needed Design No NAT or service gateway path for IPv6. Use a public subnet with a GUA, or route through a DRG
Address starts with fd Design ULA, not internet-routable. Use the Oracle GUA or BYOIPv6 prefix for internet traffic
Large transfers hang, small requests work 6 ICMPv6 type 2 (Packet Too Big) is blocked

Check 1: VCN and subnet prefixes

VCN=ocid1.vcn.oc1..example
SUBNET=ocid1.subnet.oc1..example

oci network vcn get --vcn-id "$VCN" \
  --query 'data.{gua:"ipv6-cidr-blocks",ula:"ipv6-private-cidr-blocks",byoip:"byoipv6-cidr-blocks"}'

oci network subnet get --subnet-id "$SUBNET" \
  --query 'data.{v6:"ipv6-cidr-blocks",noPublicIp:"prohibit-public-ip-on-vnic",noIngress:"prohibit-internet-ingress",rt:"route-table-id",sl:"security-list-ids"}'

If the VCN has no prefix, add the Oracle-allocated /56 GUA:

oci network vcn add-ipv6-vcn-cidr --vcn-id "$VCN" \
  --is-oracle-gua-allocation-enabled true --wait-for-state AVAILABLE

If the subnet has no IPv6 block, add a /64 from inside the VCN prefix. Each subnet IPv6 prefix must be exactly /64.

oci network subnet add-ipv6-subnet-cidr --subnet-id "$SUBNET" \
  --ipv6-cidr-block 2603:c020:4000:1a00::/64

Internet reachability follows the subnet type. A private subnet (prohibit-internet-ingress true) gets no internet IPv6 even with a GUA address.

Check 2: does the VNIC have an IPv6 address?

A subnet with IPv6 doesn't put an address on existing VNICs automatically. Find the VNIC, then list its IPv6 objects:

COMP=ocid1.compartment.oc1..example
INST=ocid1.instance.oc1..example

VNIC=$(oci compute vnic-attachment list --compartment-id "$COMP" --instance-id "$INST" \
  --query 'data[0]."vnic-id"' --raw-output)

oci network ipv6 list --vnic-id "$VNIC" \
  --query 'data[].{ip:"ip-address",state:"lifecycle-state",subnetCidr:"ipv6-subnet-cidr"}' --output table

If the list is empty, create one. OCI picks a free address unless you pass --ip-address:

oci network ipv6 create --vnic-id "$VNIC" --display-name app01-v6 \
  --wait-for-state AVAILABLE

If the subnet has more than one IPv6 prefix, add --ipv6-subnet-cidr to choose which one. A VNIC can hold up to 32 IPv6 addresses. Reserved public IPs aren't supported for IPv6, and hostnames aren't auto-assigned to IPv6 addresses. Create AAAA records yourself.

Check 3: the guest OS picked it up

OCI hands out IPv6 addresses through DHCPv6. If the OS isn't running a DHCPv6 client, the address never appears.

Oracle Linux

ip -6 addr show dev ens3          # interface name varies: ens3, enp0s3...
ip -6 route show

# Request the address now (on images that ship dhclient)
sudo dhclient -6 ens3

# NetworkManager: IPv6 must not be "ignore" or "disabled"
nmcli -f NAME,DEVICE connection show
nmcli -g ipv6.method connection show "System ens3"

# firewalld must let DHCPv6 replies in (custom images often miss this)
sudo firewall-cmd --list-services
sudo firewall-cmd --permanent --add-service=dhcpv6-client
sudo firewall-cmd --reload

Also check that IPv6 isn't disabled at the kernel level. Hardened images sometimes set this:

sysctl net.ipv6.conf.all.disable_ipv6 net.ipv6.conf.ens3.disable_ipv6
grep -r disable_ipv6 /etc/sysctl.conf /etc/sysctl.d/ 2>/dev/null
cat /proc/cmdline | grep -o 'ipv6.disable=[01]'

Caution

Changing the NetworkManager connection or restarting networking over SSH can drop your session. Open the serial console connection first, or make the change in a maintenance window.

Windows Server

Get-NetIPAddress -AddressFamily IPv6 | Where-Object PrefixOrigin -ne 'WellKnown' |
  Select-Object InterfaceAlias, IPAddress, PrefixOrigin
ipconfig /renew6
Get-NetAdapterBinding -ComponentID ms_tcpip6     # IPv6 must be Enabled on the adapter

Check 4: route table

IPv6 route rules can target only an internet gateway, a DRG or an LPG. There's no NAT gateway or service gateway option for IPv6.

RT=$(oci network subnet get --subnet-id "$SUBNET" --query 'data."route-table-id"' --raw-output)

oci network route-table get --rt-id "$RT" \
  --query 'data."route-rules"[].{dest:destination,target:"network-entity-id"}' --output table

You need a ::/0 rule (destination type CIDR_BLOCK) pointing at the internet gateway. oci network route-table update --route-rules replaces the whole list, so export the current rules first and add the new one to the file:

oci network route-table get --rt-id "$RT" --query 'data."route-rules"' > rules.json
# edit rules.json and append:
# {"destination":"::/0","destinationType":"CIDR_BLOCK","networkEntityId":"ocid1.internetgateway.oc1..example"}
oci network route-table update --rt-id "$RT" --route-rules file://rules.json --force

Check the file carefully before applying it. CLI output uses hyphenated keys, while input accepts camelCase. Make sure the existing IPv4 0.0.0.0/0 rule is still in the file.

Check 5: security rules

IPv4 rules don't match IPv6 traffic. The default security list only has stateful ingress for TCP 22 and ICMPv6 type 2 code 0 from ::/0. You still need an IPv6 egress rule and any application ports. NSG rules are added incrementally, which is safer than rewriting a security list:

NSG=ocid1.networksecuritygroup.oc1..example

oci network nsg rules add --nsg-id "$NSG" --security-rules '[
  {"direction":"EGRESS","protocol":"all","destination":"::/0","destinationType":"CIDR_BLOCK","isStateless":false},
  {"direction":"INGRESS","protocol":"6","source":"::/0","sourceType":"CIDR_BLOCK","isStateless":false,
   "tcpOptions":{"destinationPortRange":{"min":443,"max":443}}},
  {"direction":"INGRESS","protocol":"58","source":"::/0","sourceType":"CIDR_BLOCK","isStateless":false,
   "icmpOptions":{"type":2}},
  {"direction":"INGRESS","protocol":"58","source":"::/0","sourceType":"CIDR_BLOCK","isStateless":false,
   "icmpOptions":{"type":128}}
]'

oci network nsg rules list --nsg-id "$NSG" \
  --query 'data[?contains(source||destination,`:`)].{dir:direction,proto:protocol,src:source,dst:destination}' --output table

Protocol 58 is ICMPv6. Type 2 (Packet Too Big) is required for path MTU discovery. Type 128 is echo request, needed for ping -6. Check the current limits: there's a per-NSG cap on IPv6 rules and a separate one per security list. Service CIDR labels can't be used in IPv6 rules.

Make sure the VNIC is actually in the NSG:

oci network vnic get --vnic-id "$VNIC" --query 'data."nsg-ids"'

Finally, the host firewall blocks inbound IPv6 separately from IPv4:

sudo firewall-cmd --permanent --add-service=https && sudo firewall-cmd --reload
sudo ip6tables -S | head -40

Verify end to end

ip -6 addr show scope global
ping -6 -c 3 2001:4860:4860::8888
curl -6 -sS -o /dev/null -w '%{http_code}\n' https://example.com
# From an external IPv6 host:
curl -6 -v https://[2603:c020:4000:1a00::10]/

Load balancers, VPN and FastConnect

  • Load balancer: IPv6 is a dual-stack option chosen when you create the load balancer, and it needs a regional subnet. Backends are reached over IPv4. An existing IPv4-only load balancer can't be switched, so create a new one.
  • Site-to-Site VPN and FastConnect: both support IPv6. You must add IPv6 BGP addresses or static routes, DRG route entries and IPv6 security rules on both sides.

Prevent it next time

  • Enable IPv6 at VCN creation in Terraform (is_ipv6enabled, plus subnet ipv6cidr_blocks), so prefixes are never added by hand and then drift.
  • In every route table and NSG module, pair each IPv4 rule with an IPv6 rule, including ICMPv6 type 2.
  • Bake dhcpv6-client into the firewalld config of custom images, and don't disable IPv6 in hardening scripts unless you mean it.
  • Add an IPv6 synthetic check (curl -6 from an external probe) for every public endpoint that publishes an AAAA record.