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.