Skip to content
Fixedmark

Networking · 11 min read

Updated

IPv6 Egress and IPv4-Only Allowlists

When the partner's hostname has both A and AAAA records and your host has a global IPv6 address, most clients connect over IPv6, so the partner sees an IPv6 source that is not on its IPv4-only allowlist. Fix it by forcing IPv4 in the client that makes the allowlisted call, or by sending that call through an egress path that only speaks IPv4.

On this page

Why the partner sees an address you never registered

A TCP connection uses one address family end to end. If your client connects to the partner's IPv6 address, the source is your IPv6 address. Your static IPv4, your Elastic IP, and your NAT gateway play no part in that connection. The partner's firewall compares an IPv6 source against a list of IPv4 entries, finds no match, and rejects the call.

Three things must be true for this to happen. The destination hostname publishes an AAAA record. Your host has a global IPv6 address and a route to the internet over it. Your client chooses the IPv6 address. Take away any one of them and the call goes out over IPv4.

That is why the failure often arrives without a code change on your side. Common triggers are:

  • The partner moves its API behind a dual-stack load balancer or CDN, and its hostname gains AAAA records. The allowlist check behind it still holds IPv4 entries only.
  • Someone enables IPv6 on your VPC or subnet, or on the platform your code runs on.
  • You upgrade a runtime whose address selection changed. Node.js, for example, stopped reordering DNS results to put IPv4 first in v17, and turned on family autoselection by default in v20.
  • You move the code from a laptop to a server, or from a server to a home line with native IPv6.

Many partners still accept IPv4 only. Kotak Neo's broker API is one example covered in the Kotak Neo guide. If you are chasing a rejected broker order, the broker IP error guide covers the other causes too.

How clients choose between IPv6 and IPv4

Two standards decide the order. RFC 6724 defines default address selection. Its policy table gives the IPv6 default prefix ::/0 precedence 40 and the IPv4-mapped prefix ::ffff:0:0/96 precedence 35, so a host prefers IPv6 when it has a usable IPv6 source address. A host with no global IPv6 address sorts IPv4 first, which is why the same code behaves differently on two machines.

RFC 8305, Happy Eyeballs version 2, then races the families. The client sends the AAAA query first and the A query right after it. If the A answer comes first, it waits a short Resolution Delay, 50 ms recommended, for the AAAA answer. It sorts the addresses with RFC 6724, interleaves the families, and starts the first connection attempt. If that attempt has not finished after the Connection Attempt Delay, 250 ms recommended with a 100 ms minimum and a 2 second maximum, it starts the next one in parallel. The first connection to complete wins.

Racing is good for users and bad for allowlists. On a healthy dual-stack network IPv6 usually wins. When the IPv6 path is slow for a moment, IPv4 wins instead. So one request passes and the next is blocked, with no change anywhere. An intermittent 403 from an allowlisted partner on a dual-stack host is a strong hint that the family is flipping.

A successor, Happy Eyeballs version 3, is still an Internet-Draft as of November 2026. It adds SVCB and HTTPS DNS records to the race. It does not change the core problem for allowlists.

Default family behaviour in common clients, November 2026
ClientDefault behaviourForce IPv4
curlHappy Eyeballs, 200 ms default timeout per the curl man page-4 or --ipv4
Node.js 20 and laterautoSelectFamily on by default, alternates families starting with the first address DNS returns, DNS order verbatim since v17family: 4 on the connection, or ipv4first with autoselection off
Go net/httpFast Fallback (RFC 6555), the first resolved family is primary, 300 ms default FallbackDelayDial tcp4 instead of tcp
Python requests (urllib3)Tries getaddrinfo results in order, no racingRestrict urllib3's address family to AF_INET
Python httpxAllows both families by defaultlocal_address="0.0.0.0" on the transport
Javajava.net.preferIPv6Addresses is false, so IPv4 addresses come first-Djava.net.preferIPv4Stack=true

Java is the outlier. Its networking properties prefer IPv4 addresses by default for backward compatibility, unless someone set preferIPv6Addresses to true or system. Node's per-attempt timeout for autoselection is set by net.setDefaultAutoSelectFamilyAttemptTimeout(). Node 26 reports 500 ms from net.getDefaultAutoSelectFamilyAttemptTimeout(), so check the value on the version you run.

Find out which family your calls use

Check the destination first. If the partner's hostname has no AAAA record, IPv6 is not your problem and you can stop here.

Terminal
# Does the partner publish IPv6?
dig +short A api.partner.example
dig +short AAAA api.partner.example

# Which address did curl actually connect to?
curl -s -o /dev/null -w '%{remote_ip}\n' https://api.partner.example/

# What source address does an echo service see, per family?
curl -4 -s -H 'Accept: application/json' https://fixedmark.com/api/ip
curl -6 -s -H 'Accept: application/json' https://fixedmark.com/api/ip

The echo endpoint returns your address and its version, 4 or 6. If the -6 call succeeds, your host can reach the internet over IPv6, and any client that prefers IPv6 will use it against a dual-stack partner. The What's my IP tool shows the same in a browser.

Then run the check from the code path that calls the partner, not only from a shell. A shell on the same host can use a different client with different defaults. Call the echo endpoint with the same agent, transport, or dialer your partner client uses, and log the version it returns. In Go, you can also log conn.RemoteAddr() from a custom dialer. Compare what you see with the address the partner reports in its rejection, if it reports one.

Force IPv4 in the client that makes the call

The narrowest fix is to pin the family on the one client that talks to the allowlisted partner. Everything else in the process keeps normal dual-stack behaviour. Each snippet below pins IPv4 for that client only.

import { Agent, fetch } from "undici";

// Every connection this agent opens uses IPv4. Node ignores
// autoSelectFamily when family is not 0.
const ipv4Only = new Agent({ connect: { family: 4 } });

const res = await fetch("https://api.partner.example/v1/payouts", {
	method: "POST",
	dispatcher: ipv4Only,
	headers: { "content-type": "application/json" },
	body: JSON.stringify({ amount: 100 }),
});
console.log(res.status);

Node's built-in fetch also accepts a dispatcher option, but the undici package you import and the copy bundled in Node can differ in version. Importing fetch from the same undici package as the Agent avoids that mismatch. The requests patch is global, because urllib3 reads allowed_gai_family from its module for every connection. Use httpx or a separate process if only one partner needs IPv4.

Process-wide and host-wide switches

Sometimes you cannot reach the client, such as an SDK that builds its own agent. Then set the default for the whole process.

Terminal
# Node: IPv4 results first, and connect to the first result only
node --dns-result-order=ipv4first --no-network-family-autoselection server.js

# Java: IPv4-only sockets for the whole JVM
java -Djava.net.preferIPv4Stack=true -jar app.jar

# curl: one call over IPv4
curl -4 https://api.partner.example/v1/status

The two Node flags work together. ipv4first puts A records ahead of AAAA records, per the dns module docs. Turning autoselection off means Node connects to that first address and does not race the other family. With ipv4first alone, Node still starts an IPv6 attempt if IPv4 has not connected within the attempt timeout. dns.setDefaultResultOrder() and net.setDefaultAutoSelectFamily() do the same from code.

On glibc systems, /etc/gai.conf changes how getaddrinfo sorts results for every program on the host. RFC 6724 section 10.3 shows the idea, raising the precedence of ::ffff:0:0/96 to 100 so IPv4 sorts first. This only reorders. A Happy Eyeballs client can still finish on IPv6 if IPv4 is slow. Disabling IPv6 on the host works too, but it also breaks IPv6-only destinations and is easy to undo by accident in the next image build. Pinning the client is safer.

AWS dual-stack and IPv6-only subnets

On AWS the key fact is that a NAT gateway handles IPv4. IPv6 traffic takes a different route. The egress-only internet gateway docs say it is for IPv6 traffic only and point to a NAT gateway for outbound IPv4. IPv6 addresses in a VPC are globally unique, so there is nothing to translate. Your instance's own IPv6 address is the source the partner sees.

That leads to a common surprise. You attach an Elastic IP to a NAT gateway, give the partner that address, and everything works. Later someone adds an IPv6 CIDR to the subnet and a ::/0 route to an egress-only gateway. Calls to dual-stack partners now leave over IPv6 from the instance, past the NAT gateway, and the allowlist rejects them.

What a destination sees from AWS compute
SetupPartner has only APartner has A and AAAA
IPv4-only subnet behind a NAT gatewayNAT gateway's Elastic IPNAT gateway's Elastic IP
Dual-stack private subnet, 0.0.0.0/0 to a NAT gateway and ::/0 to an egress-only gatewayNAT gateway's Elastic IPUsually the instance's IPv6 address
IPv6-only subnet with DNS64 and NAT64NAT gateway's Elastic IP, through NAT64The instance's IPv6 address
Lambda in a VPC, IPv6 not allowed (default)NAT gateway's Elastic IPNAT gateway's Elastic IP
Lambda in a VPC, Ipv6AllowedForDualStack=trueNAT gateway's Elastic IPCan be an IPv6 address from the subnet

Lambda

Per the Lambda VPC docs, outbound IPv6 is off by default. You turn it on with --vpc-config Ipv6AllowedForDualStack=true, and every subnet attached to the function must be dual-stack. Lambda does not support outbound IPv6 for functions outside a VPC or in IPv6-only subnets. So a Lambda function only meets this problem after someone flips that flag. If a partner check started failing right after a VPC change, look at it first.

IPv6-only subnets with NAT64

The DNS64 and NAT64 docs explain the split. When a destination has only an A record, Route 53 Resolver synthesizes an address in 64:ff9b::/96. The NAT gateway translates the packet to IPv4 and it leaves from the gateway's Elastic IP. So an IPv4-only allowlist keeps working. When the destination has a real AAAA record, the resolver returns it unchanged and the connection goes out over IPv6 with no translation. NAT64 does not save you from a dual-stack partner with an IPv4-only allowlist.

For the cost side of these choices, see the NAT gateway alternatives post and the AWS public IPv4 charge.

Google Cloud dual-stack behaviour

Google Cloud works the same way in principle. A dual-stack or IPv6-only VM interface gets a /96 range from its subnet, per the subnets docs. If the subnet's IPv6 access type is external, those addresses are global unicast and routable on the internet. If it is internal, they come from a ULA range and cannot reach the internet at all.

Cloud NAT does not cover IPv6 traffic to IPv6 destinations. The Cloud NAT overview lists two translations, IPv4 to IPv4 and IPv6 to IPv4. NAT64 is for IPv6-only instances reaching IPv4 destinations, and needs DNS64 as well. A VM with an external IPv6 range that calls a dual-stack partner can leave from its own IPv6 address, not from the reserved IPv4 address on your Cloud NAT gateway.

Cloud Run joins this with Direct VPC egress. The dual-stack subnet docs let a service send IPv4 and IPv6 traffic into a dual-stack subnet with an internal or external IPv6 access type, and state that NAT64 is not supported there. If your Cloud Run service reaches a partner through Cloud NAT for a fixed IPv4 address, keep it on an IPv4-only subnet, or pin IPv4 in the client. Then confirm with the echo check above from inside the service. The Cloud Run integration covers the IPv4 path.

IPv6 allowlist entries and dual-stack listeners

Sometimes the partner does accept IPv6 and you register one. That brings its own failure modes.

  • Hosts on SLAAC networks often use temporary addresses for outgoing connections. RFC 8981 sets a default preferred lifetime of one day, so the address you registered stops being used within a day. Register a stable address or the prefix, and accept that a prefix admits every host on it.
  • Home and mobile lines can change their delegated IPv6 prefix, just as they change IPv4 addresses. The home vs VPS vs proxy post covers this for Indian ISPs.
  • Serverless addresses are not yours. Lambda's docs say it may delete and recreate its network interfaces, so an IPv6 address seen from a function today is not a stable identity. Allowlisting the whole subnet range admits everything in that subnet, the same trap described in cloud IP ranges are not an allowlist.
  • You registered an IPv6 address, but your calls leave over IPv4 because the partner has no AAAA record, or your platform has no IPv6 route. Check the destination with dig AAAA before you register anything.

Your own allowlist on a dual-stack socket

If you run the allowlist, watch for IPv4-mapped addresses. A server that listens on :: accepts IPv4 clients too, and reports their address in the ::ffff:0:0/96 form that RFC 4291 defines. A Node server started with server.listen(port) on a host with IPv6 reports an IPv4 caller at 203.0.113.7 as ::ffff:203.0.113.7. A string comparison against 203.0.113.7 fails. Normalise before you compare.

allowlist.ts
import { isIPv4 } from "node:net";

const ALLOWED = new Set(["203.0.113.7", "203.0.113.8"]);

/** Turns "::ffff:203.0.113.7" into "203.0.113.7"; leaves other addresses alone. */
export function normaliseIp(raw: string): string {
	const lower = raw.toLowerCase();
	if (lower.startsWith("::ffff:")) {
		const v4 = lower.slice("::ffff:".length);
		if (isIPv4(v4)) return v4;
	}
	return lower;
}

export function isAllowed(remoteAddress: string | undefined): boolean {
	return remoteAddress !== undefined && ALLOWED.has(normaliseIp(remoteAddress));
}

Doing this with Fixedmark

A proxy moves the family decision off your host. Your client connects to the proxy, and the proxy opens the connection to the partner. The partner sees the proxy's address, whatever family your own network prefers. It does not matter whether the hop from your code to the proxy runs over IPv4 or IPv6.

Fixedmark's proxy connects to destinations over IPv4 only, as the allowlists docs state. Every allowlisted call leaves from your static IPv4 pair, even when the partner is dual-stack and your platform has IPv6. You give the partner two IPv4 addresses and nothing else.

  • Send the hostname to the proxy. With HTTP CONNECT through FIXEDMARK_PROXY_URL, the proxy resolves the name. With SOCKS5, use socks5h:// so the proxy resolves it. A client using plain socks5:// may resolve locally and pick an IPv6 address, which an IPv4-only proxy cannot reach. The socks5h post explains the difference.
  • A destination with no IPv4 address cannot be reached through the proxy. The call fails instead of leaving from an address nobody allowlisted, and the failure shows in your connection logs.
  • CIDR rules in a credential's destination allowlist take IPv4 ranges only.
  • IPv6 egress is on the roadmap, not built.

Fixedmark is in early access. To route only the partner calls through it and leave everything else alone, see per-client proxy setup and verify your egress IP before you hand the addresses to the partner.

Sources

Checked November 2026. Confirm current details on the vendor's site before you decide. Prices and limits change.

Blog

Frequently asked questions

Why does the allowlisted call work sometimes and fail other times?

Happy Eyeballs races IPv6 and IPv4 and keeps the first connection that completes. On a dual-stack host IPv6 usually wins, but a slow IPv6 path lets IPv4 win. The partner sees a different source family from one request to the next. Pin the family in the client to make it deterministic.

Should I disable IPv6 on the server to fix this?

It works, but it is a blunt fix. It breaks IPv6-only destinations, and a later image or kernel change can turn IPv6 back on. Forcing IPv4 in the one client that calls the allowlisted partner is narrower and survives rebuilds.

Does NAT64 keep an IPv4-only allowlist working on AWS?

Only for destinations with no AAAA record. DNS64 synthesizes an address only when the name has no IPv6 address, and then the NAT gateway translates the traffic to its Elastic IP. If the partner publishes an AAAA record, your IPv6-only workload connects over IPv6 directly.

Can I ask the partner to allowlist my IPv6 address as well?

If they accept IPv6, register an address you control for the long term, such as a static address on a VM. Temporary SLAAC addresses rotate daily by default, and serverless network interfaces can be recreated. Registering a whole subnet prefix admits every host in it.

Does Fixedmark support IPv6 egress?

Not yet. The proxy connects to destinations over IPv4 only, and IPv6 egress is on the roadmap. Your partners allowlist your IPv4 pair.

Make it fixed.

Fixedmark is in early access. Join the list to get dedicated static IPs when your region opens.