Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在mikrotik的ROS路由器上,我觉得做成Access-list比做成路由表更有效率 #63

Open
stevemorrisLian opened this issue Jul 26, 2016 · 0 comments

Comments

@stevemorrisLian
Copy link

因为权限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]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant