Page 1 of 1

How to import large numer of access rules to web proxy?

Posted: Fri Oct 19, 2012 2:19 pm
by sioux
Hello
I have problem with importing large numer of web proxy access rules.

My import file looks like this
/ip proxy access add dst-host=0-168.com action=deny
/ip proxy access add dst-host=0-29.com action=deny
/ip proxy access add dst-host=0-2u.com action=deny
/ip proxy access add dst-host=0-days.net action=deny
/ip proxy access add dst-host=0.0.0.180 action=deny
/ip proxy access add dst-host=0.157.42.75 action=deny
/ip proxy access add dst-host=000.angryshark.cn action=deny
/ip proxy access add dst-host=000007.ru action=deny
/ip proxy access add dst-host=00002009.zapto.org action=deny
/ip proxy access add dst-host=0000hfdggsg0hrx12e.co.ve action=deny
/ip proxy access add dst-host=0000hfdggsg0hrx12e.com.ve action=deny
/ip proxy access add dst-host=0000hfdggsg0hrx12e.info.ve action=deny
/ip proxy access add dst-host=0000hfdggsg0hrx12e.net.ve action=deny
/ip proxy access add dst-host=0000hfdggsg0hrx12e.org.ve action=deny
/ip proxy access add dst-host=0000hfdggsg0hrx12e.web.ve action=deny
/ip proxy access add dst-host=0004pk3beguoc3ar0s.co.ve action=deny
/ip proxy access add dst-host=0004pk3beguoc3ar0s.com.ve action=deny
Then, having this file i execute
ssh user@ip < path_to_file
When file is large, 291644 domains, i have only 3 first commands executed and i got a error message
failed to open file: No such file or directory
When file i small, around 50 lines, import finishes without problems, and no error message appears.

What am I doing wrong?
Where is the problem?

Or meybe there is a better way to fill access list with a large numer of rules?

Thanks!

I'm using MikroTik RouterOS 5.2

Re: How to import large numer of access rules to web proxy?

Posted: Fri Oct 19, 2012 6:17 pm
by ditonet
Upload your import file to router using FTP or Winbox, then from terminal execute command:

ros code

import file-name=your_file.rsc
It works good even for huge files.
BTW, you can make your file smaller by remove repeating commands:

ros code

/ip proxy access
add dst-host=0-168.com action=deny
add dst-host=0-29.com action=deny
add dst-host=0-2u.com action=deny
add dst-host=0-days.net action=deny
add dst-host=0.0.0.180 action=deny
HTH,

Re: How to import large numer of access rules to web proxy?

Posted: Fri Oct 19, 2012 11:46 pm
by sioux
I know that there was a simpler way to achieve this.
Thank you!!