2

Possible Duplicate:
How does Subnetting Work?

I have started my CCNA course. I wanted to get clarified on this question. can two machines have the same public address with the subnet masks(i.e network address) different. Since 115.215.3.6/24 is not equal to 115.215.3.6/30. Then how come when I can ping an ip address without specifying the subnet mask?

0

3 Answers 3

3

Netmask define set of hosts that are accessible to each other directly, without routing. Bigger subnet /24 include smaller /30 as subset but also that means, that in bigger subnet /24 all hosts can see each other and that drive to the adress-conflict.

10

No, two hosts cannot have the same address. Nope, nope, nope.

3
  • 1
    No matter what subnet is in use, it is still the same IP, so Sirch is totally right.
    – Frederik
    Jul 17, 2012 at 15:08
  • That not always correct. At least, many hosts has the same addresses from RFC1918. But that only possible if that hosts are not accessible to each other without NAT or else.
    – Kondybas
    Jul 17, 2012 at 15:18
  • 4
    Well, two hosts can have the same IP address, technically. There's even a a name for it - "IP address conflict." :) Jul 17, 2012 at 18:58
4

You seem to be confused on a fundamental level about what a subnet is. See DanBig's comment. And Sirch's answer. And Kondybas' answer too.

I'll try to give you a bit more of a fundamental explanation about what you're doing wrong to even arrive at your question.

And since I don't like your examples (it doesn't make a whole lot of sense to use 115.215.3.6/30 or 115.215.3.6/30, and I don't think those are legal subnets either), I'm going to give my own.

First of all, 123.123.123.0/24 is NOT an IP address. It is a subnet. Therefore, do not treat it as an ip address, and just plug any number you feel like into the last octet. It designates the 24 bit subnet (class C subnet) begining at 123.123.123.0 As it's a full class C, it encompasses all 256 IPs starting with 123.123.123. So you could say it means "the subnet comprising all IP addresses between 123.123.123.0 and 123.123.123.255."

When only dealing with class C subnets, the last octet of the IP may seem trivial, but it's not. Say you have a /27 subnet, for example. This would be a 32 host subnet, for anyone whose binary math is a bit rusty. If you were given a /27 subnet by your ISP, and had 32 externally facing IP addresses somewhere on 123.123.123, it might be useful to know the actual range you're allocated, not just that you have 32 IP addresses allocated somewhere in that range. Right? Well, that's where the last octet of the IP address makes a difference. It designates that you have however many available IP addresses, starting at that last octect.

So, 123.123.123.0/27 would give you 123.123.123.0 through 123.123.123.31, whereas 123.123.123.96/27 would give you 123.123.123.96 through 123.123.123.127. And so on.

As previously mentioned, a much more in depth explanation is here.

Not the answer you're looking for? Browse other questions tagged .