一个python小程序添加多个子接口和IP地址
测试的时候需要添加大量子接口
A代表每个主接口地下配置几个子接口
PORT1代表几个主接口在使用
#!/usr/bin/python
# -*- coding: UTF-8 -*-
doc = open('out3.txt','w')
A=1000
B=0
PORT1=4
for ip1 in range(1,PORT1):
for ip2 in range(1,A+1):
print ('interface ten 12/0/%d.%d' %(ip1,ip2),file=doc)
原创
2022-03-22 14:26:52 ·
1221 阅读 ·
0 评论