UnderHost
Knowledgebase Docs

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)

CIDRMaskHostsUse
/30255.255.255.2524Point-to-point links
/28255.255.255.24016Small LANs
/27255.255.255.22432Medium LANs
/24255.255.255.0256Standard LAN
/23255.255.254.0512Large LAN
/22255.255.252.01,024Very 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

Was this article helpful?

Need a Cloud VPS?

Launch an UnderHost Cloud VPS when you need root access, dedicated resources, custom software, or more control than shared hosting.

Related articles

Back to Cloud VPS