in reply to Generation of sequential IP addresses for Class B network

Not able to generate for a nuber greater than 254.

Why not? All you do is put number of ip addresses into a variable ... and you're programming :)

  • Comment on Re: Generation of sequential IP addresses for Class B network

Replies are listed 'Best First'.
Re^2: Generation of sequential IP addresses for Class B network
by perlpal (Scribe) on Jun 24, 2009 at 09:14 UTC
    Because the programming logic needs to implement the following for ip address numbers greater than 254 say 500:

    When the first 254 ip addresses are generated, the third octet should be incremented by 1 once and fourth octet should be reset to 1 and increment by 1 till it reaches 254.Ans this pattern should continue.

    Looking for a script to do the same.

      This site is not a script writing service. You are supposed to do some programming and problem solving yourself.

      What have you tried to increase the third octet by 1 whenever the fourth octet reaches 254 and there are still IP addresses to be generated? It sounds to me as if nested loops would help you here, or simply treating an IP address as one number of four "digits" that go from 0 to 255 instead of treating it as four separate numbers.