in reply to IP address generation

Some code you tried would also be appreciated, especially if you have already attempted it yourself, that way we can correct you, and you will learn something. (As opposed to just getting a solution and using it)

C.