PDA

View Full Version : Does anyone know about subnetting?



Man Sauce
09-22-2008, 02:04 PM
I am having problems trying to figure this stuff! This is a question I had I have no idea how they got this answer.

A router interface has been assigned an ip address of 172.16.192.166 with a mask of 255.255.255.248 which subnet does the ip address belong to.

This is the answer = 172.16.192.160

Any help would be appreciated or any tips on how to figure this stuff out.
Thanks

fatsack
09-22-2008, 04:29 PM
http://jodies.de/ipcalc

Man Sauce
09-22-2008, 04:40 PM
Thanks but I already saw that I want to learn how to do it by hand.

ElNono
09-22-2008, 09:05 PM
Do you know anything about numbers in base 2 (binary)?
If you don't, go read. While you're at it, read up on boolean operations too (and, or, xor, etc).
If you do know, then the operation is simple:

subnet = ip address & mask (where & is the AND boolean operation)

For example:

IP: 172.16.192.166 (binary: 10101100.00010000.11000000.10100110)
MASK: 255.255.255.248 (binary: 11111111.11111111.11111111.11111000)

10101100.00010000.11000000.10100110
AND
11111111.11111111.11111111.11111000
EQUALS
10101100.00010000.11000000.10100000

10101100.00010000.11000000.10100000 = 172.16.192.160 (the subnet)

Man Sauce
09-22-2008, 10:16 PM
Yeah I know about binary and the boolean operations, but this does help understand what to do I had no idea where to start but I see now. Thanks I really appreciate it. Can you answer this how can you tell which subnetted address is a valid host address? Thanks again.

ElNono
09-22-2008, 11:30 PM
Yeah I know about binary and the boolean operations, but this does help understand what to do I had no idea where to start but I see now. Thanks I really appreciate it. Can you answer this how can you tell which subnetted address is a valid host address? Thanks again.

I'm not sure I understand the question. Can you be more specific?
The way this work is that the mask determines what is your 'local' network, that is, what nodes in the network are accesible directly without requiring a router/gateway.

As far as how many valid ips are in a subnet, well, that depends on the mask.

baseline bum
09-22-2008, 11:41 PM
EDIT: Aw hell... I was answering El Nono's question.

Man Sauce
09-24-2008, 10:03 PM
Well this is what I meant if given these addresses which are valid host addresses?
172.16.4.127/26
172.16.4.155/26
172.16.4.193/26
172.16.4.95/27
172.16.4.159/27
172.16.4.207/27
The answer is the 2, 3 and 6
I just don't understand why it's those 3. Thanks.