Options

Help with Private Addressing and Subnetting

gojira1019gojira1019 Registered Users Posts: 9 ■□□□□□□□□□
Hello,


I am new to the networking world, and I figured I would ask on here in hopes one of you could help me out with something. I have been through some Cisco courses, but the one thing that confuses me beyond belief is the idea of private addresses and subnetting. I have been looking over our network documentation and I am seeing that we have subnets with 192.168.22.0/24, 192.168.22/23, 192.168.20.24, etc. I guess I am just confused as to how these subnets were created and what they were created from? I just need some help understanding the basics of how to subnet within private address blocks. In my classes the only subnetting I have really done is VLSM with changing a 192.160.10.0/24 network into something like a /25, /26. My teachers did not do a real good job teaching the concept of private addresses, and I am wondering if anyone could offer some guidance?

Comments

  • Options
    networker050184networker050184 Mod Posts: 11,962 Mod
    Private IPs can be subnetted however you want them to be. They're for private use! So how your company came about using those particular subnets within the RC1918 space is pretty hard to answer.
    An expert is a man who has made all the mistakes which can be made.
  • Options
    gojira1019gojira1019 Registered Users Posts: 9 ■□□□□□□□□□
    Well I guess I am confused because can you literally just pluck an address range from the usable address blocks and call it a subnet? I think I just got really confused because as I said above, the only subnetting I have dealt with is using getting a network address and subnetting it using VLSM to fit a scenario. I am also confused by the /23. I know that offers up to 510 usable hosts, but how does that actually affect the networking bits side of it?
  • Options
    networker050184networker050184 Mod Posts: 11,962 Mod
    Within reason, yes you can pick whatever you want. It still has to line up on bit boundaries.

    Regardless of the length of the mask the network and host bits work the same.
    An expert is a man who has made all the mistakes which can be made.
  • Options
    gojira1019gojira1019 Registered Users Posts: 9 ■□□□□□□□□□
    Okay, could you possibly explain to me how a /23 would look like in terms of host bits for this network: 192.168.22.0/23? Would this be 192.168.22.1-255 then 192.168.23.1-255?
  • Options
    rob42rob42 Member Posts: 423
    Using this example…

    Network ID 192.168.10.0/24

    The ‘10’ is in the 3rd Octet and is 00001010, this means that you can use the least significant bit (bit zero) for hosts by using a /23 mask, effectively making the 3rd Octet just 7 bits long (0000101) so far as the Network ID is concerned and giving you an extra bit (a most significant bit) for your host IDs.

    That’s also true of 192.168.22.0, because ‘22’ is 00010110, again bit zero is not being used for the Network ID.

    It’s always easier (IMHO) to examine things from the binary perspective as it becomes much easier to ‘see’ what’s going on.
    No longer an active member
  • Options
    rob42rob42 Member Posts: 423
    The /24 mask gives you 2^8 (bits) = 256 - 2 = 254 hosts.

    The /23 mask gives you 2^9 (bits) = 512 - 2 = 510 hosts.
    No longer an active member
  • Options
    gojira1019gojira1019 Registered Users Posts: 9 ■□□□□□□□□□
    Okay, got it. Thank you for that, that helped a lot. You definitely just made that lightning bulb go of in my head. Also just for a reminder the reason you minus 2 host addresses is because you have the .1 dedicated the gateway and the .255 dedicated to the broadcast address correct?
  • Options
    rob42rob42 Member Posts: 423
    Bang on! icon_cool.gif
    No longer an active member
  • Options
    gojira1019gojira1019 Registered Users Posts: 9 ■□□□□□□□□□
    Awesome. It all makes sense now, that I look at it in the binary sense. Thanks again.
  • Options
    gojira1019gojira1019 Registered Users Posts: 9 ■□□□□□□□□□
    I was getting confused originally because I did not see how their could be over the number 255 in the fourth octet.
  • Options
    rob42rob42 Member Posts: 423
    You’re right, you can’t have a dec number higher than 255 (11111111) as you only have 8 bits; one Octet is 8 bits, that’s it.

    B.t.w, you probably know this, but for anyone reading this thread for whom this is all very new, don’t assume that a broadcast address has to end in 255, rather, know that it’ll be always one address lower than the last usable host address.

    All the best with your studies.
    No longer an active member
  • Options
    gojira1019gojira1019 Registered Users Posts: 9 ■□□□□□□□□□
    Yeah I know that it doesn't need to be just good practice. But wait I am confused again. If there were 510 hosts wouldn't the last octet go up to that then? I am sorry if these are dumb questions.
  • Options
    PristonPriston Member Posts: 999 ■■■■□□□□□□
    192.168.22.0/23 - 192.168.22.0 - 192.168.23.255
    192.168.22.0 - network address
    192.168.22.1 - 1st host address
    192.168.22.2 - 2nd host address
    192.168.22.254 - 254th host address
    192.168.22.255 - 255th host address
    192.168.23.0 - 256th host address
    192.168.23.1 - 257th host address
    192.168.23.254 - 510th host address
    192.168.23.255 - broadcast address

    9 host bits
    h . hhhh hhhh
    0 . 0000 0000 makes it .22.0
    0 . 1111 1111 makes it .22.255 (this is not a broadcast address because the host bits are not all 1s)
    1 . 0000 0000 makes it .23.0 (this is not a network address because the host bits are not all 0s)
    1 . 1111 1111 makes it .23.255
    A.A.S. in Networking Technologies
    A+, Network+, CCNA
  • Options
    rob42rob42 Member Posts: 423
    gojira1019 wrote: »
    Yeah I know that it doesn't need to be just good practice. But wait I am confused again. If there were 510 hosts wouldn't the last octet go up to that then? I am sorry if these are dumb questions.


    Not at all.

    You're correct: Network masks of /2 to /24 will give you a broadcast of 255 in the last octet. It’s only when you have a mask of between /25 and /30 that you’ll need to watch out for that little pitfall.
    No longer an active member
  • Options
    gojira1019gojira1019 Registered Users Posts: 9 ■□□□□□□□□□
    May I ask what you mean by that little pitfall? I think I know what you mean, but I would like to make sure.
  • Options
    gojira1019gojira1019 Registered Users Posts: 9 ■□□□□□□□□□
    Thank you, this is what I originally thought. Thanks for clarifying!
  • Options
    rob42rob42 Member Posts: 423
    gojira1019 wrote: »
    May I ask what you mean by that little pitfall? I think I know what you mean, but I would like to make sure.

    Sorry, I mean the pitfall that I fell into in assuming that because it’s a broadcast address, the last octet has to end with 255. It’s an easy mistake (or assumption) to make for anyone new to the subject.
    No longer an active member
  • Options
    routingsparksroutingsparks Member Posts: 9 ■□□□□□□□□□
    gojira1019 wrote: »
    Okay, got it. Thank you for that, that helped a lot. You definitely just made that lightning bulb go of in my head. Also just for a reminder the reason you minus 2 host addresses is because you have the .1 dedicated the gateway and the .255 dedicated to the broadcast address correct?

    Just to clarify this though. The reason you subtract two IP addresses from the usable is for your network ID and your broadcast IP. So for example 192.168.22.0/24 would have a network ID of 192.168.22.0 and a broadcast of 192.168.22.255. From what I understand your default gateway can be set for any IP address although it's normally the first usable IP address, but that can change from site to site. Someone please chime in if I'm wrong.
  • Options
    HondabuffHondabuff Member Posts: 667 ■■■□□□□□□□
    gojira1019 wrote: »
    Hello,


    I am new to the networking world, and I figured I would ask on here in hopes one of you could help me out with something. I have been through some Cisco courses, but the one thing that confuses me beyond belief is the idea of private addresses and subnetting. I have been looking over our network documentation and I am seeing that we have subnets with 192.168.22.0/24, 192.168.22/23, 192.168.20.24, etc. I guess I am just confused as to how these subnets were created and what they were created from? I just need some help understanding the basics of how to subnet within private address blocks. In my classes the only subnetting I have really done is VLSM with changing a 192.160.10.0/24 network into something like a /25, /26. My teachers did not do a real good job teaching the concept of private addresses, and I am wondering if anyone could offer some guidance?

    All subnetting does is make "operational block sizes". A /25 gives you 2 block sizes of 128. The 0-127 block can not talk to the 128-255 block unless its routed. The subnet mask 255 sets the boundry and the non 255 sets the block size. So a 255.255.255.240 on a 192.168.1.0 network tells you that the 1st three octets will be 192.168.1.X then the 240 tells you block sizes of 16. 192.168.1.0-192.168.1.15, Then 192.168.1.16-192.168.1.31 and so on. These are the operation block sizes for hosts set because you chopped up the network into smaller broadcast domains or block sizes. The interesting octet can only be block sizes of 128/192/224/240/248/252/254. Take 256 minus the interesting octet and there's your block size. 256 -240= 16. Just remember the 1st digit is network ID and last is broadcast.
    “The problem with quotes on the Internet is that you can’t always be sure of their authenticity.” ~Abraham Lincoln
  • Options
    R9 290XR9 290X Member Posts: 10 ■□□□□□□□□□
    Just think of it this way, for Private IP address:

    Class A network:
    Private IP Network: 10.0.0.0
    Number of Networks: 1

    Class B network:
    Private IP Network Range: 172.16.0.0 - 172.31.0.0
    Number of Networks: 16

    Class C Network:
    Private IP Network Range: 192.168.0.0 - 192.168.255.0
    Number of Networks: 256.
Sign In or Register to comment.