---
title: "AWS NAT Gateway Alternatives for a Fixed Egress IP"
description: "NAT instances and fck-nat, egress-only gateways for IPv6, VPC endpoints, and static IP proxies compared as AWS NAT gateway alternatives: cost, HA, and upkeep."
canonical: https://fixedmark.com/blog/aws-nat-gateway-alternatives
updated: 2026-11-10
source: Fixedmark (https://fixedmark.com), BitMask LLP
---

Cost · 11 min read

# AWS NAT Gateway Alternatives for a Fixed Egress IP

The main alternatives to an AWS NAT gateway are a NAT instance (built by hand or from fck-nat), an egress-only internet gateway for IPv6, VPC endpoints for traffic to AWS services, and a static IP proxy. Only a NAT instance and a proxy give a partner a fixed IPv4 address to allowlist. The other two shrink or remove NAT traffic but give you no IPv4 address to hand over.

## Two jobs a NAT gateway does

A NAT gateway in a public subnet does two separate things for the private subnets that route to it. It gives them outbound internet access over IPv4. It also makes every connection leave from the gateway's Elastic IP, which is the address you give a bank, a broker, or a partner API to allowlist.

Each alternative below replaces one job, both, or part of one. Decide which job you need first. If a payout API wants one fixed IPv4 address, you need the second job. If your containers only pull images from ECR and write to S3, you may not need a NAT path at all.

For the gateway's cost math, read [the hidden costs of a NAT gateway](https://fixedmark.com/blog/nat-gateway-hidden-costs) and [the AWS public IPv4 charge](https://fixedmark.com/blog/aws-public-ipv4-charge-explained), or run your traffic through the [NAT gateway cost calculator](https://fixedmark.com/tools/nat-gateway-cost-calculator). In short, a gateway bills per hour in each AZ and per GB processed.

Every option here still pays standard AWS data transfer out to the internet. The savings come from the NAT gateway's hourly and processing charges, not from egress itself.

## NAT instances: run the translation yourself

A [NAT instance](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_NAT_Instance.html) is an EC2 instance in a public subnet that forwards traffic for private subnets and masquerades it behind its own public address. Give it an Elastic IP and the partner sees that address. You pay for the instance and the address. There is no per-GB processing charge, because there is no managed service in the path.

AWS still documents this, with a warning. Its old NAT AMI is built on Amazon Linux AMI 2018.03, which reached end of maintenance support on December 31, 2023. AWS recommends a NAT gateway instead, and tells you to build your own NAT AMI from a current Amazon Linux if an instance fits better.

### Build one by hand

The [AWS setup guide](https://docs.aws.amazon.com/vpc/latest/userguide/work-with-nat-instances.html) uses AL2023 or Amazon Linux 2 with iptables. Run this on the instance, then save it as an AMI. Replace `ens5` with the primary interface name that `ip link` shows.

**On the NAT instance**

```bash
sudo yum install iptables-services -y
sudo systemctl enable --now iptables

echo 'net.ipv4.ip_forward=1' | sudo tee /etc/sysctl.d/custom-ip-forwarding.conf
sudo sysctl -p /etc/sysctl.d/custom-ip-forwarding.conf

sudo /sbin/iptables -t nat -A POSTROUTING -o ens5 -j MASQUERADE
sudo /sbin/iptables -F FORWARD
sudo service iptables save
```

Then wire it into the VPC from your own machine. The instance must stop checking that it is the source or destination of every packet, or it drops forwarded traffic. The private route table then sends `0.0.0.0/0` to the instance.

**Terminal**

```bash
# Let the instance forward traffic that is not addressed to it
aws ec2 modify-instance-attribute \
  --instance-id i-0123456789abcdef0 --no-source-dest-check

# Pin the egress address partners will allowlist
aws ec2 associate-address \
  --instance-id i-0123456789abcdef0 --allocation-id eipalloc-0123456789abcdef0

# Send the private subnet's internet traffic to the instance
aws ec2 replace-route --route-table-id rtb-0private0a \
  --destination-cidr-block 0.0.0.0/0 --instance-id i-0123456789abcdef0
```

Use `create-route` if the table has no default route yet. The instance's security group must allow inbound traffic from the private subnets.

### What you take on

AWS's [comparison of NAT gateways and NAT instances](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-comparison.html) is blunt about the trade.

_NAT gateway and NAT instance, per the AWS comparison page_

|                    | NAT gateway                                                | NAT instance                           |
| ------------------ | ---------------------------------------------------------- | -------------------------------------- |
| Availability       | Redundant within its AZ. One per AZ for zone independence. | You script failover between instances. |
| Bandwidth          | Scales up to 100 Gbps                                      | Whatever the instance type gives       |
| Maintenance        | Managed by AWS                                             | You patch the OS and the NAT software  |
| Connection timeout | Sends RST to the client                                    | Sends FIN to the client                |

Availability is the row that bites. One instance serving two AZs is a single point of failure for both, and traffic from the other AZ pays cross-AZ transfer to reach it. Mirror the gateway layout instead, with one instance and one Elastic IP per AZ. The partner allowlists two addresses, which is normal. See [why one static IP is a single point of failure](https://fixedmark.com/blog/static-ip-pairs-and-failover).

## fck-nat and alterNAT

You do not have to build the AMI yourself. [fck-nat](https://fck-nat.dev/stable/) is an MIT-licensed project that publishes ready NAT AMIs for arm64 and x86_64, built on Amazon Linux 2023. The AMIs are owned by account `568608671756` and named `fck-nat-al2023-*`. Its docs put a `t4g.nano` at $0.0042 an hour in US East, about $3 a month, with $0 per GB of NAT processing. Add the Elastic IP on top.

**Find the latest fck-nat AMI in a Region**

```bash
aws ec2 describe-images --region ap-south-1 \
  --owners 568608671756 \
  --filters 'Name=name,Values=fck-nat-al2023-*-arm64-ebs' \
  --query 'sort_by(Images, &CreationDate)[-1].[ImageId,Name]' \
  --output text
```

### Size it for sustained traffic, not burst

The cheap price hides a bandwidth limit. fck-nat's [instance sizing guide](https://fck-nat.dev/stable/choosing_an_instance_size/) notes that burstable instances advertise "up to" figures. A `t4g.nano` bursts to 5 Gbps but sustains about 32 Mbps. A `c6gn.medium` sustains 1.6 Gbps, and a `c7gn.medium` sustains 3.125 Gbps. EC2 caps internet egress at 5 Gbps for instances under 32 vCPUs. If your workload moves steady bulk traffic, price the instance that sustains it, not the nano.

Busy NAT instances can also run out of connection tracking. fck-nat's [configuration file](https://fck-nat.dev/stable/configuration/), `/etc/fck-nat.conf`, has `nf_conntrack_max` and `ip_local_port_range` for that, alongside `eip_id` (the Elastic IP to attach at boot) and `eni_id` (the network interface for high availability mode).

### High availability mode

In high availability mode, fck-nat runs one instance in an Auto Scaling group. A floating network interface stays in the route table, and each new instance attaches it at boot. If the instance dies, the group launches a replacement that picks up the same interface and, if you set one, the same Elastic IP. Without an Elastic IP, the replacement gets a new public address and your partner's allowlist breaks.

This is replacement, not hot standby. Egress from that AZ is down while a new instance boots, and open connections drop. fck-nat's docs point workloads that need very high uptime to the managed gateway.

The [community Terraform module](https://registry.terraform.io/modules/RaJiska/fck-nat/aws) wires all of this up. It requires the AWS provider 6.0 or later. Use one module per AZ.

**main.tf**

```
resource "aws_eip" "egress_a" {
  domain = "vpc"
}

module "fck_nat_a" {
  source  = "RaJiska/fck-nat/aws"
  version = "1.6.1"

  name          = "egress-a"
  vpc_id        = aws_vpc.main.id
  subnet_id     = aws_subnet.public_a.id
  instance_type = "t4g.nano"

  ha_mode            = true
  eip_allocation_ids = [aws_eip.egress_a.id]

  update_route_tables = true
  route_tables_ids = {
    private-a = aws_route_table.private_a.id
  }
}
```

The module accepts at most one Elastic IP per instance, and it defaults to `t4g.micro` if you leave out `instance_type`. Repeat the block for `public_b` and `private_b` with a second Elastic IP.

### alterNAT

[alterNAT](https://github.com/chime/terraform-aws-alternat), from Chime, pairs each AZ's NAT instance with a standby NAT gateway. A Lambda function checks connectivity every minute and, on failure or replacement, points the route table at the standby. Its README pitches it at high volumes, around 10 TB a month. Two things matter for an allowlist. The standby gateways bill by the hour even when idle, and they have their own Elastic IPs, so the partner must allowlist the instance addresses and the gateway addresses.

## IPv6 and the egress-only internet gateway

An [egress-only internet gateway](https://docs.aws.amazon.com/vpc/latest/userguide/egress-only-internet-gateway.html) is the IPv6 counterpart of a NAT gateway's outbound-only behaviour. It lets resources start connections to the internet over IPv6 and blocks connections started from outside. AWS charges nothing for the gateway itself, only normal data transfer. It is stateful, scales on its own, and needs no instance.

**Terminal**

```bash
aws ec2 create-egress-only-internet-gateway --vpc-id vpc-0123456789abcdef0

aws ec2 create-route --route-table-id rtb-0private0a \
  --destination-ipv6-cidr-block ::/0 \
  --egress-only-internet-gateway-id eigw-0123456789abcdef0
```

Lambda can use it. A [VPC-attached function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html) sends outbound IPv6 when every subnet it uses is dual-stack and you turn on `Ipv6AllowedForDualStack`. Lambda does not support outbound IPv6 from IPv6-only subnets, or from functions that are not attached to a VPC.

**Terminal**

```bash
aws lambda update-function-configuration --function-name payouts \
  --vpc-config Ipv6AllowedForDualStack=true,SubnetIds=subnet-0aaa1111,subnet-0bbb2222,SecurityGroupIds=sg-0ccc3333
```

### What this does and does not fix

IPv6 traffic through the gateway is not translated. The source address is the resource's own IPv6 address, from the subnet's /64, which belongs to your VPC. A partner that accepts IPv6 can allowlist that prefix, and nobody outside your VPC sends from it. That is a stronger allowlist than a cloud's shared ranges, which admit every tenant (see [why cloud IP ranges are not an allowlist](https://fixedmark.com/blog/cloud-ip-ranges-are-not-an-allowlist)).

The catch is the other side. Most of the allowlists people need a static IP for, such as Indian broker consoles, bank API onboarding forms, and payout dashboards, usually take IPv4 only. An IPv4-only destination still needs an IPv4 path. The AWS way to reach IPv4 from IPv6-only subnets is [DNS64 and NAT64](https://docs.aws.amazon.com/vpc/latest/userguide/nat-gateway-nat64-dns64.html), and NAT64 runs on a NAT gateway, so you are back to paying for one. Since version 1.4, fck-nat also builds `fck-nat-nat64-*` AMIs that do NAT64 on an instance.

So the egress-only gateway is a cost tool, not a static IP tool. In dual-stack subnets, IPv6-capable destinations go through the free gateway and only IPv4 takes the NAT path. Which one a client picks depends on DNS and the client, as [IPv6 egress and IPv4-only allowlists](https://fixedmark.com/blog/ipv6-egress-and-ipv4-only-allowlists) covers.

## VPC endpoints: take AWS traffic off the NAT path

A lot of NAT traffic never leaves AWS. Image pulls from ECR, S3 writes, and DynamoDB reads from a private subnet cross the NAT gateway and pay its processing charge unless an endpoint sends them to the service directly.

- [Gateway endpoints](https://docs.aws.amazon.com/vpc/latest/privatelink/gateway-endpoints.html) exist for S3 and DynamoDB only. They add a prefix-list route to the route tables you pick, and AWS charges nothing extra for them. For an S3-heavy workload this is the cheapest fix there is.
- Interface endpoints (PrivateLink) cover most other AWS services. They bill per endpoint per AZ per hour and per GB processed. The [PrivateLink pricing page](https://aws.amazon.com/privatelink/pricing/) uses $0.01 an hour per endpoint interface and $0.01 per GB for the first petabyte in its US East example. Add them for high-volume services only, since several across three AZs can cost more than they save.

**Terminal**

```bash
aws ec2 create-vpc-endpoint --vpc-id vpc-0123456789abcdef0 \
  --vpc-endpoint-type Gateway \
  --service-name com.amazonaws.ap-south-1.s3 \
  --route-table-ids rtb-0private0a rtb-0private0b
```

Endpoints give you no address to hand a partner. They also change how AWS-side allowlists work. Per the [IAM condition key reference](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html), `aws:SourceIp` is not in the request context when a request arrives through a VPC endpoint. A bucket policy that allowlists your NAT gateway's Elastic IP stops matching for same-Region buckets once you add an S3 gateway endpoint. Rewrite those policies with `aws:SourceVpce` or `aws:SourceVpc` before you add the endpoint, not after.

## A static IP proxy instead of NAT

NAT catches every packet from the subnet. A proxy works per connection. Your code sends only the calls that need a fixed address, such as a bank API, through a proxy whose IPs are allowlisted. [How an HTTP CONNECT proxy works](https://fixedmark.com/blog/http-connect-proxy-explained) explains the protocol. TLS runs end to end, so the proxy forwards encrypted bytes.

It also works anywhere. A NAT instance or gateway only serves subnets in its own VPC. A proxy serves any client that can open an outbound TCP connection, including a Lambda function with no VPC at all. That function's own egress IP keeps changing (see [why serverless egress IPs change](https://fixedmark.com/blog/why-serverless-egress-ips-change)), but the partner never sees it.

**Node.js**

```javascript
// npm install undici
import { fetch, ProxyAgent } from "undici";

// Created once at init, reused across warm invocations.
const proxy = new ProxyAgent(process.env.EGRESS_PROXY_URL);

export const handler = async () => {
  // Only this call goes through the proxy. AWS SDK calls go direct.
  const res = await fetch("https://api.partner.example/v1/payouts", {
    dispatcher: proxy,
  });
  return { statusCode: res.status, body: await res.text() };
};
```

**Python**

```python
# requests is not in the Lambda runtime: bundle it or use a layer.
import os
import requests

session = requests.Session()
PROXY = os.environ["EGRESS_PROXY_URL"]
PROXIES = {"http": PROXY, "https": PROXY}

def handler(event, context):
    # Proxies passed per call, so boto3 keeps going direct.
    res = session.get(
        "https://api.partner.example/v1/payouts",
        proxies=PROXIES,
        timeout=10,
    )
    return {"statusCode": res.status_code, "body": res.text}
```

Use a dedicated variable name rather than `HTTPS_PROXY`. boto3 reads `HTTPS_PROXY`, so setting it on the function sends AWS API calls through the proxy too. [Selective proxying with NO_PROXY and per-client agents](https://fixedmark.com/blog/selective-proxying-no-proxy-and-per-client-agents) covers how each runtime treats those variables.

### Self-hosted or managed

You can run Squid or a similar forward proxy on an EC2 instance with an Elastic IP. Your callers' addresses change, so the proxy needs authentication, sent over TLS. Failover means two instances in two AZs, which is the NAT instance problem plus one more application to patch.

A managed proxy moves that work to a provider for a flat plan price.

A proxy does not remove the NAT path for compute that lives in private subnets. That compute still needs some internet route to reach the proxy. The proxy only frees that route from having to be stable or known to the partner.

## Choosing between them

_NAT gateway alternatives for fixed egress, by what they give a partner and what they cost you_

| Option                       | Fixed IPv4 for a partner                            | Availability                               | Your upkeep                                    | Cost shape                                                  |
| ---------------------------- | --------------------------------------------------- | ------------------------------------------ | ---------------------------------------------- | ----------------------------------------------------------- |
| NAT gateway (baseline)       | Yes, one Elastic IP per gateway                     | Managed, one per AZ                        | None                                           | Hourly per AZ plus per GB processed                         |
| NAT instance, built by hand  | Yes, with an Elastic IP                             | Whatever you script                        | AMI, OS patches, failover                      | Instance hours, no per-GB processing                        |
| fck-nat                      | Yes, with `eip_allocation_ids`                      | Auto Scaling replacement, connections drop | AMI updates, sizing                            | From $0.0042 an hour for a `t4g.nano` in US East            |
| alterNAT                     | Yes, but allowlist instance and standby gateway IPs | Fails over to a standby NAT gateway        | Terraform module, Lambda                       | Instance hours plus standby gateway hours                   |
| Egress-only internet gateway | No. IPv6 prefix only                                | Managed                                    | None                                           | No gateway charge                                           |
| VPC endpoints                | No. AWS services only                               | Managed                                    | Endpoint policies                              | Gateway type free, interface type hourly per AZ plus per GB |
| Static IP proxy              | Yes, the proxy's IPs                                | Two proxy hosts, yours or the provider's   | Self-hosted: all of it. Managed: client config | Instance hours, or a flat plan                              |

These options combine. A sensible layout is gateway endpoints for S3 and DynamoDB in every VPC, dual-stack subnets with an egress-only gateway, and then one of the IPv4 options for what is left. Pick that last piece by what the partner needs and how much traffic remains.

- Many workloads in private subnets, heavy general egress, and nobody to patch instances. Keep the NAT gateway and cut its traffic with endpoints and IPv6.
- Lots of traffic, cost pressure, and someone who owns the network. fck-nat per AZ, with Elastic IPs and the instance sized for sustained throughput.
- Only a few calls need a fixed IP, or the code runs outside AWS, or across several platforms. A static IP proxy, with no NAT needed for that purpose.

Whichever you choose, run `curl https://checkip.amazonaws.com` from each subnet before you send addresses to the partner. A route table still pointing at an old gateway is a common reason one AZ gets rejected. On Kubernetes, see [static egress IPs on Kubernetes](https://fixedmark.com/blog/kubernetes-egress-static-ip).

## Doing this with Fixedmark

Fixedmark is a managed static IP proxy, in early access. In the code above, set `EGRESS_PROXY_URL` to your Fixedmark proxy URL, such as `https://APP_ID:TOKEN@mum.egress.fixedmark.com:443`, and pass it only to the clients that call allowlisted APIs. The partner allowlists a pair of static IPv4 addresses that Fixedmark holds in Mumbai, Singapore, Newark, or Ashburn, so a payout call from Lambda in `ap-south-1` can leave from Mumbai.

- The proxy URL is HTTP CONNECT over TLS on port 443, or SOCKS5 over TLS on port 1443 for databases and other TCP services. TLS to the destination passes through and is never decrypted. See [concepts](https://fixedmark.com/docs/concepts) and the [Node.js](https://fixedmark.com/docs/node) and [Python](https://fixedmark.com/docs/python) guides.
- A Lambda function outside a VPC can use it with no subnets or routes. See the [AWS Lambda guide](https://fixedmark.com/integrations/aws-lambda). AWS still bills data transfer out to the proxy.
- The planned launch price for a dedicated IP pair is $29 a month on [Pro](https://fixedmark.com/pricing), with 100 GB of bandwidth, and may change. The [NAT gateway comparison](https://fixedmark.com/compare/aws-nat-gateway) sets it beside a two-AZ gateway.
- The trial runs on a shared IP pair, so do not register its addresses with a bank or broker. Confirm the address with [Verify your egress IP](https://fixedmark.com/docs/verify-egress-ip) before you hand it over.

It does not replace NAT for a VPC full of workloads that need general internet access. For heavy, all-protocol egress from private subnets, a NAT gateway or fck-nat fits better.

## Sources

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

- [Amazon VPC User Guide: Compare NAT gateways and NAT instances](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-comparison.html)
- [Amazon VPC User Guide: NAT instances](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_NAT_Instance.html)
- [Amazon VPC User Guide: Enable private resources to communicate outside the VPC (NAT instance setup)](https://docs.aws.amazon.com/vpc/latest/userguide/work-with-nat-instances.html)
- [fck-nat documentation](https://fck-nat.dev/stable/)
- [fck-nat: Choosing an instance size](https://fck-nat.dev/stable/choosing_an_instance_size/)
- [fck-nat: Configuration](https://fck-nat.dev/stable/configuration/)
- [Terraform Registry: RaJiska/fck-nat/aws module](https://registry.terraform.io/modules/RaJiska/fck-nat/aws)
- [Chime: alterNAT on GitHub](https://github.com/chime/terraform-aws-alternat)
- [Amazon VPC User Guide: Egress-only internet gateways](https://docs.aws.amazon.com/vpc/latest/userguide/egress-only-internet-gateway.html)
- [AWS Lambda Developer Guide: Giving Lambda functions access to a VPC](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html)
- [Amazon VPC User Guide: DNS64 and NAT64](https://docs.aws.amazon.com/vpc/latest/userguide/nat-gateway-nat64-dns64.html)
- [AWS PrivateLink Guide: Gateway endpoints](https://docs.aws.amazon.com/vpc/latest/privatelink/gateway-endpoints.html)
- [AWS PrivateLink pricing](https://aws.amazon.com/privatelink/pricing/)
- [IAM User Guide: AWS global condition context keys](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html)

Keep reading

## Related guides

- [Comparison AWS NAT Gateway The real monthly cost of a highly available AWS NAT Gateway, and when a static IP proxy is simpler.](https://fixedmark.com/compare/aws-nat-gateway)
- [Tool NAT gateway cost calculator Monthly NAT gateway, data processing, and public IPv4 cost for your traffic.](https://fixedmark.com/tools/nat-gateway-cost-calculator)
- [Integration AWS Lambda A fixed IP for Lambda without VPC, subnets, and two NAT Gateways.](https://fixedmark.com/integrations/aws-lambda)
- [Use case Partner API allowlisting Give Salesforce, SOAP vendors, and payment gateways one dedicated IP pair to allowlist, wherever your code runs.](https://fixedmark.com/use-cases/partner-api-allowlisting)
- [Comparison Google Cloud NAT What a static outbound IP through Cloud NAT costs and involves on Google Cloud, and when a proxy is simpler.](https://fixedmark.com/compare/google-cloud-nat)

## Frequently asked questions

### Is fck-nat safe to use in production?

It is an open-source NAT AMI on Amazon Linux 2023, and its docs are clear about its limits. The risks are the ones of any NAT instance. A failure takes egress down until the Auto Scaling group replaces the instance, open connections drop, and you own AMI updates. Use an Elastic IP so the address survives replacement, and run one instance per AZ.

### Does a NAT instance keep the same IP after it is replaced?

Only if you attach an Elastic IP. An auto-assigned public IPv4 address is released when the instance stops or terminates, and the replacement gets a new one. fck-nat attaches the Elastic IP you give it at boot, through \`eip_id\` in its config or \`eip_allocation_ids\` in the Terraform module.

### Can an egress-only internet gateway replace a NAT gateway?

Only for IPv6 traffic. It is free and managed, but it carries no IPv4. If any destination is IPv4-only, as many partner allowlists are, you still need a NAT gateway, a NAT instance, or a proxy for those calls.

### Do VPC endpoints give me a static IP?

No. They route traffic to AWS services privately, which cuts NAT processing charges. Requests through an endpoint carry no \`aws:SourceIp\`, so AWS-side policies should match on \`aws:SourceVpce\` or \`aws:SourceVpc\` instead of your NAT address.
