/24 BYOIP CIDR AWS EC2 Withdrawn
Hyperscalers

How Do You Take a BYOIP Range Back Out of AWS?

BYOIP.info Editorial4 December 2026 5 min read Last technically reviewed 4 December 2026

Key takeaways

  • Disassociating an Elastic IP detaches it from a workload, yet the address stays allocated until you explicitly release it back to the BYOIP pool.
  • AWS EC2 requires zero allocated Elastic IPs and a withdrawn BGP advertisement before DeprovisionByoipCidr will accept removal of the whole imported range.
  • After withdrawal, the range remains provisioned and can be re-advertised, though re-advertisement alone cannot restore released addresses or migrated workloads.
  • Once deprovisioned, bringing the prefix back to EC2 later requires completing the provisioning process again.

Your workloads have already moved off AWS, yet Amazon EC2 rejects the deprovision request because one Elastic IP is still allocated. Removing a Bring Your Own IP (BYOIP) /24 from AWS follows a strict prerequisite chain: every Elastic IP allocation must be released, the BGP advertisement must be withdrawn, and only then can the imported range be deprovisioned.

Walking through the standard Amazon EC2 public IPv4 BYOIP workflow with an example range (203.0.113.0/24, reserved for documentation under RFC 5737) shows why a detached address still blocks removal and where your last easy rollback point sits.

Inventory dependencies and verify the replacement first

Before releasing any Elastic IP from your EC2 BYOIP pool, confirm that nothing still depends on the AWS path:

  1. Inventory workloads and associations: Check EC2 instances, NAT gateways, Network Load Balancers, and elastic network interfaces in the region holding addresses from the pool.
  2. Inventory external dependencies: Check DNS records (including TTLs), partner IP allowlists, reverse-DNS PTR records, and mail or webhook integrations that expect the old addresses.
  3. Verify the replacement service from outside AWS: Before releasing the final allocation or withdrawing the route, combine routing observer views with external HTTPS checks on the replacement destination, as described in Your Cloud Says “Advertised.” Can Users Reach Your IP?.

Disassociating an Elastic IP is not the same as releasing it

This distinction causes the most common surprise during AWS BYOIP offboarding:

  • Disassociate: Detaches the Elastic IP (for example, 203.0.113.10) from an instance, NAT gateway, or network interface. Traffic stops reaching that workload, yet the address remains allocated to your AWS account from the BYOIP pool.
  • Release: Returns the Elastic IP allocation back to the BYOIP address pool (ReleaseAddress). Until every allocated address from the /24 is released, the pool’s allocation count is non-zero and AWS blocks deprovisioning.

AWS’s documented EC2 removal sequence

Following the Amazon EC2 BYOIP onboarding and removal guide and the DeprovisionByoipCidr API reference, remove a public IPv4 BYOIP range in three ordered steps:

Release all remaining Elastic IPs allocated from the BYOIP address pool so the pool’s active allocation count drops to 0 .
Withdraw the BGP advertisement ( WithdrawByoipCidr ) so AWS stops announcing 203.0.113.0/24 to the internet.
Deprovision the entire imported CIDR ( DeprovisionByoipCidr ) once the range is no longer advertised and holds zero allocated addresses.

AWS deprovisions the whole imported prefix, not a partial sub-range.

What still blocks release, withdrawal, and deprovisioning

Track three separate states on 203.0.113.0/24 (documentation example): Allocation count, Advertisement, and Provisioning. Trying to skip directly to DeprovisionByoipCidr fails with a specific prerequisite until both earlier states clear:

Stage or testAllocation countAdvertisementProvisioningOutcome
Starting state (1 detached EIP)1 allocated (203.0.113.10, detached)AdvertisedProvisionedDeprovision blocked: release the remaining Elastic IP allocation and withdraw the route first
Early deprovision with 1 EIP left1 allocatedAdvertisedProvisionedRejected: active Elastic IP allocations must be released before deprovisioning
After releasing the Elastic IP0 allocatedAdvertisedProvisionedReady to withdraw the BGP advertisement; deprovisioning is still blocked while advertised
Early deprovision while advertised0 allocatedAdvertisedProvisionedRejected: stop advertising the CIDR (WithdrawByoipCidr) before deprovisioning
After withdrawing the route0 allocatedWithdrawnProvisionedDecision point: range is still provisioned and ready for DeprovisionByoipCidr
After deprovisioning0 allocatedWithdrawnDeprovisionedRange has left AWS EC2; using it in EC2 again requires provisioning again

Walk through the EC2 state transitions below and test early deprovisioning at each stage to see the exact prerequisite AWS checks:

EC2 BYOIP Removal Prerequisites · Example 203.0.113.0/24

Work through the steps in order, or trigger Deprovision early to inspect each AWS prerequisite check.

Allocation count
1 allocated (203.0.113.10, detached)
Advertisement
Advertised
Provisioning
Provisioned

Starting state: 1 detached Elastic IP is still allocated

Example Elastic IP 203.0.113.10 is detached from its old EC2 workload, yet it is still allocated to your account. Release it, withdraw the route, and then deprovision 203.0.113.0/24.

The decision point after withdrawal

Pause right after withdrawing the route and before calling DeprovisionByoipCidr. At this point, the /24 is still provisioned in your AWS account and can be advertised again quickly if an unexpected dependency surfaces.

Keep the scope of that rollback clear: re-advertising the range restores BGP announcement from AWS, yet re-advertisement alone cannot restore released Elastic IP allocations or migrated workloads. You would still have to re-allocate addresses and re-attach workloads if you rolled back. Once you run DeprovisionByoipCidr, the range leaves EC2 completely, and bringing it back to EC2 later requires going through the provisioning workflow again. Wait until the range is fully withdrawn and no longer needed in AWS before removing AWS’s origin ASN from your RPKI Route Origin Authorization (ROA).

FAQ

Your Cloud Says “Advertised.” Can Users Reach Your IP?
BYOIP on AWS, Google Cloud and Azure: What Actually Differs?
When Does BYOIP Pay Off on AWS?
What Is RPKI? ROAs, Origin Validation and Your BYOIP Prefix
AWS - Bring your own IP addresses (EC2 onboarding and removal)
AWS EC2 API Reference - DeprovisionByoipCidr

Ready to see where BYOIP is supported?

Continue the series