十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
ip vpn-instance vpn0
ipv4-family
route-distinguisher 600:600
vpn-target 600:600 both
quit
quit
#!/usr/bin/python2.7def main():
f= open('./vrf.txt', 'w')
for i in range(0,500):
vrf= "vpn"+str(i)
vlan= 600 + i
f.write("ip vpn-instance" + vrf + "
")
f.write("ipv4-family" + "
")
f.write("route-distinguisher" + str(vlan) + ":" + str(vlan) + "
")
f.write("vpn-target" + str(vlan) + ":" + str(vlan) + " both
")
f.write("quit" + "
")
f.write("quit" + "
")
f.write("
")
f.close()
if __name__ == '__main__':
main()
运行后可以理解生成vrf.txt文件。