cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
716
Views
0
Helpful
10
Replies

Subnetting problem

vishalprashar
Level 1
Level 1

I don't know where exactly to start from. So instead, i will jump right on to the question.

Say you are being provided with 2 IP addresses, PC 1's IP address and PC 2's IP address, which are 17.4.4.2 and 14.2.3.2 respectively. You are required to find the subnet mask of these 2 PC's in such a way that both the PC's are in the same network.

Now my question to you is " is their any way (a decimal way) in which we can find a new subnet mask or prefix length for them. If this is all we are provided with"

PS: I know that there is a binary way in which you can find the prefix length or S.B mask, i want to know if there is any other way to find it.

10 Replies 10

chinkevi_2
Level 1
Level 1

if they are live pc with those ip configured, and if they support icmp mask reply, you can do icmp ping mask request. but this icmp type is not supported or turned off by pc, and pretty much only available in unix/linux system.

otherwise, your best bet is to ask whoever provided the ip to check and give you the mask.

I am sorry but my question is a total hypothetical one.. I just wanted to know is there a way in which we can find out the prefix mask theoretically.. Please let me know in case you are ware of any method apart from the binary one..

short answer is no.

Leo Laohoo
Hall of Fame
Hall of Fame

Nope.

As others stated you cannot tell a mask by simply looking at the ip address alone , at least if you were give a /9 or a /18 etc.. you can then know the prefix.. if this was a theory question to trick you I would probably place these ips in the class A network which falls under 1-to-126 therefore a /8 bit mask.

Regards

Jorge Rodriguez

iyde
Level 4
Level 4

Well, if the requirement is to decide what subnet mask to put on the IP addresses to make them both to be in the same subnet, then the only way is a kind of "binay decimal". By this I mean that certain numbers are relatively easily remembered as matching certain masks.

You have IP addresses 17.x.x.x and 14.x.x.x and from that we can figure out how the most specific mask is.

As one person mentioned, if you use a /8 you would cover all 1.x.x.x to 127.x.x.x.

If you the go for a /9, you'd cover 1.x.x.x to 63.x.x.x; a /10 will give 1.x.x.x to 31.x.x.x etc.

From that we end up with the fact that a /11 would give 1.x.x.x to 15.x.x.x or 16.x.x.x to 31.x.x.x - which will put your two IP adresses in different subnets.

So in short, you'd have to use a /10 mask in order to put them in the same subnet.

HTH

Ingolf

"As one person mentioned, if you use a /8 you would cover all 1.x.x.x to 127.x.x.x."

Not sure i follow this. If you use a /8 then you can only use one class A network so

14.2.3.2/8 and 17.4.4.2/8 are in different networks not the same. To get them in the same network you need to use less than 8 bits not more or have i misunderstood ie.

you can't use 252, 248 or 240 because this means that

14.2.3.2 falls in a different subnet than 17.4.4.2 ie,

252 means subnets go up in 4 so

0.0.0.0/6

4.0.0.0/6

8.0.0.0/6

12.0.0.0/6 -> 14.2.3.2 falls here

16.0.0.0/6 -> 17.4.4.2 falls here

248 -

0.0.0.0/5

8.0.0.0/5 -> 14.2.3.2

16.0.0.0/5 -> 17.4.4.2

240

0.0.0.0/4 -> 14.2.3.2

16.0.0.0/4 -> 17.4.4.2

224

0.0.0.0/3 -> 14.2.3.2 + 17.4.4.2

32.0.0.0/3

so all we can say for sure is that the mask would have to be either

224.0.0.0

192.0.0.0

128.0.0.0

all of the above 3 subnet masks would allow 14.2.3.2 and 17.4.4.2 to be in the same subnet but none others as far as i can see.

Have i got this wrong ?

Jon

In fact John you are the only person who has got it right till yet.. I wanted to know is there any way, or is there any hard and fast rule that can be applied to this kind of problem.

I really need to know if there is any way, using the decimal numbers, in which these kind of problems can be solved.

Vishal

Vishal

As the others have said there is no way from just having 2 ip addresses to say what the subnet mask would be.

All i did was rule out what it couldn't be but with those 2 addresses there are still 3 possible masks ie.

224.0.0.0

192.0.0.0

128.0.0.0

and it's not possible to say which one it is.

Jon

May be this can help:

If you see you have an ip starting in 14.X.X.X and another starting in 17.X.X.X, and you want them in the same subnet you have to figure out a range of addresses in which this addresses can fall.

Range starting in 0 to 7 - Doesn't contain the addresses.

Range starting in 0 to 15 - Contains only address starting in 14 but not the 17.

Range starting in 0 to 31 - Contains both addresses (14 and 17). So, from 0 to 31 you have 32 numbers. Subtract that number from 256 and you get 224. So 224 would be the exact mask you would need that contains addresses 14 and 17. But as John said.... masks 198 and 128 also can contain the 2 addresses.

Review Cisco Networking products for a $25 gift card