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
  • 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
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.

| improve this answer | |
  • I know this, thanks anyway. But I added more details onto my question, as to what I am looking for. – Bozo Vulicevic Dec 21 '15 at 19:18
  • What you are doing is wrong. If you know what I answered, then you know how to do it correctly. Why do you want to do it wrong? – Ron Maupin Dec 21 '15 at 19:20

Not the answer you're looking for? Browse other questions tagged or ask your own question.