Page 1 of 1
Capsman scheduler
Posted: Wed May 30, 2018 8:46 am
by obscurus
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
Re: Capsman scheduler
Posted: Wed May 30, 2018 11:05 am
by karlisi
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]
Re: Capsman scheduler
Posted: Sun Jun 03, 2018 7:00 pm
by obscurus
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?
Re: Capsman scheduler
Posted: Mon Jun 04, 2018 10:34 am
by karlisi
Try on first line
/caps-man provisioning disable numbers=[find]
And on second script too. This should disable and enable all configurations.
Re: Capsman scheduler
Posted: Mon Jun 04, 2018 11:17 am
by obscurus
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
Re: Capsman scheduler
Posted: Mon Jun 04, 2018 2:19 pm
by karlisi
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.
Re: Capsman scheduler
Posted: Mon Jun 04, 2018 8:09 pm
by obscurus
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.
Re: Capsman scheduler
Posted: Tue Jun 05, 2018 9:34 am
by karlisi
So, something wrong with configurations included in these provisionings.
Re: Capsman scheduler
Posted: Thu Jun 07, 2018 11:49 pm
by obscurus
No, i have correct configuration, because wifi roaming are correct in my network. Maybe it is because i have local forwarding enable?
Re: Capsman scheduler
Posted: Fri Jun 08, 2018 8:33 am
by karlisi
Post export from /capsman provisioning and /capsman configuration please.
Re: Capsman scheduler
Posted: Fri Jun 08, 2018 8:52 am
by obscurus
/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
Re: Capsman scheduler
Posted: Sun Jun 10, 2018 9:52 pm
by obscurus
i also can connect to the wifi even if i disable local forwarding and disable provisioning rules via script
Re: Capsman scheduler
Posted: Mon Jun 11, 2018 8:39 am
by karlisi
Are you sure your APs are managed by CAPsMAN? Are they on /capsman interface ?
Re: Capsman scheduler
Posted: Mon Jun 11, 2018 4:57 pm
by obscurus
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
Re: Capsman scheduler
Posted: Mon Jun 11, 2018 5:15 pm
by karlisi
And if you disable all provisioning rules by hand and execute provision on all radios, the interfaces are still there?
Re: Capsman scheduler
Posted: Mon Jun 11, 2018 6:06 pm
by obscurus
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.
Re: Capsman scheduler
Posted: Mon Jun 11, 2018 8:20 pm
by Grickos
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
Re: Capsman scheduler
Posted: Mon Jun 11, 2018 9:43 pm
by obscurus
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
Re: Capsman scheduler
Posted: Mon May 11, 2020 12:01 pm
by kattivius
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.
Re: Capsman scheduler
Posted: Sat Aug 22, 2020 2:20 am
by pizzonia
Does anyone have working solution to disable wifi during night when sleeping. I have two HAP ac2.
Re: Capsman scheduler
Posted: Sun Oct 18, 2020 11:32 am
by kanyck
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?
Re: Capsman scheduler
Posted: Wed Oct 21, 2020 10:51 pm
by nemke
[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
Re: Capsman scheduler
Posted: Fri Jan 03, 2025 3:03 pm
by pbaumgartner
If anyone else stumbles upon this post, this is my solution based on your posts:
Script to disable all WIFI Interfaces with the name "AP-1stFloor-*"
:foreach interfaceID in=[/caps-man interface find where name~"^AP-1stFloor-.*"] do={
:local interfaceName [/caps-man interface get $interfaceID name];
:log info "deactivate Interface: $interfaceName";
/caps-man interface disable $interfaceID;
}
:log info "Script finished. All matching interfaces disabled"
And I scheduled this script on CAPsMAN Server
Hope this helps
Re: Capsman scheduler
Posted: Fri Jan 03, 2025 3:19 pm
by infabo
Script to disable all WIFI Interfaces with the name "AP-1stFloor-*"
According to your commands it is for wireless capsman and not for wifi capsman. so be careful with wording. "wifi" refers to the new /wifi/ menu since ROS 7.13.
A solution for wifi capsman would be neat.
Re: Capsman scheduler
Posted: Sat Jan 04, 2025 1:02 am
by rextended
It's a necroposting from 2018.
v7 do not exist on 2018...
Ignoring the logging, is all useless, just simply
/caps-man interface disable [find where name~"^AP-1stFloor-.*"]