network range

  • Thread starter Thread starter yqyq22
  • Start date Start date
Y

yqyq22

hello,
Just a simple question, I would like to define a network address range.
How can i code this please?
10.0.0.0 - 10.255.255.255 (10/8 prefix)
172.16.0.0 - 172.31.255.255 (172.16/12 prefix)
192.168.0.0 - 192.168.255.255 (192.168/16 prefix)

thanks a lot
 
yqyq22 said:
hello,
Just a simple question, I would like to define a network address range.
How can i code this please?
10.0.0.0 - 10.255.255.255 (10/8 prefix)
172.16.0.0 - 172.31.255.255 (172.16/12 prefix)
192.168.0.0 - 192.168.255.255 (192.168/16 prefix)

If you treat each IP address as a 32-bit integer, MSB to LSB for each octet
in the IP address, then you get integers that order themselves just as you
are asking for.

Thus, your first desired range becomes 0x0a000000 to 0x0affffff, for
example.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top