scripting for firewall and sorting ports

i need help


i need i script that will create
ip firewall filter add chain=forward action=accept port
=1

till 6000

so it will have 6000 filters in my mikrotik router can any1 help me with a script to create this

and what must the chain be if i what it to just do incomming ports from the net input output or forward?

why not

ip firewall filter add chain=forward action=accept port=1-6000

? :slight_smile:

becouse i want to see what ports get used the most
form 1-6000 and i want to set a script that sertin port will be disabled and others not

i tryed all of this at first

my basic worked

http://en.wikipedia.org/wiki/TCP_and_UDP_port

but now i want to do it in more detail thats why i want a filter for all of them then i can create my filters to fit for example

ip firewall filter add chain=forward action=accept port=1-11
ip firewall filter add chain=forward action=accept port=12-15
ip firewall filter add chain=forward action=accept port=16-110
ip firewall filter add chain=forward action=accept port=5001-5023
etc

so i want a script to create the filters from 1-6000

so i can monitor things for a week then ill create my firewall and scripts on what i see a week later for ports to be allowed and not allowed


so can you help me with a script to create the 6000 filter entrys

thanks for all the help


thanks for this forum
and the mikrotik team