Difference between revisions of "Help:Range blocks"
(wikipedia IW link) |
Old Hippie (talk | contribs) m (1 revision) |
Revision as of 14:11, 28 November 2008
Important note: When you edit this page, you agree to release your contribution into the public domain. If you don't want this or can't do this because of license restrictions, please don't edit. This page is one of the Public Domain Help Pages, which can be freely copied into fresh wiki installations and/or distributed with MediaWiki software; see Help:Contents for an overview of all pages. See Help:Copying for instructions. |
Range blocks are technical restrictions applied through Special:Blockip to a group of IP addresses that prevent them from editing, creating new accounts, sending email through the wiki interface, et cetera. Registered accounts editing from these IP addresses will also be blocked, unless you check the box to only block anonymous editors.
Range blocking is enabled on all Wikimedia wikis; to enable it on other wikis, add "{{ #ifeq:
moparwiki.com
| www.mediawiki.org
| $wgSysopRangeBans
| $wgSysopRangeBans
}} = true;
" in {{ #ifeq:
moparwiki.com
| www.mediawiki.org | LocalSettings.php | LocalSettings.php }}.
To block an IP range from Special:Blockip, enter the first IP address in the range followed by a forward slash and a Classless inter-domain routing (CIDR) suffix. You should avoid performing range blocks unless you understand what you are doing, or you may end up blocking tens of thousands of people who are not the problem!
Contents
Technical explanation
CIDR notation is written as the IP address, a slash, and the CIDR affix (for example, the IPv4 "10.2.3.41/24
" or IPv6 "a3:b:c1:d:e:f:1:21/24
"). The CIDR affix is the number of starting digits every IP address in the range have in common when written in binary.
For example: "10.10.1.32
" is binary "00001010.00001010.00000001.00100000
", so 10.10.1.32/27
will match the first 27 digits ("00001010.00001010.00000001.00100000
"). The IP addresses 10.10.1.32
–10.10.1.63
, when converted to binary, all have the same 27 first digits and will be blocked if 10.10.1.32/27
is blocked.
As the CIDR affix increases, the block affects fewer IP addresses (see table of example ranges). CIDR affixes are not the same for IPv4 addresses as they are for IPv6 addresses.
Calculating the CIDR affix
You can use the table of sample ranges below to guess the range, use a computer script, or manually calculate the range.
Conversion to binary
The first step in manually calculating a range is to convert the first and last IP address to binary representation. (This assumes you're not using a computer script, which can probably calculate the range for you anyway.) An IP address is composed of four groups of eight ones and zeros. Each group represents a number from 0 to 255. To convert a number to binary, you can use a reference table or know the value of each binary digit:
1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Proceeding from left to right, fill in '1' if the number is at least that value, and subtract that value (if it's not, fill in '0' and don't subtract). For example, to calculate 240:
- 240 is at least 128, so place 1 and subtract 128.
- 112 (240-128) is at least 64, so place 1 and subtract 64.
- 48 (112-64) is at least 32, so place 1 and subtract 48.
- 16 (48-32) is at least 16, so place 1 and subtract 16.
- Since the remaining value is zero, all the remaining places are '0'.
Thus, 240 is 1111 0000 because it can be represented as 128+64+32+16+0+0+0+0.
Calculate range
- Place both IP addresses one atop the other, and count how many starting digits are exactly alike. This is the CIDR affix.
- Double-check! Being off by one digit could extend your block by thousands of addresses.
The example below calculates the CIDR range between 69.208.0.0 and 69.208.0.255. Note that this is a simple example; some groups of IP addresses do not so neatly fit CIDR affixes, and need multiple different-sized blocks to block the exact range.
IP addresses: 69.208.0.0 69.208.0.255 Convert to binary: 0100 0101.1101 0000.0000 0000.0000 0000 0100 0101.1101 0000.0000 0000.1111 1111 Count identical first numbers: 0100 0101.1101 0000.0000 0000.0000 0000 0100 0101.1101 0000.0000 0000.1111 1111 |____________________________| 24 digits CIDR range: 69.208.0.0/24
Table of sample ranges
The table below shows the IP blocks each CIDR suffix affects. Note that MediaWiki only supports blocking CIDR suffixes 16–32.
CIDR | Start Range | End Range | Total addresses | Bits selected in IP address |
---|---|---|---|---|
69.208.0.0/0 | 0.0.0.0 | 255.255.255.255 | 4,294,967,296 | ********.********.********.******** |
69.208.0.0/1 | 0.0.0.0 | 127.255.255.255 | 2,147,483,648 | 0*******.********.********.******** |
69.208.0.0/4 | 65.0.0.0 | 79.255.255.255 | 268,435,456 | 0100****.********.********.******** |
69.208.0.0/8 | 69.0.0.0 | 69.255.255.255 | 67,108,864 | 01000101.********.********.******** |
69.208.0.0/11 | 69.208.0.0 | 69.238.255.255 | 2,197,152 | 01000101.110*****.********.******** |
69.208.0.0/12 | 69.208.0.0 | 69.223.255.255 | 1,048,576 | 01000101.1101****.********.******** |
69.208.0.0/13 | 69.208.0.0 | 69.215.255.255 | 524,288 | 01000101.11010***.********.******** |
69.208.0.0/14 | 69.208.0.0 | 69.211.255.255 | 262,144 | 01000101.110100**.********.******** |
69.208.0.0/15 | 69.208.0.0 | 69.209.255.255 | 131,072 | 01000101.1101000*.********.******** |
69.208.0.0/16 | 69.208.0.0 | 69.208.255.255 | 65,536 | 01000101.11010000.********.******** |
69.208.0.0/17 | 69.208.0.0 | 69.208.127.255 | 32,768 | 01000101.11010000.0*******.******** |
69.208.0.0/18 | 69.208.0.0 | 69.208.63.255 | 16,384 | 01000101.11010000.00******.******** |
69.208.0.0/19 | 69.208.0.0 | 69.208.31.255 | 8,192 | 01000101.11010000.000*****.******** |
69.208.0.0/20 | 69.208.0.0 | 69.208.15.255 | 4,096 | 01000101.11010000.0000****.******** |
69.208.0.0/21 | 69.208.0.0 | 69.208.7.255 | 2,048 | 01000101.11010000.00000***.******** |
69.208.0.0/22 | 69.208.0.0 | 69.208.3.255 | 1,024 | 01000101.11010000.000000**.******** |
69.208.0.0/23 | 69.208.0.0 | 69.208.1.255 | 512 | 01000101.11010000.0000000*.******** |
69.208.0.0/24 | 69.208.0.0 | 69.208.0.255 | 256 | 01000101.11010000.00000000.******** |
69.208.0.0/25 | 69.208.0.0 | 69.208.0.127 | 128 | 01000101.11010000.00000000.0******* |
69.208.0.0/26 | 69.208.0.0 | 69.208.0.63 | 64 | 01000101.11010000.00000000.00****** |
69.208.0.0/27 | 69.208.0.0 | 69.208.0.31 | 32 | 01000101.11010000.00000000.000***** |
69.208.0.0/28 | 69.208.0.0 | 69.208.0.15 | 16 | 01000101.11010000.00000000.0000**** |
69.208.0.0/29 | 69.208.0.0 | 69.208.0.7 | 8 | 01000101.11010000.00000000.00000*** |
69.208.0.0/30 | 69.208.0.0 | 69.208.0.3 | 4 | 01000101.11010000.00000000.000000** |
69.208.0.0/31 | 69.208.0.0 | 69.208.0.1 | 2 | 01000101.11010000.00000000.0000000* |
69.208.0.0/32 | 69.208.0.0 | 69.208.0.0 | 1 | 01000101.11010000.00000000.00000000 |
References
External links
- IP Address Ranges Block gives you complete IP ranges for certain country.
- Netmask calculator which helps in making the correct decision for range blocks.
- Rangeblock-Calculator gives you the range you should use when blocking.
Languages | Languages: |
English {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/af | • {{#if: Help:Range blocks|Afrikaans| Afrikaans}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/ar | • {{#if: Help:Range blocks|العربية| العربية}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/az | • {{#if: Help:Range blocks|azərbaycanca| azərbaycanca}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/bcc | • {{#if: Help:Range blocks|جهلسری بلوچی| جهلسری بلوچی}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/bg | • {{#if: Help:Range blocks|български| български}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/br | • {{#if: Help:Range blocks|brezhoneg| brezhoneg}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/ca | • {{#if: Help:Range blocks|català| català}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/cs | • {{#if: Help:Range blocks|čeština| čeština}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/da | • {{#if: Help:Range blocks|dansk| dansk}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/de | • {{#if: Help:Range blocks|Deutsch| Deutsch}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/el | • {{#if: Help:Range blocks|Ελληνικά| Ελληνικά}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/es | • {{#if: Help:Range blocks|español| español}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/fa | • {{#if: Help:Range blocks|فارسی| فارسی}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/fi | • {{#if: Help:Range blocks|suomi| suomi}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/fr | • {{#if: Help:Range blocks|français| français}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/gl | • {{#if: Help:Range blocks|galego| galego}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/gu | • {{#if: Help:Range blocks|ગુજરાતી| ગુજરાતી}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/he | • {{#if: Help:Range blocks|עברית| עברית}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/hu | • {{#if: Help:Range blocks|magyar| magyar}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/id | • {{#if: Help:Range blocks|Bahasa Indonesia| Bahasa Indonesia}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/it | • {{#if: Help:Range blocks|italiano| italiano}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/ja | • {{#if: Help:Range blocks|日本語| 日本語}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/ko | • {{#if: Help:Range blocks|한국어| 한국어}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/ksh | • {{#if: Help:Range blocks|Ripoarisch| Ripoarisch}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/mr | • {{#if: Help:Range blocks|मराठी| मराठी}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/ms | • {{#if: Help:Range blocks|Bahasa Melayu| Bahasa Melayu}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/nl | • {{#if: Help:Range blocks|Nederlands| Nederlands}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/no | • {{#if: Help:Range blocks|norsk| norsk}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/oc | • {{#if: Help:Range blocks|occitan| occitan}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/pl | • {{#if: Help:Range blocks|polski| polski}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/pt | • {{#if: Help:Range blocks|português| português}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/ro | • {{#if: Help:Range blocks|română| română}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/ru | • {{#if: Help:Range blocks|русский| русский}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/si | • {{#if: Help:Range blocks|සිංහල| සිංහල}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/sq | • {{#if: Help:Range blocks|shqip| shqip}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/sr | • {{#if: Help:Range blocks|српски / srpski| српски / srpski}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/sv | • {{#if: Help:Range blocks|svenska| svenska}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/th | • {{#if: Help:Range blocks|ไทย| ไทย}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/tr | • {{#if: Help:Range blocks|Türkçe| Türkçe}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/uk | • {{#if: Help:Range blocks|українська| українська}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/vi | • {{#if: Help:Range blocks|Tiếng Việt| Tiếng Việt}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/yue | • {{#if: Help:Range blocks|粵語| 粵語}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/zh | • {{#if: Help:Range blocks|中文| 中文}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/zh-hans | • {{#if: Help:Range blocks|中文(简体)| 中文(简体)}}|}} {{#ifexist: {{#if: Help:Range blocks | Help:Range blocks | {{#if: Help | Help:}}Range blocks}}/zh-hant | • {{#if: Help:Range blocks|中文(繁體)| 中文(繁體)}}|}} |