Community discussions

 
fefeal
just joined
Topic Author
Posts: 1
Joined: Thu Jan 01, 2015 11:50 am

Petition: RB2011 Wireless on/off by LCD

Thu Jan 01, 2015 12:14 pm

Hi:

I´m quite happy with my RB2011-UAS-2HND-IN, I use it for FTTH in Spain 100/10 without any issues at all, Wireless is also quite good performer in this router in my opinion, I use in a lot of devices without any problems, a DLNA smart TV included.

I have searched for this in the forum but I don´t see any request for a possible wifi on/off switch in the LCD, this is a feature you usually have by a button in near all modern wifi routers, I can leave wifi on all time but I´d prefer not to due to security reasons.

Is this planned or possible in next RouterOS releases ???
 
rkandilarov
just joined
Posts: 1
Joined: Sat Mar 07, 2015 2:48 am

Re: Petition: RB2011 Wireless on/off by LCD

Sat Mar 07, 2015 3:21 am

Hi all!

I also vote for this feature - WiFi On/Off button.
In my case I do not usually use WiFi and wanna switch it on only when needed like some guest comes and need Internet on his/her tablet or phone for example.

In order to overcome the current limitation I made a workaround (I'm new with MT so excuse me if there could be any easier solution):
  1. Create new bridge interface "WiFiOnOff"
  2. Assign some loopback ip to "WiFiOnOff" like 127.127.127.127
  3. Create scripts wlan_on, wlan_off that turn on/off the wlan interface and enable/disable the loopback ip assigned to "WiFiOnOff" interface
  4. Create wlan_on_off_action_check script that checks if there is a change in the loopback 127.127.127.127 availability and runs correspondingly wlan_on or wlan_off
  5. Add to scheduler a repeat call to wlan_on_off_action_check let say each 30 seconds
  6. Show the "WiFiOnOff" interface in the LCD menu
  7. Whenever one want to enable/disable the WiFi from the LCD do: Interfaces -> scroll to WiFiOnOff (NOT the wlan) -> addresses -> enable or disable -> pin code(if set up)
Not the best solution as you go trough 5 menu steps (and PIN) but still faster than to power on and log into my machine and run winbox or ssh or the port knocking script( that I've made for the same purpose) .

Controlling simultaneously both the wlan interface and the availability of the assigned ip to "WiFiOnOff" interface is needed if for any reason one sets the wifi on/off via any other method not this pseudo-lcd-enable/disable.


If anybody is interested here is my wlan_on_off_action_check script with the portknocking part that need to be omitted if only LCD control is desired:
:local "is_wlan_off" 
:set "is_wlan_off" [/interface wireless get wlan1 disabled]

:local "spec_ip_num"
:set "spec_ip_num" [/ip address find network="127.127.127.127" address="127.127.127.127/32" ]

:local "is_spec_ip_off"
:set "is_spec_ip_off" [/ip address get $"spec_ip_num" disabled]


:foreach A in=[/ip firewall address-list find name=WLAN_ON_ALLOWED] do={
  if (($"is_wlan_off") && ([/ip firewall address-list get $A list]="WLAN_ON_ALLOWED")) do={
    :log info "Enable WLAN due to portknock from $[/ip firewall address-list get $A address]"
    /system script run wlan_on   
    /ip firewall address-list remove $A
  }
}

:foreach A in=[/ip firewall address-list find name=WLAN_OFF_ALLOWED] do={
  if ((!$"is_wlan_off") && ([/ip firewall address-list get $A list]="WLAN_OFF_ALLOWED")) do={
    :log info "Disable WLAN due to portknock from $[/ip firewall address-list get $A address]"
    /system script run wlan_off   
    /ip firewall address-list remove $A
  }
}

if ( ($"is_wlan_off") && (!$"is_spec_ip_off") ) do={
  :log info "Enable WLAN due to dedicated IP up"
  /system script run wlan_on
}

if ( (!$"is_wlan_off") && $"is_spec_ip_off") do={
  :log info "Disable WLAN due to dedicated IP down"
  /system script run wlan_off
}

wlan_on
:local "spec_ip_num"
:set "spec_ip_num" [/ip address find network="127.127.127.127" address="127.127.127.127/32" ]

/ip address set $"spec_ip_num" disabled=no
/interface wireless enable wlan1
wlan_off
:local "spec_ip_num"
:set "spec_ip_num" [/ip address find network="127.127.127.127" address="127.127.127.127/32" ]

/ip address set $"spec_ip_num" disabled=yes
/interface wireless disable wlan1
 
golber
just joined
Posts: 9
Joined: Fri Nov 14, 2014 10:36 am

Re: Petition: RB2011 Wireless on/off by LCD

Sun Feb 03, 2019 8:12 pm

Hi, I would implement your solution to wifi on/off using LCD, can you explain me precisely how?
Thanks
Bye

Who is online

Users browsing this forum: No registered users and 13 guests