Author Topic: IP address format  (Read 188 times)

frankb

  • Newbie
  • *
  • Posts: 2
    • View Profile
IP address format
« on: July 27, 2010, 08:05:57 AM »
Hi, I don't understand the CIDR format for IP addresses. What is the correct notation if I want to exclude the range 117.206.194.* or 117.208.166.*?

Thank you

camu

  • Administrator
  • Full Member
  • *****
  • Posts: 113
    • View Profile
Re: IP address format
« Reply #1 on: July 27, 2010, 10:28:15 AM »
Hi Frank,

the last "group" of numbers is masked by adding /24 to your IP's:

117.206.194.0/24 or 117.208.166.0/24

In general, the first group weights 8, the second 16, the third 24:

  • 117.0.0.0/8 would filter all the IP addresses that start with 117
  • 117.206.0.0/16 would filter all the IP addresses that start with 117.206
  • 117.206.194.0/24 would filter all the IP addresses that start with 117.206.194

The nice thing about CIDR is its flexibility, because you can filter smaller ranges of address, as needed. Let's say you want only filter from 117.206.194.12 to 117.206.194.15. In CIDR you would write 117.206.194.12/30. This is the reason why I decided to adopt this format for WP SlimStat :)

Hope this helps,
Camu.


frankb

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: IP address format
« Reply #2 on: July 27, 2010, 11:21:22 AM »
Thank you for the quick answer! That's very helpful.  :)

Perhaps you might want to include your explanation (or a link to this thread) on the Filters tab in the next version.

Cheers

camu

  • Administrator
  • Full Member
  • *****
  • Posts: 113
    • View Profile
Re: IP address format
« Reply #3 on: July 27, 2010, 01:19:32 PM »
Good point, I will add it to the next release!

herman

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: IP address format
« Reply #4 on: August 01, 2010, 06:13:31 PM »
Sorry for breaking in......
If I want to filter a single IP, say 77.167.160.56, do I have to add /32 or is just the IP sufficient?

TIA,

Herman.
Enjoy!

Herman.

camu

  • Administrator
  • Full Member
  • *****
  • Posts: 113
    • View Profile
Re: IP address format
« Reply #5 on: August 02, 2010, 02:57:25 AM »
Hi Herman,

good question. You can either specify just the IP address, or use the corresponding CIDR notation, adding /32 after the IP. WP SlimStat is 'smart' enough to understand both, in this specific case.

herman

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: IP address format
« Reply #6 on: August 02, 2010, 04:27:57 PM »
Hi Camu,

Thanks for answering.
It is good to have a plug-in with active support.
Please keep up the good work!
Enjoy!

Herman.

camu

  • Administrator
  • Full Member
  • *****
  • Posts: 113
    • View Profile
Re: IP address format
« Reply #7 on: August 02, 2010, 05:18:20 PM »
Sure, it's a pleasure. Even if a little donation would help keeping the good work up :D

herman

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: IP address format
« Reply #8 on: August 02, 2010, 05:58:35 PM »
Even if a little donation would help keeping the good work up :D
Quote
and to buy some food for my hungry family.
;D ;D How can I refuse that?  ;D ;D
Enjoy!

Herman.