Your cart is currently empty!
Carrier grade NAT and why mobile IPs are shared
Two addresses for one modem
Plug a 4G modem into a Linux box, bring up the connection, and look at the interface address. On most mobile networks it won’t be a public address at all. It’ll be something like 100.72.14.9 or 10.211.3.40. Then ask an IP echo service what address your traffic arrives from, and you’ll get a completely different number, a public IPv4 address registered to the carrier.
That gap between the address the modem holds and the address the internet sees is carrier-grade NAT. Between your modem and the internet, the carrier runs large translation gateways that map the private addresses of many subscribers onto a much smaller pool of public addresses. Your public address, at any given moment, is shared with other subscribers on the same gateway, who are using the same address at the same time for their own traffic.
We run modem farms on Singapore carriers, and CGNAT shapes almost every operational decision in them: how customers reach a modem, what rotation actually does, why a modem sometimes can’t open more connections, and what a site sees when traffic arrives from one of our addresses. It’s also the source of the most common misunderstanding about mobile proxies, the idea that a shared address can’t be blocked. It can. Sharing changes the defender’s calculation, and it doesn’t take the decision away from them.
This piece explains CGNAT from the operator’s side. How the translation works, how to tell you’re behind it, what sharing an address means for how sites treat mobile traffic, what it doesn’t guarantee, how it interacts with rotation, and what changes on IPv6, where most mobile networks don’t share addresses at all. The comparison of proxy types in general lives in the residential-versus-datacenter-versus-mobile guide, and the ownership question in the guide on owning modems versus renting a pool. This is the mechanism underneath both.
None of the figures here are measurements of any particular carrier. How many subscribers share an address, how long mappings last, and how often addresses change all vary by carrier and by gateway, and carriers don’t publish them.
Why carriers share addresses
The reason is arithmetic. There are about four billion IPv4 addresses in total, a large share reserved or already allocated, and the regional registries ran out of fresh blocks to hand out years ago. Mobile carriers, meanwhile, serve enormous numbers of devices, many of them always connected. Giving every phone, tablet, modem and connected car its own public IPv4 address was never going to fit.
Carrier-grade NAT is the carrier-scale version of what a home router does. A home router gives every device at home a private address and translates all of them onto the single public address the ISP assigned. A carrier does the same thing one level up, across a whole region’s subscribers, onto a pool of public addresses. When the home router is also doing NAT behind a carrier that uses CGNAT, the result is two layers of translation, sometimes called NAT444, after the three address realms involved.
Mobile networks adopted it early and widely, because their device counts grew fastest and because mobile devices mostly make outbound connections, which NAT handles well. Fixed broadband ISPs use it too, particularly newer ones and those in regions with scarce address allocations, but it’s most consistent on mobile.
The long-term fix is IPv6, which has enough addresses that no one needs to share. Many mobile networks now give devices IPv6 addresses natively and use CGNAT, or IPv6-to-IPv4 translation, only for traffic to IPv4-only destinations. That’s covered near the end, because it changes the sharing picture substantially.
For a collector, the practical upshot is that a mobile IPv4 address is a shared resource by design. Its behaviour, its reputation and even its availability are partly determined by strangers.
How the translation actually works
When your modem sends a packet to a website, the source address is the modem’s private address and the source port is whatever your operating system picked. At the carrier’s NAT gateway, that pair is rewritten: the source address becomes one of the gateway’s public addresses, and the source port becomes a port the gateway allocated. The gateway records the mapping. When the website replies to that public address and port, the gateway looks up the mapping and rewrites the destination back to your modem’s private address and original port.
Because a mapping is identified by public address and port, many subscribers can share one public address simultaneously, each using a different set of ports on it. A public address has roughly 65,000 usable ports, and the gateway hands them out across all the subscribers mapped to that address.
Carriers commonly allocate ports in blocks rather than one at a time. A subscriber gets a block of ports on a public address, and connections use ports from that block until it runs out, at which point the gateway may allocate another block, possibly on another address. Block allocation reduces how much the carrier has to log, since one log entry covers a whole block instead of one entry per connection.
Mappings expire. A TCP mapping typically lasts while the connection is active and for some time after it goes idle, and a UDP mapping lasts a shorter idle period. The exact timeouts are carrier configuration. When a mapping expires, the port goes back to the pool, and any packet the website sends to it afterwards has nowhere to go.
Two details follow that matter in operations. The public address your traffic uses can change during the life of the modem’s connection, because it belongs to the mapping, and a new block allocation can land on a different public address. And the mapping is only created by outbound traffic. Nothing on the internet can start a connection to your modem, because there’s no mapping for an inbound packet to use.
What the carrier keeps
Sharing an address raises an obvious question: if many subscribers use the same public address, how does anyone work out who was responsible for a particular connection? The answer is that the carrier keeps the mapping.
Carriers operating CGNAT generally log which subscriber held which public address and port range at which time. With port block allocation, that’s a record per block assignment. Combined with the exact time and source port of a connection, those logs let the carrier trace a connection back to a subscriber. Many jurisdictions require carriers to be able to do this, and the logging design of CGNAT systems reflects that.
For a website, this means a shared address isn’t anonymous in any meaningful sense to someone with legal standing to ask the carrier. It also means a site that wants to report abuse accurately needs to record the source port and precise timestamp as well as the address, which most sites don’t do by default, so abuse reports against CGNAT addresses often can’t be resolved to one subscriber.
For an operator running modems, it means every connection through those modems is traceable to the SIM’s account holder. That’s you. The accountability for traffic leaving a modem farm sits with whoever registered the SIMs, and in Singapore, SIM registration is tied to identity. Anyone buying mobile proxy capacity should understand that the traffic is attributable, just not by the site directly.
That accountability is worth keeping in mind when deciding what traffic a mobile farm should carry. It’s one of the reasons we’re strict about what our own modems are used for.
How to tell you’re behind CGNAT
It’s worth confirming rather than assuming, because behaviour differs between carriers, between plans and sometimes between APNs on the same carrier.
The first check is the modem’s own address. If the address on the modem’s WAN interface falls in 100.64.0.0/10, the shared address space reserved for carrier NAT by RFC 6598, or in one of the private ranges like 10.0.0.0/8, the carrier is translating. If it matches the address an echo service reports, the modem has a public address directly.
The second is inbound reachability. A modem with a public address can accept an inbound connection, if nothing upstream filters it. A modem behind CGNAT can’t, because there’s no mapping for the inbound packet. Trying to reach a listening port on the modem’s reported public address from outside tells you quickly.
The third is watching the public address over time. Query an echo service at intervals while keeping the connection up. Behind CGNAT, you may see the public address change without the modem reconnecting, when a new port block lands on a different address, or you may see several modems on the same carrier report the same public address at the same moment. Both are strong signs of sharing.
A traceroute can also show the carrier’s internal hops in the shared or private ranges before traffic reaches public address space, though some carriers filter the responses that traceroute depends on.
Some carriers sell plans or APNs with public IPv4 addresses, usually for business or IoT customers, and a modem on one of those behaves like a small fixed-line connection instead. They’re worth knowing about when a workload needs inbound reachability, and the address on them isn’t shared, which changes the reputation picture described below.
What sharing means for how sites treat mobile IPs
From a defender’s point of view, a shared address is a blunt instrument. Blocking it blocks everyone behind it, and behind a mobile CGNAT address are ordinary subscribers who are also the site’s customers.
That’s the core of why mobile addresses tend to be treated more cautiously than datacenter addresses. A datacenter address is usually one server, often one customer, and blocking it has little collateral cost. A mobile address might carry many real users’ traffic in the same minute, and a site that blocks it risks turning away paying visitors, with no way to know from the address alone how many.
Defenders respond by shifting weight away from the address. Instead of blocking a mobile address outright, a bot-management system is more likely to rely on signals that separate one client from another behind it: cookies and session tokens, browser and TLS characteristics, behaviour over the session, and challenges that a real user can pass. Per-address rate limits still exist, but a site may set them higher for known mobile ranges, since legitimate traffic from one mobile address can be substantial.
IP reputation systems also treat mobile ranges differently. They know which address ranges belong to mobile carriers, and a mobile address’s history is a blend of many users’ behaviour rather than one operator’s. Reputation for a mobile address tends to move more slowly and recover more readily than for a datacenter address, because good traffic from real users keeps arriving on it. The detection guides in this series explain how reputation feeds score addresses in more detail.
All of that is about how the address is weighed, and it’s the whole of what CGNAT gives a collector: an address that isn’t, by itself, strong evidence of automation. Everything else about the traffic still counts.
Shared fate cuts both ways
Sharing an address with strangers means inheriting their behaviour, and the effects aren’t all favourable.
If another subscriber on the same public address is doing something abusive, such as spamming a forum, hammering a login page or running a badly behaved scraper of their own, the address’s reputation absorbs it. A site that sees abuse from the address may raise challenges for everyone on it for a while. Your traffic, arriving on the same address, gets the same treatment, and nothing in your own behaviour caused it. From the collector’s side, this looks like a random increase in challenges or blocks on a modem that was fine yesterday.
Per-address rate limits count everyone. If a site allows a certain number of requests per minute per address, that budget is shared with every other subscriber using the address at that moment. On a busy address, your collector can hit a rate limit it never approached on its own traffic. That’s one reason request rates that were comfortable in testing can fail at peak hours.
Other proxy operators are on the same carriers. Mobile proxy farms, including ours, run on consumer and business SIMs on the same networks as everyone else. If another farm on the same carrier drives aggressive automated traffic at a particular site, that site’s view of the carrier’s address ranges gets worse for everyone, including the farm that behaves well.
And it runs the other way too. Your traffic lands on addresses real people depend on. A collector that behaves badly through a mobile address can get that address challenged or blocked for ordinary subscribers who did nothing. That’s an ethical cost as well as a technical one, and it’s a strong argument for keeping mobile collection polite: moderate rates, respect for the site’s limits, and no traffic that a site would reasonably treat as abuse.
What CGNAT doesn’t guarantee
The idea that mobile addresses can’t be blocked is the most common and most expensive misreading of CGNAT. Here’s what the sharing doesn’t give you.
It doesn’t prevent blocking. A site can block a mobile address, and some do, particularly when the address produces enough bad traffic that the collateral cost looks acceptable, or when the site’s own users rarely come from mobile networks. It can block whole ranges, or the carrier’s entire network, for particular endpoints.
It doesn’t hide the client. Everything above the network layer, the TLS handshake, the headers, the browser’s characteristics, the cookies and the behaviour, is exactly what bot management examines, and CGNAT does nothing to any of it. A client that’s identifiable as automation from a datacenter address is identifiable as automation from a mobile address too.
It doesn’t break session linking. Cookies and session tokens tie requests together across addresses. A client that rotates its mobile address but keeps its session is one visitor on several addresses, which is itself a signal.
It doesn’t make an address clean. A mobile address may already carry reputation from other subscribers, or from other proxy users, before you ever use it.
It doesn’t change the rules. Terms of service, access restrictions and laws about collecting personal data apply regardless of what kind of address the traffic arrives from.
Nothing about a mobile address is undetectable, unbannable or risk-free, and anyone selling it that way is describing a property CGNAT doesn’t have. What it provides is an address whose presence is weaker evidence than a datacenter address would be. That’s valuable, and it’s limited.
Rotation and what a reconnect really does
Mobile proxies rotate addresses, usually by reconnecting the modem’s data session or toggling airplane mode, and CGNAT explains both why that works and why it’s less predictable than it sounds.
When the modem’s data session is torn down and brought back up, the carrier usually assigns it a new private address, and the modem’s old mappings on the NAT gateway are released. The next outbound connection creates new mappings, often on a different public address from the gateway’s pool. So a reconnect usually produces a new public address.
Usually, not always. The gateway’s pool of public addresses is finite, and a reconnect can land on the same public address again, or on one used a few minutes earlier. How large the pool is for a given region and gateway isn’t published, and it can differ between carriers and times of day. A farm that assumes every reconnect gives a fresh, never-seen address will be wrong some of the time. The practical check is to log the public address after every reconnect and measure how often addresses repeat over a day or a week for each carrier.
Reconnect timing matters too. Some carriers are slow to release and reassign, and a reconnect performed too quickly can fail or return the same address. Reconnecting too often can also trip carrier-side protections against unusual attach behaviour. Each carrier needs its own tuning, found by observation.
And because public addresses can change without a reconnect, when a new port block lands elsewhere, a long-lived sticky session isn’t guaranteed to keep one public address for its whole life either. For workloads where a site ties a session to an address, as the guide on mixing rendered and plain requests describes, that’s worth monitoring rather than assuming.
Rotation gives you variety in addresses. It doesn’t give you variety in carriers, ASNs or regions, and a site that treats the whole carrier range as one population sees all of them as the same source.
Operating modems behind CGNAT
CGNAT shapes how a modem farm has to be built, in ways that aren’t obvious until you run one.
No inbound connections. Because nothing on the internet can open a connection to a modem behind CGNAT, a proxy on the modem can’t simply listen on its public address for customers. The standard design reverses the direction: each modem, or the host it’s attached to, opens an outbound tunnel to a gateway server with a public address, and customer connections arrive at that gateway and travel down the tunnel. The gateway becomes the proxy endpoint customers see. If the tunnel drops, that modem is unreachable until it reconnects, so tunnel health monitoring is part of basic operations.
Idle mappings expire. A connection that sits idle longer than the carrier’s mapping timeout loses its mapping, and the next packet in either direction goes nowhere. Long-lived tunnels need keepalives more frequent than the timeout. Customer connections that hold a socket open idle for a long time, as some database clients and streaming protocols do, can see silent drops. Keepalives at the TCP or application level avoid this.
Port allocation can run out. With port block allocation, a subscriber has a limited number of ports at any time, and very high concurrency through one modem can exhaust its block faster than the gateway allocates more. The symptom is connection failures or timeouts that appear only under load and clear when concurrency drops. Per-modem concurrency limits, set by observation for each carrier, keep a farm below that point.
UDP gets shorter timeouts than TCP. Workloads that relay UDP through a mobile proxy need more frequent keepalives, and the SOCKS5 guide in this series covers how UDP relaying works in the first place.
None of these are unique to mobile, but CGNAT makes all of them the default rather than the exception.
Geolocation and gateways
Where a mobile address appears to be located is another consequence of how carriers route traffic, and it surprises people who expect mobile addresses to be precise.
A mobile subscriber’s traffic leaves the carrier’s network through its NAT gateways, and the public addresses belong to those gateways, not to the cell the subscriber is in. So geolocation databases, which map address ranges to places, can only locate a mobile address as precisely as the carrier’s gateway infrastructure and address registration allow. Often that’s a country or a major city, even when the subscriber is somewhere else entirely.
In a small country, this barely matters. Singapore traffic on a Singapore carrier geolocates to Singapore, and that’s the level of precision most sites use. In larger countries, a subscriber in one city can appear to be in another, where the carrier’s gateway sits, and city-level targeting of mobile addresses is correspondingly rough. Vendors that sell city-level mobile targeting are often selling the gateway’s location, which may or may not match what the target’s geolocation provider thinks.
Geolocation databases also differ from each other. The same mobile address can show different cities, or even different regions, in different providers’ data, and the one that matters is whichever provider the target site uses. The only reliable check is to see what the target serves: its regional content, currency or language defaults when reached through the address.
Carriers also move address ranges between gateways and regions over time, and geolocation databases lag behind. An address block that geolocated correctly last quarter can be wrong after a carrier reorganises its network, which shows up as regional content that doesn’t match the expected market.
For collectors that depend on regional content, that means verifying location against each target rather than trusting the address’s advertised location.
CGNAT on fixed lines and residential pools
CGNAT isn’t only a mobile phenomenon, and the difference between how it shows up on mobile and on fixed broadband explains some of what people observe about residential proxies.
Many fixed broadband ISPs use CGNAT too, especially newer providers, fibre networks built after IPv4 ran short, and ISPs in regions with small address allocations. A home connection on one of those ISPs shares its public IPv4 address with other households, exactly as a mobile subscriber does. Other ISPs still give each household its own public IPv4 address, often one that stays the same for weeks or months.
That split matters for residential proxy pools. Residential pools are built from home connections, and the addresses in them are a mix: some are shared CGNAT addresses carrying several households’ traffic, others are dedicated addresses carrying one household’s. A dedicated residential address builds a reputation from one household plus whatever proxy traffic is routed through it, which is closer to a datacenter address in how quickly it can be judged. A CGNAT residential address behaves more like a mobile one.
Mobile networks differ from fixed ones in degree. Mobile CGNAT is close to universal on IPv4, the number of subscribers behind each gateway is typically large, and addresses change more readily because devices reconnect constantly as they move between cells and networks. That constant churn is part of why mobile addresses carry such blended histories.
For a buyer, this means the label on a pool says less than the mechanics underneath it. A residential address might be shared or dedicated. A mobile address on IPv4 is almost always shared, and on IPv6 almost never is. When a target’s behaviour differs between pools that should be similar, checking whether the addresses are shared is a good place to start.
It also explains why vendors struggle to state a meaningful number for pool size. Counting distinct public addresses seen over a month says little about how many are usable at once, or about how many other people are using each one.
IPv6 on mobile networks
Everything above is about IPv4, and IPv6 changes it substantially.
Many mobile networks now give each device its own IPv6 prefix, typically a /64, which is globally routable. There’s no NAT on IPv6 in these networks. The device’s IPv6 address is its own, not shared with other subscribers, and in principle it can receive inbound connections, though carriers often filter unsolicited inbound traffic.
For IPv4 destinations, those same networks keep CGNAT, or run the device on IPv6 only and translate at the edge. A common arrangement on IPv6-only mobile networks is 464XLAT: the phone translates IPv4 traffic from apps into IPv6 locally, the carrier translates it back to IPv4 at a gateway, and the IPv4 traffic leaves from a shared address exactly as with CGNAT.
So a single modem can present two very different identities. On IPv4, a shared address from the carrier’s pool. On IPv6, its own prefix, which isn’t shared and which carries a reputation built only from that modem’s traffic. Which one a site sees depends on whether the site supports IPv6 and how the client chooses between address families, which the IPv6 collection guide in this series covers in depth, along with the endpoints that refuse IPv6 entirely.
For defenders, an IPv6 prefix from a mobile carrier is a much finer-grained identifier than a shared IPv4 address. Many systems treat the /64 as the unit, since everything inside it belongs to one subscriber. The crowd that shields a shared IPv4 address doesn’t exist on IPv6.
For operators, it means IPv6 has to be checked per modem, since carriers enable it differently and a host-level test can mislead. And it means that anything said about mobile addresses being shared is true of IPv4 only.
What to do on Monday
If you run modems, or buy mobile proxy capacity, here’s what we’d check.
Confirm CGNAT on each carrier and APN you use. Compare the modem’s WAN address against an echo service, note whether it’s in the shared or private ranges, and test inbound reachability. Record which carriers and plans give shared addresses and which give public ones.
Log the public address after every rotation and measure repeats per carrier over a week. That tells you what rotation actually buys on each network, instead of what it’s assumed to.
Check IPv6 per modem, and decide deliberately whether collection should use it, knowing it isn’t shared.
Set keepalives on tunnels and long-lived connections shorter than the carrier’s observed mapping timeouts, and set per-modem concurrency limits below the point where connections start failing under load.
Verify location against each target’s regional content, not the address’s advertised location.
And set request rates as if the address belongs to other people too, because it does. Sharing an address makes it weaker evidence against you, and it makes your behaviour part of everyone else’s experience on that address.
For more on proxy infrastructure, from choosing pool types to running modems yourself, the full set of guides is at Data Research Tools.
Get new guides and videos first — join the Telegram channel.
Leave a Reply