Jump to content

function - IP plan


TWE3K

Recommended Posts

Hi, I need to make an IP plan

for explanation gives an example:

 

I have as IP 192.168.0.0

 

user completes it wants in any network guests .. I can adjust it to the nearest power of 2 and there is my example:

8,16,32,64,128,256,512,1024,2048 and so on ..

 

Now I can sort the values ​​from largest to smallest

for example: 2048,64,32

 

I have these values ​​saved in ARRAY and now I need to create a FUNCTION that will do this

The first value in the array is 2048 it means that

network address is:

192.168.0.0 - 192.168.7.255

 

the next value in the array is 64

network address is:

192.168.8.0 - 192.168.8.63

 

the next value in a field of 32

network address is:

192.168.8.64 - 192.168.8.95

 

I  need to calculate:

1. Network address

2. Broadcast

 

Anyone knows what function create this calculated? Thank you very much for any assistance.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.