This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| toggle_radio [2023/08/06 20:40] – [Full Wireless operation] hogwild | toggle_radio [2025/10/19 21:22] (current) – [Control Specific Wireless Chipsets (2.4/5GHz)] hogwild | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== | + | ====== |
| - | ===== Full Wireless | + | ===== Full Wireless |
| - | If you want to enable/disable WiFi from the command line you can use the system | + | You can enable |
| + | |||
| + | \\ | ||
| **Toggle:** | **Toggle:** | ||
| Line 10: | Line 12: | ||
| \\ ''/ | \\ ''/ | ||
| - | \\ | + | |
| **Force radio off:** | **Force radio off:** | ||
| - | \\ \\ ''/ | + | |
| - | \\ | + | |
| **Force radio on:** | **Force radio on:** | ||
| - | \\ \\ ''/ | + | |
| + | | ||
| - | ===== Wireless chipset (2.4/5GHz) specific operation ===== | ||
| - | Modern routers come with 2 or more chipsets, there' | + | ===== Control Specific Wireless Chipsets (2.4/5GHz) ===== |
| - | {{: | + | Modern routers come with two or more chipsets/ |
| - | Do not blindly use this table. Check what it says on your router as it might be different. FOr full chipset operation we refer to the ethX name reference of the interface. | + | |
| - | **Verify**\\ | + | Once you've identified the name of the appropriate radio interface (via the [[advanced-wlanvifs|Virtual Wireless]] page): |
| - | '' | + | |
| - | [ $(wl -i $int radio | grep -Eo [0-1]$) -eq 1 ] && echo "radio $int is off" || echo "radio $int is on"'' | + | |
| - | **Toggle**\\ | + | \\ |
| - | '' | + | |
| - | [ $(wl -i $int radio | grep -Eo [0-1]$) -eq 1 ] && wl -i $int radio on || wl -i $int radio off'' | + | |
| - | **Force off**\\ | + | {{: |
| - | '' | + | |
| - | wl -i $int radio off'' | + | |
| - | **Force on**\\ | + | Do not blindly use this table. It's only an example. Router interface names may vary. For full chipset operation, refer to the " |
| - | '' | + | |
| - | wl -i $int radio on'' | + | |
| - | ===== Wireless SSID specific operation ===== | + | \\ For example, using " |
| - | There might be cases where you don't want to affect the full radio chipset but rather restrict access to a specific SSID. This is achieved as follow: | + | \\ **Toggle:** |
| - | - Identify the SSID virtual interface you want to affect. Remember virtual interfaces are always defined as [ main wireless interface name ] + [.] + [a number 0-3] so e.g. " | + | |
| - | {{:pasted:20221127-163344.png}} | + | |
| - | Now let's assume you want to turn off wl1.3 which is associated to SSID " | + | \\ ''/ |
| - | {{: | + | |
| - | Let's perform the following:\\ | + | |
| - | **Toggle**\\ | + | **Verify interface state:** |
| - | '' | + | |
| - | [ $(wl -i $int radio | grep -Eo [0-1]$) -eq 1 ] && wl -i $int radio on || wl -i $int radio off'' | + | |
| + | \\ '' | ||
| + | |||
| + | \\ \\ | ||
| + | |||
| + | \\ **Toggle interface state:** | ||
| + | |||
| + | \\ '' | ||
| + | |||
| + | | ||
| + | |||
| + | | ||
| + | |||
| + | \\ \\ | ||
| + | |||
| + | **Force interface on:** | ||
| + | |||
| + | \\ '' | ||
| + | |||
| + | \\ \\ | ||
| + | |||
| + | |||
| + | ===== Control Specific WiFi SSIDs ===== | ||
| + | |||
| + | In some cases, you might want to just restrict access to only one specific SSID, or change settings specific to only one WiFi interface. | ||
| + | |||
| + | This can be achieved as follows: | ||
| + | |||
| + | \\ | ||
| + | |||
| + | First, identify the SSID virtual interface you want to control. The full list of WiFi interfaces on your router and all its sub-interfaces can be found in the [[advanced-wireless|Virtual Wireless]] menu. | ||
| + | |||
| + | Virtual interfaces are always defined as: [ main wireless interface name ] + [.] + [number 0-3] | ||
| + | |||
| + | \\ | ||
| + | |||
| + | For example, in the Virtual Wireless menu on this router, you can see a 2.4GHz interface named " | ||
| + | |||
| + | \\ \\ {{: | ||
| + | |||
| + | \\ | ||
| + | |||
| + | \\ | ||
| + | |||
| + | Let's assume you want to control "wl1.3", associated with the SSID: " | ||
| + | |||
| + | \\ \\ {{: | ||
| + | |||
| + | \\ | ||
| + | |||
| + | \\ | ||
| + | |||
| + | The commands below will perform these tasks. | ||
| + | |||
| + | (You may need to enter the command '' | ||
| + | |||
| + | \\ \\ | ||
| + | |||
| + | **Toggle interface state** \\ \\ | ||
| + | |||
| + | '' | ||
| + | |||
| + | '' | ||
| + | |||
| + | \\ \\ | ||
| + | |||
| + | **Force Interface Off** \\ \\ | ||
| + | |||
| + | '' | ||
| + | |||
| + | \\ \\ | ||
| + | |||
| + | **Force Interface On** | ||
| + | |||
| + | | ||
| + | |||
| + | '' | ||
| + | |||
| + | | ||
| + | |||
| + | The //iplink //command is another reliable tool, allowing you to disable any interface or change its MAC address. | ||
| + | \\ | ||
| + | For example: \\ \\ | ||
| + | |||
| + | **Take down an interface** \\ \\ | ||
| + | |||
| + | '' | ||
| + | |||
| + | \\ \\ | ||
| + | |||
| + | **Bring up an interface: | ||
| + | |||
| + | \\ '' | ||
| + | |||
| + | \\ | ||
| + | \\ | ||
| + | |||
| + | ==== Specific WiFi SSID Operation ==== | ||
| + | |||
| + | Often, a specific defined SSID operates on multiple interfaces/ | ||
| + | |||
| + | \\ | ||
| - | **Force Off**\\ | + | **Force Off** \\ \\ |
| - | '' | + | |
| - | wl -i $int radio off'' | + | |
| - | **Force On**\\ | + | '' |
| - | '' | + | |
| - | wl -i $int radio on'' | + | |
| - | ==== Wireless SSID specific operation ==== | + | \\ \\ |
| - | Let's say, as it often happens), a specific SSID you have defined is operational on multiple interfaces/ | + | **Force On** \\ \\ |
| - | **Force Off**\\ | + | '' |
| - | '' | + | |
| - | nvram show | grep ssid | grep $SSID | while read line; do wl -i $(echo $line | cut -d" | + | |
| - | **Force On**\\ | + | \\ |
| - | '' | + | \\ |
| - | nvram show | grep ssid | grep $SSID | while read line; do wl -i $(echo $line | cut -d" | + | \\ |
| + | | ||