Community discussions

MikroTik App
 
obscurus
newbie
Topic Author
Posts: 29
Joined: Thu May 04, 2017 9:25 am

Capsman scheduler

Wed May 30, 2018 8:46 am

Please, explane me how i can enable/disable wlan wifi interface on capsman via scripts.
I have tried disable provisioning rule but without results - my phone can connect to wifi
 
User avatar
karlisi
Member
Member
Posts: 438
Joined: Mon May 31, 2004 8:09 am
Location: Latvia

Re: Capsman scheduler

Wed May 30, 2018 11:05 am

You already have provisioning rules configured. Create these scripts and schedule to run them.

to enable
/caps-man provisioning enable 0    
:delay 1
/caps-man radio provision numbers=[find]
to disable
/caps-man provisioning disable 0 
:delay 1
/caps-man radio provision numbers=[find]
 
obscurus
newbie
Topic Author
Posts: 29
Joined: Thu May 04, 2017 9:25 am

Re: Capsman scheduler

Sun Jun 03, 2018 7:00 pm

I have 4 provisioning rules and if i add its in script (0,1,2,3) - only first rule has been disabling. How i can disable all?
 
User avatar
karlisi
Member
Member
Posts: 438
Joined: Mon May 31, 2004 8:09 am
Location: Latvia

Re: Capsman scheduler

Mon Jun 04, 2018 10:34 am

Try on first line
/caps-man provisioning disable numbers=[find]
And on second script too. This should disable and enable all configurations.
 
obscurus
newbie
Topic Author
Posts: 29
Joined: Thu May 04, 2017 9:25 am

Re: Capsman scheduler

Mon Jun 04, 2018 11:17 am

My script is:

/caps-man provisioning disable 0;
:delay 1;
/caps-man radio provision numbers=[find];
/caps-man provisioning disable 1; 
:delay 1;
/caps-man radio provision numbers=[find];
/caps-man provisioning disable 2;
:delay 1;
/caps-man radio provision numbers=[find];
/caps-man provisioning disable 3; 
:delay 1;
/caps-man radio provision numbers=[find];
But disable only number 0
 
User avatar
karlisi
Member
Member
Posts: 438
Joined: Mon May 31, 2004 8:09 am
Location: Latvia

Re: Capsman scheduler

Mon Jun 04, 2018 2:19 pm

Only the first enabled provisioning rule will be in effect, if no additional filtering parameters (hw-supported-modes, identity-regexp, etc.) are set.
If you want to disable all 4 provisioning rules at once, try my scripts:
/caps-man provisioning enable numbers=[find]    
:delay 1
/caps-man radio provision numbers=[find]
Similarly to disable.
 
obscurus
newbie
Topic Author
Posts: 29
Joined: Thu May 04, 2017 9:25 am

Re: Capsman scheduler

Mon Jun 04, 2018 8:09 pm

Only the first enabled provisioning rule will be in effect, if no additional filtering parameters (hw-supported-modes, identity-regexp, etc.) are set.
If you want to disable all 4 provisioning rules at once, try my scripts:
/caps-man provisioning enable numbers=[find]    
:delay 1
/caps-man radio provision numbers=[find]
Similarly to disable.
Many thanks. The script works fine for disabing provisioning rule but wlan interfaces are still active.
 
User avatar
karlisi
Member
Member
Posts: 438
Joined: Mon May 31, 2004 8:09 am
Location: Latvia

Re: Capsman scheduler

Tue Jun 05, 2018 9:34 am

So, something wrong with configurations included in these provisionings.
 
obscurus
newbie
Topic Author
Posts: 29
Joined: Thu May 04, 2017 9:25 am

Re: Capsman scheduler

Thu Jun 07, 2018 11:49 pm

No, i have correct configuration, because wifi roaming are correct in my network. Maybe it is because i have local forwarding enable?
Last edited by obscurus on Fri Jun 08, 2018 8:42 am, edited 1 time in total.
 
User avatar
karlisi
Member
Member
Posts: 438
Joined: Mon May 31, 2004 8:09 am
Location: Latvia

Re: Capsman scheduler

Fri Jun 08, 2018 8:33 am

Post export from /capsman provisioning and /capsman configuration please.
 
obscurus
newbie
Topic Author
Posts: 29
Joined: Thu May 04, 2017 9:25 am

Re: Capsman scheduler

Fri Jun 08, 2018 8:52 am

/caps-man channel
add band=5ghz-a/n/ac extension-channel=Ce name=channel5 tx-power=27
add band=2ghz-b/g/n extension-channel=disabled name=channel2 tx-power=25
add band=2ghz-b/g/n extension-channel=disabled name=channel2_netmetal tx-power=27
add band=5ghz-a/n/ac extension-channel=eC name=channel5_netmetal tx-power=30
/caps-man datapath
add bridge=bridge1 client-to-client-forwarding=yes local-forwarding=yes name=datapath1
/caps-man security
add authentication-types=wpa2-psk encryption=aes-ccm group-encryption=aes-ccm name=security1 passphrase=PASSWORD
/caps-man configuration
add channel=channel2 country=russia datapath=datapath1 distance=dynamic guard-interval=any hw-protection-mode=rts-cts hw-retries=5 mode=ap multicast-helper=full name=cfg2 rx-chains=0,1,2 security=security1 ssid=ssid tx-chains=0,1,2
add channel=channel5 country=russia datapath=datapath1 distance=dynamic guard-interval=any hw-protection-mode=rts-cts hw-retries=5 multicast-helper=full name=cfg5 rx-chains=0,1,2 security=security1 ssid=ssid tx-chains=0,1,2
add channel=channel2_netmetal country=russia datapath=datapath1 distance=dynamic guard-interval=any hw-protection-mode=rts-cts hw-retries=5 mode=ap multicast-helper=full name=cfg2_netmetal rx-chains=0,1,2 security=security1 ssid=ssid \
    tx-chains=0,1,2
add channel=channel5_netmetal country=russia datapath=datapath1 distance=dynamic guard-interval=any hw-protection-mode=rts-cts hw-retries=5 multicast-helper=full name=cfg5_netmetal rx-chains=0,1,2 security=security1 ssid=ssid tx-chains=\
    0,1,2
/caps-man access-list
add action=reject allow-signal-out-of-range=10s disabled=no signal-range=-120..-88 ssid-regexp=""
/caps-man manager
set enabled=yes
/caps-man provisioning
add action=create-dynamic-enabled hw-supported-modes=gn,b identity-regexp=First_Mik master-configuration=cfg2 name-format=prefix-identity name-prefix=2G radio-mac=6C:3B:6B:44:83:CF
add action=create-dynamic-enabled hw-supported-modes=ac,an identity-regexp=First_Mik master-configuration=cfg5 name-format=prefix-identity name-prefix=5G radio-mac=6C:3B:6B:44:83:CE
add action=create-dynamic-enabled hw-supported-modes=ac,an identity-regexp=Second_Mik_netmetal master-configuration=cfg5_netmetal name-format=prefix-identity name-prefix=5G radio-mac=E4:8D:8C:16:4E:D2
add action=create-dynamic-enabled hw-supported-modes=gn,b identity-regexp=Second_Mik_netmetal master-configuration=cfg2_netmetal name-format=prefix-identity name-prefix=2G radio-mac=4C:5E:0C:11:7F:D9
 
obscurus
newbie
Topic Author
Posts: 29
Joined: Thu May 04, 2017 9:25 am

Re: Capsman scheduler

Sun Jun 10, 2018 9:52 pm

i also can connect to the wifi even if i disable local forwarding and disable provisioning rules via script
 
User avatar
karlisi
Member
Member
Posts: 438
Joined: Mon May 31, 2004 8:09 am
Location: Latvia

Re: Capsman scheduler

Mon Jun 11, 2018 8:39 am

Are you sure your APs are managed by CAPsMAN? Are they on /capsman interface ?
 
obscurus
newbie
Topic Author
Posts: 29
Joined: Thu May 04, 2017 9:25 am

Re: Capsman scheduler

Mon Jun 11, 2018 4:57 pm

Yes,all interfaces in capsman
 /caps-man interface print  
Flags: M - master, D - dynamic, B - bound, X - disabled, I - inactive, R - running 
 #      NAME                                                                RADIO-MAC         MASTER-INTERFACE                                                              
 0 MDBR 2G-Mik-1                                                    6C:3B:6B:44:83:CF none                                                                          
 1 MDB  2G-Mik_netmetal-1                                           4C:5E:0C:11:7F:D9 none                                                                          
 2 MDB  5G-Mik-1                                                    6C:3B:6B:44:83:CE none                                                                          
 3 MDB  5G-Mik_netmetal-1                                           E4:8D:8C:16:4E:D2 none                                                                          
 
User avatar
karlisi
Member
Member
Posts: 438
Joined: Mon May 31, 2004 8:09 am
Location: Latvia

Re: Capsman scheduler

Mon Jun 11, 2018 5:15 pm

And if you disable all provisioning rules by hand and execute provision on all radios, the interfaces are still there?
 
obscurus
newbie
Topic Author
Posts: 29
Joined: Thu May 04, 2017 9:25 am

Re: Capsman scheduler

Mon Jun 11, 2018 6:06 pm

When i disable manually all provisionig rules and then execute provision on all radios - appear unnamed provisioning rules (cap1,cap2...) and i see hide ssid (not my ssid) on wifi sniffer.
Then i enable provisioning rules and execute provision on all radios - no result... i see the same hide ssid and unnamed rules. If i delete unnamed rules and execute provision on all radios -appear correct provisioning rules and correct ssid.
 
Grickos
newbie
Posts: 35
Joined: Thu Aug 06, 2015 2:57 am
Location: Croatia

Re: Capsman scheduler

Mon Jun 11, 2018 8:20 pm

You have to disable CAP interface, not Provisioning.
Or post a comment to Interface, so over the name of the comment.

/caps-man interface set [ find name="cap-wifi-homexxxx" ] disabled=yes
/caps-man interface set [ find name="cap-wifi-homexxxx" ] disabled=no
Or
/caps-man interface disable [ find name="cap-wifi-homexxxx" ]
/caps-man interface enable [ find name="cap-wifi-homexxxx" ]

Sorry for bad English
 
obscurus
newbie
Topic Author
Posts: 29
Joined: Thu May 04, 2017 9:25 am

Re: Capsman scheduler

Mon Jun 11, 2018 9:43 pm

Grickos and karlisi, many thanks for good ideas!

I could not disable capsman interfaces because in provisioning rules was set action "create dinamic enabled".
First i changed action to "create enaled" in provisioning rules and then run the follow script
/caps-man interface set [ find name="5G-cap_name" ] disabled=yes;
delay 1;
/caps-man interface set [ find name="2G-cap_name" ] disabled=yes;
delay 1;
/caps-man interface set [ find name="5G-cap_name_2" ] disabled=yes;
delay 1;
/caps-man interface set [ find name="2G-cap_name_2" ] disabled=yes;
and for enable change disabled to no (disabled=no)

And its work perfect
 
kattivius
just joined
Posts: 6
Joined: Sat Feb 08, 2020 2:27 pm

Re: Capsman scheduler

Mon May 11, 2020 12:01 pm

Grickos and karlisi, many thanks for good ideas!

I could not disable capsman interfaces because in provisioning rules was set action "create dinamic enabled".
First i changed action to "create enaled" in provisioning rules and then run the follow script
/caps-man interface set [ find name="5G-cap_name" ] disabled=yes;
delay 1;
/caps-man interface set [ find name="2G-cap_name" ] disabled=yes;
delay 1;
/caps-man interface set [ find name="5G-cap_name_2" ] disabled=yes;
delay 1;
/caps-man interface set [ find name="2G-cap_name_2" ] disabled=yes;
and for enable change disabled to no (disabled=no)

And its work perfect
Fantastic,
I tested the commands on a terminal and run the script, works beautifully.
now I created a schedule with the scheduler. if that works also, you really helped me.
I was waiting for an answer from MT support... Lets see what is their solution. So far, yours seems to be working very well.
 
pizzonia
just joined
Posts: 16
Joined: Mon May 06, 2013 8:16 pm

Re: Capsman scheduler

Sat Aug 22, 2020 2:20 am

Does anyone have working solution to disable wifi during night when sleeping. I have two HAP ac2.



 
kanyck
just joined
Posts: 8
Joined: Sat Oct 17, 2020 10:16 pm

Re: Capsman scheduler

Sun Oct 18, 2020 11:32 am

I've a couple more questions on that.
1. If I have slave interfaces for additional SSIDs, do I have to switch them off first, or it's enough to switch off the master interface?
2. Do I understand correctly that disabled interface radiates nothing, like rfkill block on *nixes?
 
nemke
Member Candidate
Member Candidate
Posts: 160
Joined: Thu Jul 31, 2014 2:52 am

Re: Capsman scheduler

Wed Oct 21, 2020 10:51 pm

[xxxxxx@Ruter Securitron] system script print
5 name="Capsman enable House" owner="nemke"
policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon
dont-require-permissions=yes last-started=oct/21/2020 07:00:00
run-count=46
source=/caps-man interface set [ find name~"House" ] disabled=no

6 name="Capsman disable Kuca" owner="nemke"
policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon
dont-require-permissions=yes last-started=oct/21/2020 01:00:00
run-count=48
source=/caps-man interface set [ find name~"House" ] disabled=yes

[nemke@Ruter Securitron] /system scheduler> print detail
Flags: X - disabled
2 name="Capsman disable House" start-date=mar/15/2020 start-time=01:00:00 interval=1d on-event=Capsman disable Kuca owner="nemke" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon run-count=46 next-run=oct/22 01:00:00

3 name="Capsman enable House" start-date=mar/15/2020 start-time=07:00:00 interval=1d on-event=Capsman enable Kuca owner="nemke" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon run-count=46 next-run=oct/22 07:00:00

[nemke@Ruter Securitron] /caps-man provisioning> print
Flags: X - disabled
2 ;;; AP Prizemlje
radio-mac=CC:2D:E0:AF:A7:E6 hw-supported-modes="" identity-regexp="" common-name-regexp="" ip-address-ranges="" action=create-enabled master-configuration=Gost slave-configurations="" name-format=prefix-identity name-prefix="Kuca"

3 ;;; AP Prizemlje
radio-mac=CC:2D:E0:AF:A7:E7 hw-supported-modes="" identity-regexp="" common-name-regexp="" ip-address-ranges="" action=create-enabled master-configuration=Stan Petrovic 5GHz slave-configurations=Stan Ponjavic 5GHz name-format=prefix-identity
name-prefix="Kuca"

4 ;;; AP Sprat
radio-mac=CC:2D:E0:E7:87:EE hw-supported-modes="" identity-regexp="" common-name-regexp="" ip-address-ranges="" action=create-enabled master-configuration=Gost slave-configurations="" name-format=prefix-identity name-prefix="Kuca"

5 ;;; AP Sprat
radio-mac=CC:2D:E0:E7:87:ED hw-supported-modes="" identity-regexp="" common-name-regexp="" ip-address-ranges="" action=create-enabled master-configuration=Stan Petrovic 5GHz slave-configurations="" name-format=prefix-identity name-prefix="Kuca"

6 ;;; AP Podrum
radio-mac=B8:69:F4:F0:C2:FB hw-supported-modes="" identity-regexp="" common-name-regexp="" ip-address-ranges="" action=create-enabled master-configuration=Gost slave-configurations="" name-format=prefix-identity name-prefix="Kuca"

7 ;;; AP Podrum
radio-mac=B8:69:F4:F0:C2:FC hw-supported-modes="" identity-regexp="" common-name-regexp="" ip-address-ranges="" action=create-enabled master-configuration=Stan Petrovic 5GHz slave-configurations="" name-format=prefix-identity name-prefix="Kuca"

8 ;;; AP Terasa
radio-mac=C4:AD:34:13:48:D9 hw-supported-modes="" identity-regexp="" common-name-regexp="" ip-address-ranges="" action=create-enabled master-configuration=Gost slave-configurations="" name-format=prefix-identity name-prefix="Kuca"

9 ;;; AP Terasa
radio-mac=C4:AD:34:13:48:D8 hw-supported-modes="" identity-regexp="" common-name-regexp="" ip-address-ranges="" action=create-enabled master-configuration=Stan Petrovic 5GHz slave-configurations="" name-format=prefix-identity name-prefix="Kuca"

It work Like charm :-D
After I change option in cap-man previsioning to action=create-enabled from action=create-dinamic enabled it star working.

Hope this helps

Who is online

Users browsing this forum: freezerfcb, Snooops and 22 guests