简体   繁体   English

CIDR 扩展器的脚本

[英]Script for CIDR expander

I want to write a script in powershell/python to expand the CIDR and list all the IP's along with the site where it belongs.我想在 powershell/python 中编写一个脚本来扩展 CIDR 并列出所有 IP 以及它所属的站点。

My excel 1st column will have site name and second column will have IP with subnet details like in image attached enter image description here and the output should be enter image description here我的 excel 第一列将具有站点名称,第二列将具有带有子网详细信息的 IP,如附图所示在此处输入图像描述,输出应在此处输入图像描述

Kindly help.请帮忙。 I am new to script and would like to know how to approach this.我是脚本新手,想知道如何处理这个问题。

import ipaddress
possible_ips = [str(ip) for ip in ipaddress.IPv4Network(CIDR)]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM