Dears
kindly i need your support to write a script which run my clients for 12 hour and disable them after 12 hour and at Friday and Saturday want them work 24 hour
thanks alot
Many thanks for your help andrescaminou don't need a script for that...in firewall rules u can apply restriction by hours and days...
what exactly do u want to do??
/ip firewall address-list add list=Restrited-users address=192.168.1.5 comment=User1
/ip firewall address-list add list=Restrited-users address=192.168.1.15 comment=User2
/ip firewall filter add action=accept chain=forward comment="Allow Traffic from restricted users at different hours" disabled=no src-address-list=Restricted-users time=9h-17h,mon,tue,wed,thu
/ip firewall filter add chain=forward src-address=192.168.1.0/24 action=drop comment="deny everything else from the network"
Oh andrescaminoSure..it's clear...
first you have to create an address list with ip address of the users that you want to control for example let's say user1 has the ip address of 192.168.1.5 and user2 has 192.168.1.15 you will have to create this rule first
Once you create the address list you will have to create the filter rules...let's say you just want them to use internet from Monday through Thursday from 9 am to 7 pmCode: Select all/ip firewall address-list add list=Restrited-users address=192.168.1.5 comment=User1 /ip firewall address-list add list=Restrited-users address=192.168.1.15 comment=User2
With those two lines you will accept traffic from your address list in those hours and deny everything that is not under that list, if you have other customers you will have to create some rules to accept them before you deny the entire network..Code: Select all/ip firewall filter add action=accept chain=forward comment="Allow Traffic from restricted users at different hours" disabled=no src-address-list=Restricted-users time=9h-17h,mon,tue,wed,thu /ip firewall filter add chain=forward src-address=192.168.1.0/24 action=drop comment="deny everything else from the network"
hope that's clear enough
/ip firewall filter add chain=forward src-address-list=!Restricted-users action=accept
/ip firewall filter add action=accept chain=forward comment="Allow Traffic from restricted users at different hours" disabled=no src-address-list=Restricted-users time=9h-17h,mon,tue,wed,thu
/ip firewall filter add chain=forward src-address=192.168.1.0/24 action=drop comment="deny everything else from the network"
/ip firewall filter add action=accept chain=forward comment="Allow Traffic from restricted users at different hours" disabled=no src-address-list=Restricted-users time=9h-17h,mon,tue,wed,thu
/ip firewall filter add chain=forward src-address-list=Restricted-users action=drop comment="deny everything else from the network"
add comment="" disabled=no interval=1d name="Disable User" on-event="/ip hotpo\
t user disable [find \\ \r\
\nprofile=\"128-Hr\"] \r\
\n:delay 5 \r\
\n:foreach i in=[/ip hotspot user find disabled=yes] do={/ip hotspot activ\
e remove [find user=[/ip hotspot user get \$i name]]}" policy=\
reboot,read,write,policy,test,password,sniff,sensitive start-date=\
jan/17/2011 start-time=08:00:00
add comment="" disabled=no interval=1d name="Enable User" on-event=\
"/ip hotspot user enable [find \\ \r\
\nprofile=\"128-Hr\"]" policy=\
reboot,read,write,policy,test,password,sniff,sensitive start-date=\
jan/17/2011 start-time=14:00:0