Subnet Containment Checker
Check if an IP address is contained within a subnet
What is Subnet Containment?
Subnet containment determines whether an IP address belongs to a specific subnet. This tool checks if an IP address falls within the range defined by a subnet's network address and subnet mask. It supports both IPv4 and IPv6 addresses with CIDR notation and provides a visual breakdown of the binary logic used in the calculation.
Understanding Subnet Containment
How does subnet containment work?
Binary AND operation: To check if an IP is in a subnet, we perform a bitwise AND operation between the IP address and the subnet mask, then compare the result with the network address.
Example: IP 192.168.1.100 in subnet 192.168.1.0/24
Logic: (IP & Mask) == Network Address
IPv4 vs IPv6
IPv4: 32-bit addresses with dotted decimal notation (e.g., 192.168.1.1)
IPv6: 128-bit addresses with hexadecimal notation (e.g., 2001:db8::1)
CIDR: Both use CIDR notation (/24 for IPv4, /64 for IPv6)
Common subnet examples
IPv4 subnets:
- /24: 192.168.1.0/24 (256 addresses)
- /16: 10.0.0.0/16 (65,536 addresses)
- /8: 172.16.0.0/8 (16.7M addresses)
IPv6 subnets:
- /64: 2001:db8::/64 (standard subnet)
- /48: 2001:db8::/48 (site prefix)
Practical applications
Network administration:
- Firewall rule configuration
- Access control lists (ACLs)
- Network troubleshooting
- IP address planning
- Security policy enforcement