枚举 192.55.22.0 到 192.56.22.0 域范围内的所有 IP 地址
如何通过python整理从192.55.22.0到192.56.22.0的所有域名范围
我想在 IP 地址范围上执行一组网络任务。一旦范围变大,我就无法枚举该范围内的所有主机。我希望能够使用网络掩码迭代网络的所有主机 如果我将任何范围从一个范围传递到另一个范围以在范围之间显示
How can I sort out all the domain range from 192.55.22.0 to 192.56.22.0 through python
I want to perform a set of network tasks on an IP address range. As soon as the range is getting bigger, I fail to enumerate all hosts in the range. I want to be able to iterate through all hosts of a network with the net mask
If I pass any range from one to another to show between the range
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你的例子有点令人困惑。 “192.55.22.0”和“192.56.22.0”之间是什么?您写了“使用网络掩码迭代网络的所有主机”,但该范围不是一个完整的网络。
在一般情况下,要从某个 ip 迭代到另一个 ip,您可以使用:
如果在如此多的主机上快速执行网络操作时遇到问题,请查看
multiprocessing 中的
Pool
模块。它可以通过同时处理几个主机来加速您的操作。Your example is a bit confusing. What is between "192.55.22.0" and "192.56.22.0"? You wrote "iterate through all hosts of a network with the net mask", but that range is not one complete network.
In a general case, to iterate from some ip to another, you can use:
If you have problems in performing the network operations quickly on so many hosts, have a look at
Pool
in themultiprocessing
module. It might speed up your operations by processing a couple of hosts at once.使用纯 Python(和 IPv6 支持):
With pure Python (and IPv6 support):