Home / OCI

OCITroubleshootingAdvanced

Traffic through an OCI firewall or NVA pair black-holes after failover: floating private IPs, route targets and source/destination check

Your self-managed firewall or router pair failed over and traffic stopped. Check the floating IP's VNIC, the route target OCID, source/destination check and the guest OS, in that order.

Deepak Bhardwaj8 min read

Applies toOCI VCN networking, Compute (Linux NVAs with keepalived or Pacemaker, third-party firewall VMs), OCI CLI 3.x

You run a pair of self-managed network virtual appliances (NVAs) in a VCN: third-party firewalls, Linux routers, HAProxy pairs. Route tables send traffic to a floating private IP. The cluster says the failover worked and the standby now owns the VIP. But traffic through it is dropped, goes one way only, or only new sessions work.

On OCI the VCN does not learn which VNIC owns an address from gratuitous ARP. Only an API call changes that mapping. Most failures come from the cluster and the VCN disagreeing about who owns the IP.

How the moving parts fit together

Layer What must be true after failover Who changes it
VCN private IP object The secondary private IP is assigned to the new active node's VNIC oci network vnic assign-private-ip --unassign-if-already-assigned from the failover hook
Route rules Target the floating secondary IP's OCID, not a node's primary IP You, once at build time
VNIC "Skip source/destination check" is enabled on both nodes' VNICs You, once at build time
Guest OS Address configured, forwarding enabled, rp_filter compatible Cluster software (keepalived, Pacemaker IPaddr2)
Firewall state Sessions synced, or clients accept a reset Appliance feature (conntrackd, vendor HA sync)

A VNIC's primary private IP can't be moved. The floating address must be a secondary private IP, and both nodes' VNICs must be in the same subnet.

Symptom to cause

Symptom after failover Likely cause Fix
All traffic through the VIP dropped, cluster shows the standby active The IP moved in the OS but not in OCI (the API call failed or never ran) Fix the hook's auth or policy, then move the IP with the CLI
Ping to the VIP works, forwarded traffic dropped Source/destination check still enabled on the standby VNIC oci network vnic update --skip-source-dest-check true
Nothing changes on failover, traffic still goes to the dead node Route rule targets node A's primary private IP Repoint the rule to the floating secondary IP's OCID
Route rule shows a target nobody recognises, traffic black-holed Original node was terminated and the IP recreated with a new OCID Update the route rule to the new private IP OCID
Return traffic dropped, one-way flows Asymmetric path: the inside VIP moved but the outside VIP or the DRG route didn't, or the kernel's rp_filter drops it Move every VIP in the same hook, set rp_filter to loose
New sessions fine, existing sessions reset Connection state not synced between nodes Enable state sync, or accept and document the reset
Works for a minute, then flaps back Split brain: both nodes keep calling the API to claim the IP Fix the heartbeat path and fencing

Checks

1. Which VNIC does OCI think owns the VIP?

SUBNET=ocid1.subnet.oc1..aaaa...
VIP=10.0.10.50

oci network private-ip list --subnet-id "$SUBNET" --ip-address "$VIP" \
  --query 'data[0].{id:id, vnic:"vnic-id", primary:"is-primary"}' --output table

Compare vnic with the active node's VNIC. On the node itself, read it from instance metadata (IMDSv2):

curl -s -H "Authorization: Bearer Oracle" http://169.254.169.254/opc/v2/vnics/ \
  | python3 -c 'import json,sys; [print(v["vnicId"], v["privateIp"]) for v in json.load(sys.stdin)]'

If OCI still maps the VIP to the old node, the OS-level move did nothing useful. Move it now:

oci network vnic assign-private-ip \
  --vnic-id ocid1.vnic.oc1..standby... \
  --ip-address "$VIP" \
  --unassign-if-already-assigned

If the secondary private IP has a public IP assigned, the public IP moves with it.

2. Does the route rule point at the floating IP object?

Route rules that use a private IP as the target hold the private IP's OCID, not the address.

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

The target must equal the id from check 1. Two patterns break here:

  • The rule targets node A's primary private IP. The rule then never follows a failover. Repoint it to the secondary IP.
  • The OCID no longer exists. If a node is terminated before its secondary IP is moved, the IP is deleted with it. Creating the address again on the standby gives it a new OCID, so you have to update the route rule.
oci network route-table update --rt-id ocid1.routetable.oc1..aaaa... --force \
  --route-rules '[{"destination":"0.0.0.0/0","destinationType":"CIDR_BLOCK","networkEntityId":"ocid1.privateip.oc1..new..."}]'

Caution

route-table update --route-rules replaces the whole rule list. Export the current rules first, change only the one entry and send the full list back. If you send just one rule, every other route in that table is gone.

The same applies to DRG route tables and the VCN ingress route table that point at the NVA. Check every table that sends traffic to the pair, not just the subnet tables.

3. Is source/destination check skipped on both VNICs?

for V in ocid1.vnic.oc1..nodeA... ocid1.vnic.oc1..nodeB...; do
  oci network vnic get --vnic-id "$V" \
    --query 'data.{name:"display-name", skip:"skip-source-dest-check"}' --output table
done

Teams often set it on the node that was active at build time and forget the standby. Fix it:

oci network vnic update --vnic-id ocid1.vnic.oc1..nodeB... --skip-source-dest-check true

Check the VNIC's NSGs while you are there. If node B is in different NSGs from node A, it will drop traffic that node A allowed.

4. Can the failover hook actually call the API?

Most hooks run the CLI with instance principals. Test from the standby as the user the cluster runs as:

oci network vnic get --vnic-id ocid1.vnic.oc1..nodeB... --auth instance_principal >/dev/null && echo OK

The dynamic group for both nodes needs permission to manage VNICs and private IPs in the compartments that hold the VNICs and the subnet. Typically:

Allow dynamic-group nva-nodes to use vnics in compartment network
Allow dynamic-group nva-nodes to use private-ips in compartment network

Check the exact verbs your move needs against the IAM policy reference for AssignPrivateIp/UpdatePrivateIp. A NotAuthorizedOrNotFound in the cluster log is the giveaway. Also log the hook's stderr. Many keepalived notify scripts throw it away, so the move fails silently.

5. Is the guest OS ready to forward?

OCI moves the mapping. It doesn't configure the address inside the instance.

ip -4 addr show | grep 10.0.10.50          # VIP present on the active node only
sysctl net.ipv4.ip_forward                 # must be 1 on routers/firewalls
sysctl net.ipv4.conf.all.rp_filter net.ipv4.conf.ens3.rp_filter   # 0 or 2 on multi-NIC NVAs

With strict reverse-path filtering (rp_filter=1), a multi-VNIC appliance drops packets that come in on one interface when the route back uses another. Set loose mode (2) on the forwarding interfaces and persist it in /etc/sysctl.d/.

Design trade-offs worth revisiting

  • Failover time depends on the API call. Detection (heartbeat timeout) plus the assign-private-ip call usually takes seconds, not sub-second. Measure it in a drill and write the number into the runbook instead of quoting a vendor figure.
  • Several VIPs move one at a time. If the appliance has inside and outside floating IPs, move them in the same hook. The CLI also has oci network private-ip bulk-update for moving several in one request; check --generate-full-command-json-input for the input format of your CLI version.
  • Session state. Without state sync, every established TCP session through the firewall is reset on failover. That may be fine for web traffic, but not for long-running database or replication streams.
  • Consider an NLB in front. A Network Load Balancer with backends that skip source/destination check removes the IP move from the data path. The trade-off is health-check-driven failover and a different symmetric-return design. If you don't need appliance-specific features, the managed OCI Network Firewall avoids the problem entirely.

Warning

Never let both nodes run the move hook in a loop. In a split-brain the private IP bounces between VNICs on every heartbeat, and traffic flaps with it. Use fencing, or a quorum or tie-breaker, before you allow the hook to claim the IP.

Prevent it next time

  • Build both nodes from the same Terraform module so source/destination check, NSGs and subnet are the same on both.
  • Point every route rule (subnet, DRG, VCN ingress) at the floating secondary IP OCID, and add a check in CI that fails if any rule targets a primary private IP.
  • Set an alarm or scheduled script that compares the VIP's owning VNIC (check 1) with the cluster's active node, and alert when they differ.
  • Drill failover every quarter in both directions. Record detection time, API move time and which sessions survived.
  • Never terminate an NVA node before its secondary IPs have moved. If you do, update the route rules straight away.