Template:Blockcalc
![]() | 此模板使用Lua语言: |
概要编辑
输入多个IPv4或IPv6地址,本模板可计算最小的CIDR区段。本模板模仿时常无法使用的IP段封禁计算器的功能。
參數及使用方法编辑
{{blockcalc|IP address1|IP address2|IP address3|...}}
By default, block sizes from /16 to /32 are checked.{{blockcalc|IP address1|IP address2|IP address3|...|size=from}}
The starting size (16 by default) can be set.- In addition, an argument can be a list of IP addresses, one IP address per line.
範例编辑
The following can be previewed in a sandbox.
{{blockcalc| 192.168.253.123 192.168.251.15 192.168.249.15 192.168.249.255 192.168.251.15 192.168.254.15 192.168.255.249 192.168.250.15 192.168.251.15 }}
The result of the preview is:
Sorted 7 IPv4 addresses (after omitting some duplicates):
- 192.168.249.15
- 192.168.249.255
- 192.168.250.15
- 192.168.251.15
- 192.168.253.123
- 192.168.254.15
- 192.168.255.249
Total affected |
Affected addresses |
Given addresses |
Range | Contribs |
---|---|---|---|---|
2048 | 2048 | 7 | 192.168.248.0/21 | c |
1281 | 256 | 2 | 192.168.249.0/24 | c |
512 | 2 | 192.168.250.0/23 | c | |
1 | 1 | 192.168.253.123 | c | |
512 | 2 | 192.168.254.0/23 | c | |
7 | 1 | 1 | 192.168.249.15 | c |
1 | 1 | 192.168.249.255 | c | |
1 | 1 | 192.168.250.15 | c | |
1 | 1 | 192.168.251.15 | c | |
1 | 1 | 192.168.253.123 | c | |
1 | 1 | 192.168.254.15 | c | |
1 | 1 | 192.168.255.249 | c |
An IP address can be temporarily removed (commented-out) by inserting "#" at the start. The above example could be modified as follows.
{{blockcalc| #192.168.253.123 192.168.251.15 192.168.249.15 192.168.249.255 192.168.251.15 #192.168.254.15 #192.168.255.249 192.168.250.15 192.168.251.15 }}
The result of the preview is:
Sorted 7 IPv4 addresses (after omitting some duplicates):
- 192.168.249.15
- 192.168.249.255
- 192.168.250.15
- 192.168.251.15
- 192.168.253.123
- 192.168.254.15
- 192.168.255.249
Total affected |
Affected addresses |
Given addresses |
Range | Contribs |
---|---|---|---|---|
2048 | 2048 | 7 | 192.168.248.0/21 | c |
1281 | 256 | 2 | 192.168.249.0/24 | c |
512 | 2 | 192.168.250.0/23 | c | |
1 | 1 | 192.168.253.123 | c | |
512 | 2 | 192.168.254.0/23 | c | |
7 | 1 | 1 | 192.168.249.15 | c |
1 | 1 | 192.168.249.255 | c | |
1 | 1 | 192.168.250.15 | c | |
1 | 1 | 192.168.251.15 | c | |
1 | 1 | 192.168.253.123 | c | |
1 | 1 | 192.168.254.15 | c | |
1 | 1 | 192.168.255.249 | c |
重定向编辑
{{Blockcalc}} = {{IP段}} = {{IP段计算}}
注意事项编辑
模板编辑说明编辑
參見编辑
上述文档嵌入自Template:Blockcalc/doc。 (编辑 | 历史) 编者可以在本模板的沙盒 (创建 | 镜像)和测试样例 (创建)页面进行实验。 请在/doc子页面中添加分类。 本模板的子页面。 |