N
NetworkElf
Hi all,
Does anyone have some code that shows an example of how to loop through a
range of IP addresses? I'm using text boxes to get a start and end value for
the range. I was thinking about using 4 nested for-next loops, but I seem to
be having trouble working out the logic to validate the octets in the
beginning and ending address so the range works correctly.
i.e. 172.16.1.1/172.20.1.1 should loop 172-172,16-20,1-254,1-254
172.16.1.1/172.16.1.254 should loop 172-172,16-16,1-1,1-254
172.16.1.5/172.16.1.15 should loop 172-172,16-16,1-1,5-15
and so on...
Is there an easier way to do this without for-next loops?
Thanks,
ne.
Does anyone have some code that shows an example of how to loop through a
range of IP addresses? I'm using text boxes to get a start and end value for
the range. I was thinking about using 4 nested for-next loops, but I seem to
be having trouble working out the logic to validate the octets in the
beginning and ending address so the range works correctly.
i.e. 172.16.1.1/172.20.1.1 should loop 172-172,16-20,1-254,1-254
172.16.1.1/172.16.1.254 should loop 172-172,16-16,1-1,1-254
172.16.1.5/172.16.1.15 should loop 172-172,16-16,1-1,5-15
and so on...
Is there an easier way to do this without for-next loops?
Thanks,
ne.