Which Subnet Am I In
Lesson 25 of 46 in Coddy's IP Addressing and Subnetting course.
The most common exam and real-life question: given an address and a prefix, which subnet does it belong to? With the block size trick it takes seconds.
Take 192.168.1.150/26. Block size 64, boundaries 0, 64, 128, 192. The last octet 150 falls between 128 and 192, so the subnet is 192.168.1.128 and its broadcast is one short of the next boundary: 192.168.1.191.
Find the boundary at or below the address; that is always the network.
Challenge
BeginnerThe machine 192.168.1.150/26: print its network address, then its broadcast address, each on its own line.
Expected output:
192.168.1.128
192.168.1.191Try it yourself
All lessons in IP Addressing and Subnetting
10Capstone - The Office
The Floor PlanSizing Each TeamCarving the BlockThe Router's ViewRecap - Ship the Plan6Subnetting Drills
The Block Size TrickWhich Subnet Am I InSplitting a /24Splitting AgainRecap - Subnetting DrillsPractice on your own: Terminal playground