This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
toggle_radio [2023/08/06 20:39] – [Turning on/off radio elements from script] hogwild | toggle_radio [2023/08/06 21:44] – [WiFi SSID-specific operation] -formatting hogwild | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Turning on/off radio elements from a script ====== | + | ====== Turning on/ |
===== Full Wireless operation ===== | ===== Full Wireless operation ===== | ||
- | If you want to enable/ | + | If you want to enable/ |
- | **Toggle**\\ | + | \\ |
- | ''/ | + | |
- | **Force off**\\ | + | **Toggle:** |
- | ''/ | + | |
- | **Force on**\\ | + | \\ ''/ |
- | ''/ | + | |
+ | | ||
- | ===== Wireless chipset (2.4/5GHz) specific operation ===== | + | **Force radio off:** |
- | Modern routers come with 2 or more chipsets, there's usually 1x 2.4GHz and 1x (or more) 5GHz chipset. In some certain case you might want to enable/disable a specifi chipset from the command line. Once you have identified the name of your radio interface (the [[advanced-wlanvifs|Virtual Wireless]] page is a good starting point) | + | |
- | {{: | + | |
- | 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. Once you have the correct name (I'm using eth1 in my example here below), you can check the status of your wireless interface as follow: | + | |
- | **Verify**\\ | + | **Force radio on:** |
- | '' | + | |
- | [ $(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**\\ | + | ===== Specific Wireless chipset (2.4/5GHz) operations ===== |
- | '' | + | |
- | wl -i $int radio on'' | + | |
- | ===== Wireless SSID specific | + | Modern routers come with two or more chipsets/ |
- | There might be cases where you don't want to affect | + | Once you've identified |
- | - Identify the SSID virtual interface you want to affect. Remember virtual interfaces are always defined as [ main wireless interface | + | |
- | {{:pasted: | + | |
- | Now let's assume you want to turn off wl1.3 which is associated to SSID " | + | \\ |
- | {{: | + | |
- | Let's perform the following:\\ | + | {{:pasted: |
- | **Toggle**\\ | + | Do not blindly use this table. It is only an example. Router interface names may vary. For full chipset operation, refer to the " |
- | '' | + | \\ |
- | [ $(wl -i $int radio | grep -Eo [0-1]$) -eq 1 ] && wl -i $int radio on || wl -i $int radio off'' | + | |
- | **Force | + | For example, using " |
- | '' | + | |
- | wl -i $int radio off'' | + | **Verify interface state** |
+ | |||
+ | | ||
+ | |||
+ | \\ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | **Toggle interface state** | ||
+ | |||
+ | \\ '' | ||
+ | |||
+ | \\ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | **Force | ||
+ | |||
+ | \\ '' | ||
+ | |||
+ | \\ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | **Force interface on** | ||
+ | |||
+ | \\ \\ | ||
+ | |||
+ | |||
+ | ===== WiFi SSID-specific operation ===== | ||
+ | |||
+ | 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: '' | ||
+ | |||
+ | For example, on this router, in the Virtual Wireless menu, we can see the 2.4GHz interface named: " | ||
+ | |||
+ | \\ \\ {{: | ||
+ | |||
+ | \\ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | Now, let's assume you want to turn off wl1.3 which is associated to SSID " | ||
+ | |||
+ | \\ \\ {{: | ||
+ | |||
+ | \\ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | We could perform the following tasks:\\ | ||
+ | |||
+ | **Toggle interface state**\\ | ||
+ | |||
+ | '' | ||
+ | |||
+ | \\ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | **Force Interface Off** | ||
+ | |||
+ | \\ \\ '' | ||
+ | |||
+ | \\ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | **Force Interface On** | ||
+ | |||
+ | \\ \\ '' | ||
+ | |||
+ | \\ | ||
+ | |||
+ | \\ | ||
- | **Force On**\\ | ||
- | '' | ||
- | wl -i $int radio on'' | ||
==== Wireless SSID specific operation ==== | ==== Wireless SSID specific operation ==== |