IP subnetting basics-divide networks efficiently
Understand IP subnetting: subnet masks, CIDR notation, splitting networks, calculating host ranges, and VPS networking.
On this page
Subnetting divides a large network into smaller subnetworks. A subnet mask defines the network portion vs host portion of an IP address. Understanding subnetting is essential for VPS networking, firewalls, and load balancing.
CIDR notation (slash notation)
CIDR notation shows the subnet mask as a number (0-32):
- /32: Single host (255.255.255.255)
- /24: 256 hosts (255.255.255.0) - standard small network
- /16: 65,536 hosts (255.255.0.0) - medium network
- /8: 16+ million hosts (255.0.0.0) - large network
Example: 192.168.1.0/24 means: network 192.168.1.0, subnet mask 255.255.255.0, hosts 192.168.1.1 to 192.168.1.254
Common subnet masks (quick reference)
| CIDR | Mask | Hosts | Use |
|---|---|---|---|
| /30 | 255.255.255.252 | 4 | Point-to-point links |
| /28 | 255.255.255.240 | 16 | Small LANs |
| /27 | 255.255.255.224 | 32 | Medium LANs |
| /24 | 255.255.255.0 | 256 | Standard LAN |
| /23 | 255.255.254.0 | 512 | Large LAN |
| /22 | 255.255.252.0 | 1,024 | Very large LAN |
Calculate network and broadcast addresses
Example: 192.168.1.0/24
- Network address: 192.168.1.0 (first address, for network identification)
- First usable host: 192.168.1.1
- Last usable host: 192.168.1.254
- Broadcast: 192.168.1.255 (last address, for broadcasts)
Usable hosts = 2^(32-CIDR) - 2
Example: /24 = 2^8 - 2 = 256 - 2 = 254 usable hosts
Subnetting on UnderHost VPS
Your VPS typically has:
- Public IP: 1 assigned IP (e.g., 203.0.113.45)
- Default gateway: .1 address of your subnet (e.g., 203.0.113.1)
- Subnet mask: Usually /24 (255.255.255.0)
- Additional IPs: Can add more from your /24 range if needed
View your VPS network info
ip addr show # shows all IPs and subnet info
ip route show # shows routing and gateway
Private IP ranges (RFC 1918)
- 10.0.0.0/8: 10.0.0.0 - 10.255.255.255 (largest private range)
- 172.16.0.0/12: 172.16.0.0 - 172.31.255.255
- 192.168.0.0/16: 192.168.0.0 - 192.168.255.255 (common home networks)
Use these ranges for internal networking. Public IPs are needed only for external communication.
Related: Manage your VPS | Firewall rules
Need a Cloud VPS?
Launch an UnderHost Cloud VPS when you need root access, dedicated resources, custom software, or more control than shared hosting.





















