I have to subnet a network from a single class C IP address.
I have figured out the subnet mask and the broadcast address (I'm using subnet mask /28) but don't understand how to get the gateway address.
Can anyone help me?
If subnet mask is 255.255.255.248 then number of masked bit will be 5, hence number of subnets = 2. The power number of masked bits = 2 the power 5 = 32 subnets, and the number of hosts per subnets = 2. The power (unmasked bit or 32- total number of network bits) = 2 the power (32-29) = 8 host/subnet.
Hence:
1) IP's in subnet-1 will be from 192.168.1.0 to 192.168.1.7 where 192.168.1.0 will be subnet id and 192.168.1.7 will be broadcast id.
2) IP's in subnet-2 will be from 192.168.1.8 to 192.168.1.15
and so on............
The gateway is only one for a network i.e. the first IP address of that network.
This post is almost 8 years old, but in case someone wanders across this, I wanted to fix a few issues with the top voted comment. I would've commented directly, but I literally just started this account, so I don't have the authority to do that.
The purpose of the mask is that is shows which bits within a network can and can't change. 240 in binary = 1111 0000. This means the first 4 msb in the last value cannot change AND be in the same network.
So let's say your network address is 192.168.1.0/28. Write the last decimal value (0) out in binary with 8 bits. 0000 0000. Since 240 comes out to 1111 0000, the first 4 bits must remain unchanged in order to be subnets on the same network.
From here, subnets and hosts are determined by the last 4 bits. You can have 2 subnets with 6 hosts/subnet or 4 subnets with 2 hosts/subnet. Say you're going with the first option. The last decimal in the address (0) has this notation. MMMM SHHH
Looking at some values with the mask
As we see, binary 16 would change a bit within the mask. Once a bit covered by the mask is changed, you're in a different network.
So the final breakdown would be
1) IP's in subnet-1 = 192.168.1.1 to 192.168.1.6 where 192.168.1.0 will be subnet id and 192.168.1.7 will be broadcast id.
2) IP's in subnet-2 = 192.168.1.9 to 192.168.1.14 where 192.168.1.8 will be subnet id and 192.168.1.15 will be broadcast id.
Once again, I don't expect much traction on an 8 year old post, but if someone happens across this like I did, I don't want them to get confused with the wrong information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With