You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
以下是我做的修改
def generate_ros(metric):
results = fetch_ip_data()
rfile=open('routes.rsc','w')
for ip,datenum,mask2 in results:
route_item="add list=domesticList address=%s/%s \t %s \n"%(ip,mask2,datenum)
rfile.write(route_item)
rfile.close()
print "Usage: Append the content of the newly created routes.txt to your openvpn config file,"
" and also add 'max-routes %d', which takes a line, to the head of the file." % (len(results)+20)
因为权限access-list还可以有优先级设置,放入NAT更加灵活
rsc是RouterOS的脚本文件,可以导入后在路由器上运行
以下是我做的修改
def generate_ros(metric):
results = fetch_ip_data()
rfile=open('routes.rsc','w')
for ip,datenum,mask2 in results:
route_item="add list=domesticList address=%s/%s \t %s \n"%(ip,mask2,datenum)
rfile.write(route_item)
rfile.close()
print "Usage: Append the content of the newly created routes.txt to your openvpn config file,"
" and also add 'max-routes %d', which takes a line, to the head of the file." % (len(results)+20)
在fetch_ip_data,不过这个无关紧要,就是个日期,作为路由表的注释,自行时候可以ignore
datenum=unit_items[5]
The text was updated successfully, but these errors were encountered: