大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
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文件。