0

I'm trying to understand IP Addressing, but there's something what's still not clear for me.

With mask

1111111.1111111.1111111.00000000 (/24)

Am I able to set network address "freely" like this?

2.5.10.0

I'm asking because almost all courses which I found online give examples where network address (with /24 mask) starts with

192.168.1.x

And so I'm curious whether it's rule for setting network's IP address (mentioned above) or have I missed something.

Steve
  • 3
  • 1

1 Answers1

1

About subnet mask structure
I have seen some devices that accept a "free" subnet mask, but in practice, no, you can't do that.

Think of the subnet mask as a cursor you move left or right to divide a network in two part.

In IPv4 you have 32 bits, and you choose how many you assign to the host and how many to the network. This is more obvious when you use the "/" notation. A /24 network means there's 24 bits assigned to code the network address and the remaining 8 bits are assigned to code the host address.

That means in practice you dive your 32 bits in two addresses. It would be totally impractical to mix the bits from the two address, it would be the same as interleaving the letters from you town name and your street name on a regular paper mail.

Regarding Private IP addresses

Privates IP addresses you can use are defined by RFC1918 in which you will find:

  1. Private Address Space

    The Internet Assigned Numbers Authority (IANA) has reserved the
    following three blocks of the IP address space for private internets:

    10.0.0.0 - 10.255.255.255 (10/8 prefix)
    172.16.0.0 - 172.31.255.255 (172.16/12 prefix)
    192.168.0.0 - 192.168.255.255 (192.168/16 prefix)

So within those networks you can do whatever you want with the host part.

You should not use any other network as private IP address.

Note that there's also different IP addresses block reserved for examples and documentation; and some other blocks reserved for specific usage.

JFL
  • 19,649
  • 1
  • 32
  • 64
  • Okay, I understand that making subnet mask like 1111110.00110011.10101010.00000000 isn't possible. But is it possible to set my private network address with some random numbers? Let's work on this example where subnet mask is 255.255.255.0. Is it possible for me to set "random" numbers in host address part? Can I configure private network like 64.163.62.x or 88.61.63.x or 24.98.36.x (where x stands for users' part)? – Steve Dec 12 '19 at 08:54
  • @Steve see my edit – JFL Dec 12 '19 at 10:11