想批量把 1.0.0.0-1.0.0.255 转换成 1.0.0.0/24 大佬们有没有方便的工具推荐呀,谢谢。

2020-01-09 18:09:53 +08:00
 Jackyxiaoc
1.0.0.0-1.0.0.255
1.0.4.0-1.0.7.255
1.0.16.0-1.0.31.255
1.0.64.0-1.0.255.255
1.1.1.0-1.1.1.255
1.1.64.0-1.1.255.255
1.2.3.0-1.2.3.255
1.2.128.0-1.2.255.255
1.4.0.0-1.4.0.255
1.4.128.0-1.7.255.255
1.9.0.0-1.9.255.255
1.10.10.0-1.10.10.255
1.10.128.0-1.11.255.255
1.16.0.0-1.23.255.255
1.32.0.0-1.44.255.255
1.46.0.0-1.47.255.255
1.52.0.0-1.55.255.255
1.64.0.0-1.67.255.255
1.72.0.0-1.79.255.255
1.96.0.0-1.115.255.255
1.120.0.0-1.179.255.255
1.186.0.0-1.187.255.255
1.200.0.0-1.201.255.255
1.208.0.0-9.255.255.255
11.0.0.0-13.255.255.255
14.0.8.0-14.0.11.255
14.0.16.0-14.0.255.255
14.1.4.0-14.1.23.255
14.1.28.0-14.1.95.255
14.1.100.0-14.1.107.255
14.1.112.0-14.15.255.255
14.32.0.0-14.102.127.255
14.102.132.0-14.102.155.255
14.102.160.0-14.102.179.255
14.102.184.0-14.102.255.255
14.128.0.0-14.129.255.255
14.132.0.0-14.133.255.255
14.136.0.0-14.143.255.255
14.160.0.0-14.192.59.255
14.192.64.0-14.192.75.255
14.192.80.0-14.195.255.255
14.198.0.0-14.203.255.255
14.206.0.0-14.207.255.255
14.224.0.0-27.0.127.255
27.0.136.0-27.0.159.255
27.0.168.0-27.0.187.255
27.0.192.0-27.0.203.255
27.0.216.0-27.7.255.255
27.32.0.0-27.34.231.255
27.34.240.0-27.35.255.255
27.48.0.0-27.50.39.255
27.50.48.0-27.50.127.255
27.51.0.0-27.54.71.255
27.54.80.0-27.54.151.255
27.54.160.0-27.54.191.255
27.55.0.0-27.98.207.255
27.99.0.0-27.99.127.255
27.100.0.0-27.102.255.255
27.104.0.0-27.106.127.255
27.106.192.0-27.106.203.255
27.106.208.0-27.109.31.255
27.109.64.0-27.109.123.255
27.109.128.0-27.111.255.255
27.112.64.0-27.112.79.255
27.112.96.0-27.112.111.255
27.112.120.0-27.113.127.255
27.113.192.0-27.114.255.255
27.115.128.0-27.116.43.255
27.116.48.0-27.121.71.255
27.121.80.0-27.121.119.255
27.121.128.0-27.123.231.255
27.123.236.0-27.127.255.255
27.130.0.0-27.131.219.255
27.131.224.0-27.143.255.255
27.145.0.0-27.147.255.255
27.160.0.0-27.183.255.255
27.228.0.0-35.255.255.255
36.0.4.0-36.0.7.255
1469 次点击
所在节点    问与答
8 条回复
Nitroethane
2020-01-09 18:19:56 +08:00
Python 3 的 ipaddress 标准库试一下
ysc3839
2020-01-09 18:35:15 +08:00
Jackyxiaoc
2020-01-09 18:41:53 +08:00
@ysc3839 这个好像用不了

@Nitroethane 好的,谢谢。
ysc3839
2020-01-09 18:52:43 +08:00
@Jackyxiaoc 怎么个用不了?我试了把 "-" 替换成 "," 没问题呀?
xupefei
2020-01-09 18:55:54 +08:00
可以自己写哇。
把数字当成 bit 位,统计一下相同的 bit 有多少位就行了
Jackyxiaoc
2020-01-09 18:57:50 +08:00
@ysc3839 可以啦,后来测试了可以了 感谢。
@xupefei 谢谢哈
jswxg
2020-01-13 12:20:31 +08:00
就让你做个伸手党吧~~


1.0.0.0/24
1.0.4.0/22
1.0.16.0/20
1.0.64.0/18
1.0.128.0/17
1.1.1.0/24
1.1.64.0/18
1.1.128.0/17
1.2.3.0/24
1.2.128.0/17
1.4.0.0/24
1.4.128.0/17
1.5.0.0/16
1.6.0.0/15
1.9.0.0/16
1.10.10.0/24
1.10.128.0/17
1.11.0.0/16
1.16.0.0/13
1.32.0.0/13
1.40.0.0/14
1.44.0.0/16
1.46.0.0/15
1.52.0.0/14
1.64.0.0/14
1.72.0.0/13
1.96.0.0/12
1.112.0.0/14
1.120.0.0/13
1.128.0.0/11
1.160.0.0/12
1.176.0.0/14
1.186.0.0/15
1.200.0.0/15
1.208.0.0/12
1.224.0.0/11
2.0.0.0/7
4.0.0.0/6
8.0.0.0/7
11.0.0.0/8
12.0.0.0/7
14.0.8.0/22
14.0.16.0/20
14.0.32.0/19
14.0.64.0/18
14.0.128.0/17
14.1.4.0/22
14.1.8.0/21
14.1.16.0/21
14.1.28.0/22
14.1.32.0/19
14.1.64.0/19
14.1.100.0/22
14.1.104.0/22
14.1.112.0/20
14.1.128.0/17
14.2.0.0/15
14.4.0.0/14
14.8.0.0/13
14.32.0.0/11
14.64.0.0/11
14.96.0.0/14
14.100.0.0/15
14.102.0.0/17
14.102.132.0/22
14.102.136.0/21
14.102.144.0/21
14.102.152.0/22
14.102.160.0/20
14.102.176.0/22
14.102.184.0/21
14.102.192.0/18
14.128.0.0/15
14.132.0.0/15
14.136.0.0/13
14.160.0.0/11
14.192.0.0/19
14.192.32.0/20
14.192.48.0/21
14.192.56.0/22
14.192.64.0/21
14.192.72.0/22
14.192.80.0/20
14.192.96.0/19
14.192.128.0/17
14.193.0.0/16
14.194.0.0/15
14.198.0.0/15
14.200.0.0/14
14.206.0.0/15
14.224.0.0/11
15.0.0.0/8
16.0.0.0/5
24.0.0.0/7
26.0.0.0/8
27.0.0.0/17
27.0.136.0/21
27.0.144.0/20
27.0.168.0/21
27.0.176.0/21
27.0.184.0/22
27.0.192.0/21
27.0.200.0/22
27.0.216.0/21
27.0.224.0/19
27.1.0.0/16
27.2.0.0/15
27.4.0.0/14
27.32.0.0/15
27.34.0.0/17
27.34.128.0/18
27.34.192.0/19
27.34.224.0/21
27.34.240.0/20
27.35.0.0/16
27.48.0.0/15
27.50.0.0/19
27.50.32.0/21
27.50.48.0/20
27.50.64.0/18
27.51.0.0/16
27.52.0.0/15
27.54.0.0/18
27.54.64.0/21
27.54.80.0/20
27.54.96.0/19
27.54.128.0/20
27.54.144.0/21
27.54.160.0/19
27.55.0.0/16
27.56.0.0/13
27.64.0.0/11
27.96.0.0/15
27.98.0.0/17
27.98.128.0/18
27.98.192.0/20
27.99.0.0/17
27.100.0.0/15
27.102.0.0/16
27.104.0.0/15
27.106.0.0/17
27.106.192.0/21
27.106.200.0/22
27.106.208.0/20
27.106.224.0/19
27.107.0.0/16
27.108.0.0/16
27.109.0.0/19
27.109.64.0/19
27.109.96.0/20
27.109.112.0/21
27.109.120.0/22
27.109.128.0/17
27.110.0.0/15
27.112.64.0/20
27.112.96.0/20
27.112.120.0/21
27.112.128.0/17
27.113.0.0/17
27.113.192.0/18
27.114.0.0/16
27.115.128.0/17
27.116.0.0/19
27.116.32.0/21
27.116.40.0/22
27.116.48.0/20
27.116.64.0/18
27.116.128.0/17
27.117.0.0/16
27.118.0.0/15
27.120.0.0/16
27.121.0.0/18
27.121.64.0/21
27.121.80.0/20
27.121.96.0/20
27.121.112.0/21
27.121.128.0/17
27.122.0.0/16
27.123.0.0/17
27.123.128.0/18
27.123.192.0/19
27.123.224.0/21
27.123.236.0/22
27.123.240.0/20
27.124.0.0/14
27.130.0.0/16
27.131.0.0/17
27.131.128.0/18
27.131.192.0/20
27.131.208.0/21
27.131.216.0/22
27.131.224.0/19
27.132.0.0/14
27.136.0.0/13
27.145.0.0/16
27.146.0.0/15
27.160.0.0/12
27.176.0.0/13
27.228.0.0/14
27.232.0.0/13
27.240.0.0/12
28.0.0.0/6
32.0.0.0/6
36.0.4.0/22
Jackyxiaoc
2020-01-13 12:28:22 +08:00
@jswxg 哈哈 谢谢大佬

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/636598

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX