Symptoms
- Every public endpoint in a VCN times out from the internet at the same moment: public load balancers, instances with public IPs, Bastion-less SSH.
- The load balancer shows healthy backends, but clients cannot connect to its public IP.
- Traffic inside the VCN, over the DRG and through the service gateway still works.
- Instances in the public subnet cannot reach the internet either (
curl https://example.comtimes out).
If only one listener or one backend is affected, this is not the gateway. Look at the load balancer, NSGs or security lists instead.
1. Confirm it is the gateway path (3 minutes)
export COMP=ocid1.compartment.oc1..xxxx
export VCN=ocid1.vcn.oc1..xxxx
export SUBNET=ocid1.subnet.oc1..xxxx # the public subnet
# Is there an internet gateway, and is it enabled?
oci network internet-gateway list --compartment-id $COMP --vcn-id $VCN \
--query 'data[].{name:"display-name", id:id, enabled:"is-enabled", state:"lifecycle-state"}' --output table
# Which route table does the public subnet use, and what is in it?
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.{name:"display-name", rules:"route-rules"}'
A healthy public subnet has a rule with destination 0.0.0.0/0, destinationType CIDR_BLOCK, and a networkEntityId that is the internet gateway's OCID.
Network Path Analyzer gives you a second opinion in a minute. Run it from the internet to the load balancer's public IP and port. It names the hop that drops the traffic.
2. What broke
| What you find | Cause | Fix |
|---|---|---|
is-enabled: false | Gateway disabled (often by a "block internet" change or script) | Re-enable the gateway |
| No internet gateway in the list | Gateway deleted, often by a Terraform destroy or refactor | Create a new one and repoint the route rule |
0.0.0.0/0 rule missing | Route table rules replaced without it | Add the rule back |
0.0.0.0/0 points to a NAT gateway or DRG | Someone "fixed" egress on the wrong table | Point it back at the internet gateway |
| Subnet uses a different route table | UpdateSubnet swapped the table | Point the subnet back at the right table |
| Rule points to a private IP (firewall) | New inspection design, firewall not passing traffic | Fix the firewall path or roll back the route |
Find the change in the audit log. Event names can vary; search widely and read what comes back:
oci logging-search search-logs \
--search-query 'search "'"$COMP"'/_Audit" | where data.eventName = '"'UpdateInternetGateway'"' or data.eventName = '"'DeleteInternetGateway'"' or data.eventName = '"'UpdateRouteTable'"' or data.eventName = '"'UpdateSubnet'"' | sort by datetime desc' \
--time-start $(date -u -d '-24 hours' +%Y-%m-%dT%H:%M:%SZ) \
--time-end $(date -u +%Y-%m-%dT%H:%M:%SZ) \
--query 'data.results[].data.{time:datetime, event:data.eventName, who:data.identity.principalName, resource:data.resourceName}'
If the principal is a pipeline or Resource Manager stack, pause that pipeline before you fix anything. Otherwise the next run undoes your fix.
3. The fix
Gateway disabled: re-enable it
IGW=ocid1.internetgateway.oc1..xxxx
oci network internet-gateway update --ig-id $IGW --is-enabled true --force
Gateway deleted: create a new one
IGW=$(oci network internet-gateway create --compartment-id $COMP --vcn-id $VCN \
--is-enabled true --display-name igw-prod \
--wait-for-state AVAILABLE --query 'data.id' --raw-output)
echo $IGW
The new gateway has a new OCID, so every route rule that pointed at the old one must be updated.
Route rule missing or wrong: restore it
Warning
oci network route-table update --route-rulesreplaces the whole list of rules. Rules you leave out are deleted, which can cut DRG, service gateway or peering routes and widen the outage. Save the current rules, edit the JSON, and send the complete list back.
oci network route-table get --rt-id $RT --query 'data."route-rules"' > /tmp/rt-before.json
cp /tmp/rt-before.json /tmp/rt-new.json
# edit /tmp/rt-new.json: add or correct the default route, keep everything else
The default route entry should look like this:
{
"destination": "0.0.0.0/0",
"destinationType": "CIDR_BLOCK",
"networkEntityId": "ocid1.internetgateway.oc1..xxxx",
"description": "default route to internet"
}
oci network route-table update --rt-id $RT --route-rules file:///tmp/rt-new.json --force
Subnet on the wrong route table
oci network subnet update --subnet-id $SUBNET --route-table-id ocid1.routetable.oc1..correct --force
Check every public subnet in the VCN, not just the first one you found:
oci network subnet list --compartment-id $COMP --vcn-id $VCN --all \
--query 'data[?"prohibit-public-ip-on-vnic"==`false`].{name:"display-name", rt:"route-table-id"}' --output table
Tip
A route table can also be attached to the internet gateway itself for ingress routing (for example, sending inbound traffic through a firewall). If one is attached, check
route-table-idon the gateway and that its rules still point at a working next hop.
4. Things that look like the gateway but are not
- Reserved public IP unassigned. If one instance lost its IP, check
oci network public-ip get --public-ip-address <ip>and reassign it to the private IP. - Security list or NSG change. Gateway and routes look right, but Path Analyzer shows a drop at the subnet or VNIC.
- Load balancer in a private subnet. A recreated LB placed in the wrong subnet gets no public IP.
Verify
curl -sS -o /dev/null -w '%{http_code} %{time_total}\n' https://<public-hostname>/health
# from an instance in the public subnet
curl -sS -o /dev/null -w '%{http_code}\n' https://www.oracle.com
- External synthetic checks pass from more than one location.
- Load balancer metrics show new connections arriving (
ActiveConnectionsandHttpRequestsinoci_lbaas; names vary for the network load balancer). - Run Network Path Analyzer again and confirm the path is reachable.
Communicate
"From
Prevent it next time
- Manage gateways and route tables in Terraform, and add
lifecycle { prevent_destroy = true }to the production internet gateway. - Create an Events rule for internet gateway and route table changes in production compartments, and send it to the network on-call.
- Restrict
manage internet-gatewaysandmanage route-tablesin production to the network group and pipeline. - Keep a saved copy of each production route table's JSON in version control so a restore is a single command.
- Run synthetic checks against every public endpoint so a gateway outage pages within minutes, not when customers call.
Get the weekly HubDatAI email
One email a week with everything new: posts, learning sessions and videos. Free, no spam, unsubscribe in one click. What you get