1

How would I add 0.0.15.255 to 172.1.6.255, talking about IPv4 networks here. I have done things like 192.168.1.15 plus 0.0.1.30 to be 192.168.2.45. but when it goes over the limit of 255, I just do not now how to do this... Help?

link to full question:

https://cs.stackexchange.com/questions/51011/how-would-i-add-0-0-15-255-to-172-1-6-255/51012#51012

I cant use special symbols here..

  • What specifically are you doing that you want to add these two numbers? – Ron Maupin Dec 21 '15 at 19:08
  • 2
    Your question doesn't quite make sense. What exactly are you trying to do? – Ron Trunk Dec 21 '15 at 19:10
  • basic subnetting – Bozo Vulicevic Dec 21 '15 at 19:10
  • Also, I see you are cross posting this on multiple SE sites. That is not the right thing to do. Pick one site, and delete the questions on the others. – Ron Maupin Dec 21 '15 at 19:10
  • Keen eye. Didnt know where it would stick, I will delete the rest – Bozo Vulicevic Dec 21 '15 at 19:11
  • This has nothing to do with basic subnetting. – Ron Maupin Dec 21 '15 at 19:11
  • How about sub netting in general? Im studying this in another language so it is a bit difficult to get point across – Bozo Vulicevic Dec 21 '15 at 19:12
  • Basically, I am to assign IP adresses to subnetworks based on there needed demands host wise. I am told that the first subnetwork has this long 172.... adress and am to add this many hosts onto it. Then the next subnetwork would have to have an adress one above the broadcast adress of this previous one. Does that make sense ? – Bozo Vulicevic Dec 21 '15 at 19:15
  • 1
    Besides the way I showed you, you could add `1` to the broadcast address. Seriously, do it in binary or you will end up like you are now with a bad method. An IP address is just a 32-bit binary number, and so is a mask. It's really just simple binary math. – Ron Maupin Dec 21 '15 at 19:29
  • There are many examples of how to subnet on this forum. Just search on "subnetting"and you will have many examples. – Ron Trunk Dec 21 '15 at 19:31
  • You already asked this on CS and got an answer, as well as I answered your question. You don't cross post to multiple SE sites just because you don't like or can't understand the answer. – Ron Maupin Dec 21 '15 at 19:49
  • I think that I just dont know how to ask what im looking for because I didnt learn it in english – Bozo Vulicevic Dec 21 '15 at 19:58
  • The way I understand it, you want to get the next subnet. You can add `1` to the bit position of the subnet (20th bit in my example), or you can add `1` to the broadcast address of the subnet you have. You are going about this completely wrong, and you should forget what you are trying to do. You need to do this in binary since IP math is binary math. If you continue to try to do this as you are, you will never get a correct answer. – Ron Maupin Dec 21 '15 at 20:36

1 Answers1

1

With basic subnetting, you take an address and mask, convert both to binary, and AND the two together to get a subnet.

For example, 172.1.5.255/20:

Address 172.1.5.255 = 10101100.00000001.00000101.11111111
Mask 255.255.240.0  = 11111111.11111111.11110000.00000000
                      ===================================
Subnet              = 10101100.00000001.00000000.00000000

Convert it back to decimal, and you have your subnet. Then you can add 1 in the 20th bit to get the next subnet, etc.

Ron Maupin
  • 98,218
  • 26
  • 115
  • 191