How to find CIDR subnet for a public Internet IP address?

10,638

If you want to whitelist one specific IP address, then express it as

1.2.3.4/32

However, you're not clear as to whether your home IP address is static or dynamic. If the latter, you'll have to ask your ISP for the ranges of addresses it could allocate from. There may be several discontiguous ranges of different sizes that have been acquired as the ISP has grown.

To answer your specific question: no, you cannot assume that every block out there is a /24. You may be able to guess from a whois lookup of an address in the block, but that will just give you the size of the block allocated to that organisation, and tells you nothing about how it's segmented internally. Only your ISP will know that.

Share:
10,638

Related videos on Youtube

Howard
Author by

Howard

Updated on September 18, 2022

Comments

  • Howard
    Howard almost 2 years

    Usually I do not worry about subnet of an IP address on the public Internet, but after I began using Amazon EC2 firewall, it got me thinking.

    EC2 firewall configuration requires an IP to be written in CIDR form, if I want to whitelist my home IP (say it is reachable as 1.2.3.4 from public Internet), EC2 firewall config page correctly guesses my home IP 1.2.3.4, and suggestes that CIDR subnet is /24.

    Is /24 the magic number of CIDR subnet of any public Internet IP address?