Network & delivery
7 min readUpdated/29 subnet mask (255.255.255.248): 8 addresses, 6 usable, worked through
Quick answer
A /29 subnet has the mask 255.255.255.248 and contains 8 IPv4 addresses: 29 bits name the network and 3 bits the host, and 2 to the power of 3 is 8. The first address is the network address and the last is the broadcast address, leaving 6 usable. When a hosting provider's router takes one as the gateway, 5 remain for your servers. A /24 holds 32 /29 blocks, each starting at a multiple of 8.
01What is a /29 subnet?
The /29 is CIDR notation (RFC 4632) for a prefix length of 29 bits. Of the 32 bits in an IPv4 address, the first 29 are fixed for the network and the last 3 vary for hosts. Three host bits give 2^3 = 8 addresses, so every /29 is a block of eight that starts at a multiple of 8 in the last octet.
The mask is the prefix written in dotted decimal: 29 one-bits followed by 3 zero-bits. The last octet, 11111000, is 128 + 64 + 32 + 16 + 8 = 248. The wildcard mask used in router access lists is its inverse, 255 - 248 = 7. The rules behind every mask are in what is a subnet mask.
| Property | /29 value |
|---|---|
| Subnet mask | 255.255.255.248 |
| Mask in binary | 11111111.11111111.11111111.11111000 |
| Wildcard (inverse) mask | 0.0.0.7 |
| Total addresses | 8 |
| Usable hosts (classic rule) | 6 |
| Usable for servers behind one gateway | 5 |
| Block size (increment) | 8 |
| /29 blocks in a /24 | 32 |
| Example | 203.0.113.8/29 runs from 203.0.113.8 to 203.0.113.15 |
02How many usable IP addresses are in a /29?
Six by the classic rule, five in the most common real setup, and sometimes three or eight. It depends on how the block reaches you, so check before you plan servers.
| How the /29 is delivered | Addresses reserved | Left for your hosts |
|---|---|---|
| Classic on-link subnet | Network (first) and broadcast (last) | 6 |
| Provider router on the same subnet, the usual hosting /29 | Network, broadcast and the gateway | 5 |
| Two provider routers sharing a virtual gateway (VRRP, RFC 5798) | Network, broadcast, both routers and the virtual address | 3 |
| Routed to an address you already have | None inside the block | 8 |
03A hosting provider's /29, worked through
Suppose a provider assigns 203.0.113.8/29 with the gateway on the first usable address, the most common convention. The eight addresses split like this: 203.0.113.8 is the network address, 203.0.113.9 the provider's gateway, 203.0.113.10 your primary server address, 203.0.113.11 to 203.0.113.14 four more addresses for services, containers or virtual machines, and 203.0.113.15 the broadcast address.
On Linux, each address gets the /29 prefix and the default route points at the gateway. ip route get should show that .14 is reached directly on the link while .16, one past the block, goes through the gateway, and the kernel rejects a gateway outside the block outright.
ip addr add 203.0.113.10/29 brd + dev eth0
ip addr add 203.0.113.11/29 brd + dev eth0
ip route add default via 203.0.113.9 dev eth0
$ ip -4 addr show dev eth0 | grep inet
inet 203.0.113.10/29 brd 203.0.113.15 scope global eth0
inet 203.0.113.11/29 brd 203.0.113.15 scope global secondary eth0
$ ip -4 route
default via 203.0.113.9 dev eth0
203.0.113.8/29 dev eth0 proto kernel scope link src 203.0.113.10
$ ip route get 203.0.113.14
203.0.113.14 dev eth0 src 203.0.113.10 uid 0
$ ip route get 203.0.113.16
203.0.113.16 via 203.0.113.9 dev eth0 src 203.0.113.10 uid 0
# a gateway outside the block is refused
$ ip route add default via 203.0.113.17 dev eth0
Error: Nexthop has invalid gateway.04All 32 /29 subnets in a /24
Because 256 / 8 = 32, a /24 divides into exactly 32 /29 blocks. Each starts at a multiple of 8; the usable hosts are the network address plus 1 to plus 6, and the broadcast is the next block's start minus 1. Only the last octet changes, so the table lists it alone: block 2 in 203.0.113.0/24 is 203.0.113.8/29.
| Block | Network | Usable hosts | Broadcast |
|---|---|---|---|
| 1 | .0 | .1 to .6 | .7 |
| 2 | .8 | .9 to .14 | .15 |
| 3 | .16 | .17 to .22 | .23 |
| 4 | .24 | .25 to .30 | .31 |
| 5 | .32 | .33 to .38 | .39 |
| 6 | .40 | .41 to .46 | .47 |
| 7 | .48 | .49 to .54 | .55 |
| 8 | .56 | .57 to .62 | .63 |
| 9 | .64 | .65 to .70 | .71 |
| 10 | .72 | .73 to .78 | .79 |
| 11 | .80 | .81 to .86 | .87 |
| 12 | .88 | .89 to .94 | .95 |
| 13 | .96 | .97 to .102 | .103 |
| 14 | .104 | .105 to .110 | .111 |
| 15 | .112 | .113 to .118 | .119 |
| 16 | .120 | .121 to .126 | .127 |
| 17 | .128 | .129 to .134 | .135 |
| 18 | .136 | .137 to .142 | .143 |
| 19 | .144 | .145 to .150 | .151 |
| 20 | .152 | .153 to .158 | .159 |
| 21 | .160 | .161 to .166 | .167 |
| 22 | .168 | .169 to .174 | .175 |
| 23 | .176 | .177 to .182 | .183 |
| 24 | .184 | .185 to .190 | .191 |
| 25 | .192 | .193 to .198 | .199 |
| 26 | .200 | .201 to .206 | .207 |
| 27 | .208 | .209 to .214 | .215 |
| 28 | .216 | .217 to .222 | .223 |
| 29 | .224 | .225 to .230 | .231 |
| 30 | .232 | .233 to .238 | .239 |
| 31 | .240 | .241 to .246 | .247 |
| 32 | .248 | .249 to .254 | .255 |
05Which /29 does an address belong to?
Divide the last octet by 8, drop the remainder and multiply by 8. For 203.0.113.77: 77 / 8 = 9.625, and 9 x 8 = 72, so the network is 203.0.113.72, the usable hosts are .73 to .78 and the broadcast is .79. A bitwise AND of the address with the mask gives the same answer: 77 is 01001101, 248 is 11111000, and 01001101 AND 11111000 = 01001000, which is 72.
The subnet calculator does this for any prefix; in a script, Python's ipaddress module is enough.
$ python3 -c 'import ipaddress; n=ipaddress.ip_interface("203.0.113.77/29").network; print(n, n.netmask, n[1], n[-2], n.broadcast_address)'
203.0.113.72/29 255.255.255.248 203.0.113.73 203.0.113.78 203.0.113.7906/29 vs /30 vs /28: which block do you need?
Each extra bit of prefix halves the block. The two reserved addresses are a fixed cost, so the smaller the block, the larger the share lost: 2 of 8 in a /29 is 25%, 2 of 4 in a /30 is 50%. RFC 3021 (December 2000) removed that cost for two-address point-to-point links by allowing /31.
| Prefix | Mask | Addresses | Usable (classic) | Behind one gateway | Typical use |
|---|---|---|---|---|---|
| /26 | 255.255.255.192 | 64 | 62 | 61 | Larger server racks, office networks |
| /27 | 255.255.255.224 | 32 | 30 | 29 | Small office or a server group |
| /28 | 255.255.255.240 | 16 | 14 | 13 | Small clusters and management networks |
| /29 | 255.255.255.248 | 8 | 6 | 5 | Small public blocks from hosting providers and business lines |
| /30 | 255.255.255.252 | 4 | 2 | 1 | Point-to-point links between two routers |
| /31 | 255.255.255.254 | 2 | 2 (RFC 3021) | 1 | Point-to-point links without network or broadcast addresses |
| /32 | 255.255.255.255 | 1 | 1 | Not applicable | A single host route or loopback address |
07What to know before using a /29 on the internet
- A /29 cannot usefully be announced in BGP on its own. Most networks filter prefixes longer than /24, so a /29 is reached as part of a larger block your provider announces; in a 2014 RIPE Labs test a /24 was visible to 92% of full-feed route collector peers and a /28 to at most 15%. Your own BGP routing needs at least a /24
- Reverse DNS needs care: PTR records sit on octet boundaries, so the reverse zone of a /29 cannot be delegated the usual way. RFC 2317 describes the CNAME-based classless delegation used instead, or the provider sets PTR records for you
- Eight adjacent public addresses are one target. Floods spread across a whole block hit every address in it at once, so protection has to cover the block, not one server; see DDoS-protected hosting
- The examples on this page use 203.0.113.0/24, a documentation range from RFC 5737; see private IP address ranges for the others
Questions
Frequently asked questions
- 01How many hosts are in a /29?
- A /29 has 8 addresses and 6 usable host addresses, because the first is the network address and the last is the broadcast address. If your provider's router uses one of the six as your default gateway, as most hosting providers do, 5 remain for your own servers. A /29 routed to an address you already have can use all 8.
- 02What is the subnet mask for /29?
- The subnet mask for a /29 is 255.255.255.248. In binary it is 29 ones followed by 3 zeros, and the last octet, 11111000, equals 248. Its wildcard or inverse mask, used in some router access lists, is 0.0.0.7. Every /29 block is 8 addresses long and starts at a multiple of 8, such as .0, .8, .16 or .248.
- 03How many /29 subnets are in a /24?
- A /24 contains 32 /29 subnets. A /24 has 256 addresses and each /29 has 8, so 256 divided by 8 gives 32. Put another way, a /29 uses 5 more prefix bits than a /24, and 2 to the power of 5 is 32. The blocks start at .0, .8, .16 and so on up to .248, and each ends 7 addresses later.
- 04Can I use the network and broadcast addresses of a /29?
- Not on an ordinary on-link subnet. The network address names the block and the broadcast address reaches every host on it, so giving either to a server causes routing and ARP problems. The exception is a block routed to your server's main address, where the /29 has no shared segment and all 8 addresses can be bound. Ask your provider which model it uses.
- 05What is the difference between a /29 and a /30?
- A /29 has 8 addresses with 6 usable; a /30 has 4 addresses with 2 usable. A /30 is the traditional choice for a point-to-point link between two routers, while a /29 gives a customer a gateway plus up to five addresses for servers. RFC 3021 later allowed /31 on point-to-point links, which wastes no addresses at all.
Sources
Sources and verification
Checked on 13 November 2026 on Debian 12: the Python example in “Which /29 does an address belong to?” prints the output shown (Python 3.11.2). Other configuration, commands, log lines and output on this page are examples: adapt them to your system and check them before use.
- 01RFC 4632: Classless Inter-domain Routing (CIDR) · IETF
- 02RFC 1878: Variable Length Subnet Table For IPv4 · IETF
- 03RFC 3021: Using 31-Bit Prefixes on IPv4 Point-to-Point Links · IETF
- 04RFC 5798: Virtual Router Redundancy Protocol (VRRP) Version 3 · IETF
- 05RFC 2317: Classless IN-ADDR.ARPA delegation · IETF
- 06Propagation of longer-than-/24 IPv4 prefixes · RIPE Labs
- 07RFC 5737: IPv4 Address Blocks Reserved for Documentation · IETF
Last updated