What does 0.0.0.0/0 mean? (and ::/0)
Codemia Knowledge Hub ·
0.0.0.0/0 means "all IPv4 addresses," and ::/0 means "all IPv6 addresses." The /0 is CIDR notation for zero network prefix bits, so the range covers the entire address space. You mostly see it as the default route in routing tables and as the "anywhere" match in firewall rules and security groups.
How the notation breaks down
The address part
0.0.0.0 is the "unspecified" IPv4 address. In a routing context it acts as a wildcard that matches any IP address. :: is the unspecified IPv6 address (shorthand for 128 zero bits).
The /0 CIDR suffix
CIDR (Classless Inter-Domain Routing) uses a suffix like /24, /16, or /0 to say how many leading bits define the network portion of an address.
| CIDR | Network Bits | Host Bits | Number of Addresses |
/32 | 32 | 0 | 1 (single host) |
/24 | 24 | 8 | 256 |
/16 | 16 | 16 | 65,536 |
/8 | 8 | 24 | 16,777,216 |
/0 | 0 | 32 | 4,294,967,296 (all IPv4 addresses) |
With /0, no bits belong to the network, so all 32 bits are "don't care" bits and the range matches every IPv4 address from 0.0.0.0 to 255.255.255.255.
The equivalent subnet mask is 0.0.0.0. A bitwise AND of any IP address with 0.0.0.0 yields 0.0.0.0, which is why every address matches.
0.0.0.0/0 as the default route
When a router gets a packet and no more specific route matches the destination, it falls back to the default route, 0.0.0.0/0.
The default entry is 0.0.0.0/0: "for any destination not explicitly listed, send the packet to 192.168.1.1."
To add or modify the default route explicitly:
Without a default route, a machine cannot reach anything outside its directly connected networks, which is why losing it breaks internet access.
Longest prefix match
With several routes, the router picks the longest matching prefix. The default route (/0) has the shortest possible prefix, so it is always the last resort:
For a packet destined to 10.0.1.5:
- Matches
10.0.1.0/24(24-bit prefix): wins, most specific - Matches
10.0.0.0/16(16-bit prefix) - Matches
0.0.0.0/0(0-bit prefix)
For a packet destined to 8.8.8.8:
- Does not match
10.0.1.0/24 - Does not match
10.0.0.0/16 - Matches
0.0.0.0/0: the only match, so it goes to the default gateway
0.0.0.0/0 in firewall and security group rules
In firewall configurations, 0.0.0.0/0 means "any source" or "any destination."
AWS Security Groups
iptables (Linux)
Cloud platforms
| Platform | Where You See 0.0.0.0/0 | Meaning |
| AWS Security Groups | Inbound/Outbound rules source | Allow/deny from all IPv4 |
| GCP Firewall Rules | Source ranges | Match all IPv4 sources |
| Azure NSG | Source address prefix | All IPv4 addresses |
| Kubernetes NetworkPolicy | ipBlock.cidr | All pod/external traffic |
Binding a server to 0.0.0.0
A server that binds to 0.0.0.0 (no CIDR suffix) listens on all available network interfaces:
| Bind Address | Accepts Connections From |
127.0.0.1 | Same machine only (loopback) |
0.0.0.0 | Any network interface (local, LAN, internet) |
Specific IP like 192.168.1.5 | Only through that interface |
IPv6 equivalents
| IPv4 | IPv6 | Meaning |
0.0.0.0/0 | ::/0 | All addresses (default route) |
0.0.0.0 | :: | Unspecified address |
127.0.0.1 | ::1 | Loopback address |
0.0.0.0/0 in firewall | ::/0 in firewall | Allow/deny all IPv6 |
On dual-stack networks (IPv4 and IPv6), firewall rules need both 0.0.0.0/0 and ::/0 to cover all traffic:
Mistakes with 0.0.0.0/0
- Opening SSH (port 22) to
0.0.0.0/0in production. That allows SSH from any IP on the internet. Restrict it to your office IP range or use a bastion host. Cloud providers like AWS warn when you do this. - Confusing
0.0.0.0/0with0.0.0.0. The first is a CIDR range meaning "all addresses." The second is the unspecified address, used for server binding or as a source in DHCP requests. - Forgetting
::/0on dual-stack hosts. Rules with only0.0.0.0/0do not cover IPv6, so traffic can bypass them over IPv6 if the server has an IPv6 address. - Deleting the default route. The machine can no longer reach anything outside its local subnet, and on a remote server that locks you out. Have console access before modifying routes.
- Reading
/0as "no network." It means zero network bits, not zero addresses. It is the opposite of/32(a single host):/0covers the maximum range,/32the minimum.
Related reading
- What does %5B and %5D in POST requests stand for?
- What does it mean for a Service to be of type NodePort, and have both port and targetPort specified?
- What is a good approach to develop a synchronous/blocking and an asynchrounous/non-blocking library-api in parallel? JavaScript
- What is a headless service, what does it do/accomplish, and what are some legitimate use cases for it?
- What is a non-blocking Rest Client?
- What is a proxy? What is it in Apache? Does it have many different meanings?
- What is an 'endpoint' in Flask?
- What is desirable number of connections in a pool?
System design interview problems on this topic
- Design a Load Balancer: solution and walkthrough
- Design a Domain Name System: solution and walkthrough
- Design a Global Content Distribution Network: solution and walkthrough
- Design an API Rate Limiter: solution and walkthrough

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseSystem Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.