Skip to content

Instantly share code, notes, and snippets.

@straight-shoota
Last active January 5, 2024 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save straight-shoota/7016551224082f324f33fab45a10f302 to your computer and use it in GitHub Desktop.
Save straight-shoota/7016551224082f324f33fab45a10f302 to your computer and use it in GitHub Desktop.
Gl-iNET AR300M Network Mode Toggle
  1. Download network-mode.sh
  2. Set executable flag and upload network-mode.sh to router (at $IP)
    chmod +x network-mode.sh
    scp network-mode.sh root@$IP:/etc/gl-switch.d/network-mode.sh
  3. Go to router web UI (http://$IP).
  4. Go to System > Toggle Button Settings, select Network Mode.
  5. Profit.

Required firmware: 4.3+

#!/bin/sh
action=$1
if [ "$action" = "on" ];then
uci set glconfig.general.mode='router'
uci commit glconfig
fi
if [ "$action" = "off" ];then
uci set glconfig.general.mode='ap'
uci commit glconfig
fi
sleep 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment