Subnetting

Nelson2027Nelson2027 Member Posts: 2 ■□□□□□□□□□
Which subnet does host 172.29.187.129 255.255.254.0 belong to?

Comments

  • Info_Sec_WannabeInfo_Sec_Wannabe Member Posts: 428 ■■■■□□□□□□
    You can check it here - https://cidr.xyz

    There are also other subnet calculators online you can use. However, if you are preparing for Net+, I suggest you understand the theory behind it.
    X year plan: (20XX) OSCP [ ], CCSP [ ]
  • kaijukaiju Member Posts: 453 ■■■■■■■□□□
    edited March 2022
    Flip the bits!
    Translates to everything to binary. You will see you only have to deal with the last bit in the subnet mask.

    172.29.187.129  =  10101100.00011101.10111011.10000001
    255.255.255.254 = 11111111.11111111.11111111.11111110

    Bits in the IP address that correspond to the "1" bits in the subnet mask cannot change so concentrate on the last octet.

    The first 7 bits in the last octet are locked because of the corresponding "1" bits in the mask. Flip the last bit to "0" to get the subnet IP (first ip):
    (1000000)1
    (1111111)0
    -------------
    10000000 = 128

    Flip the last bit to "1" to get the last IP:
    10000001=129

    Since this is a /31 for a point to point connection(p2p), you will not see the normal subnet and broadcast IP.

    If the subnet mask was a /30 you would have seen four IPs: subnet IP, two usable IPs and a broadcast IP.
    (100000)01  = 129
    (111111)00 = 252

    Flip the last two bits to "0" and you get a subnet ip of .128
    10000000

    Flip the last two bits to "1" and you get a broadcast ip of 131
    10000011

    With two usable IP of .129 and .130 (.10000001 and .10000010).

    /30 and /31 are used for p2p connections with the /31 being used when IP space is scarce.




    Work smarter NOT harder! Semper Gumby!
Sign In or Register to comment.