Can I enable/disable Wlan2 interface by clicking “Mode Button” on my Mikrotik hap AC2? How?
Thanks
Can I enable/disable Wlan2 interface by clicking “Mode Button” on my Mikrotik hap AC2? How?
Thanks
Yes, you can. The the following command may be used to enable/disable the interface:
/interface wireless set wlan2 disabled=(![get wlan2 disabled])
Open System → Routerboard → Mode Button in Winbox and paste the command into On Event field.
To perform the same in the terminal:
/system routerboard mode-button
set enabled=yes
set on-event="/interface wireless set wlan2 disabled=(![get wlan2 disabled])"
Alternatively you may create a script containing the command in System → Scripts or in the terminal
/system script
add name=enable_disable_wlan2 source="/interface wireless set wlan2 disabled=(![get wlan2 disabled])"
And then specify the script name in the Mode button event handler:
/system routerboard mode-button
set enabled=yes
set on-event="enable_disable_wlan2"
Check Manual:Scripting for more details on scripting in RouterOS.
I set this, and it works great.
Is there a brief list of the most used and useful commands you can trig?
Thanks
It depends on your needs. If you type “?” in the terminal, you’ll see the list of all available commands. The command I use most often is probably ping
In the terminal you can do pretty much everything (or even more) that is available for you in Winbox, as terminal commands usually replicate the Winbox menu structure.
To add an IP for an interface in Winbox you open IP → Addresses → Add button and in the terminal that would be: /ip address add … command.