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:49] – [Turning on/off radio elements from a script] hogwild | toggle_radio [2023/08/06 21:49] (current) – [Wireless SSID-specific operation] -change "wireless" to "WiFi" hogwild | ||
---|---|---|---|
Line 25: | Line 25: | ||
- | ===== Wireless chipset (2.4/ | + | ===== Specific |
- | Modern routers come with 2 or more chipsets, there' | + | Modern routers come with two or more chipsets/WiFi interfaces. There is usually one 2.4GHz interface and one or more 5GHz interfaces. In certain |
Once you've identified the name of the appropriate radio interface (via the [[advanced-wlanvifs|Virtual Wireless]] page): | Once you've identified the name of the appropriate radio interface (via the [[advanced-wlanvifs|Virtual Wireless]] page): | ||
Line 33: | Line 33: | ||
\\ | \\ | ||
- | {{: | + | {{: |
- | Do not blindly use this table. | + | Do not blindly use this table. |
\\ | \\ | ||
- | For example, using " | + | For example, using " |
**Verify interface state** | **Verify interface state** | ||
- | \\ \\ '' | + | |
+ | |||
+ | \\ | ||
+ | |||
+ | \\ | ||
**Toggle interface state** | **Toggle interface state** | ||
- | | + | \\ '' |
+ | |||
+ | \\ | ||
\\ | \\ | ||
Line 53: | Line 59: | ||
**Force interface off** | **Force interface off** | ||
- | \\ \\ '' | + | |
\\ | \\ | ||
- | **Force interface on**\\ | + | \\ |
+ | **Force interface on** | ||
- | ===== Wireless SSID specific operation ===== | + | \\ \\ '' |
- | 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: | ||
- | - 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. " | ||
- | {{: | ||
- | Now let's assume you want to turn off wl1.3 which is associated to SSID " | + | ===== WiFi SSID-specific operation ===== |
- | {{: | + | |
- | Let's perform the following: | + | In some cases, you might want to just restrict access to only one specific SSID or change settings specific to only one WiFi interface. |
- | **Toggle**\\ | + | 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. |
- | [ $(wl -i $int radio | grep -Eo [0-1]$) -eq 1 ] && wl -i $int radio on || wl -i $int radio off'' | + | |
- | **Force Off**\\ | + | Virtual interfaces are always defined as: '' |
- | '' | + | |
- | wl -i $int radio off'' | + | |
- | **Force On**\\ | + | For example, |
- | '' | + | |
- | wl -i $int radio on'' | + | |
- | ==== Wireless SSID specific operation ==== | + | \\ \\ {{: |
- | Let' | + | \\ |
+ | |||
+ | \\ | ||
+ | |||
+ | Now, let' | ||
+ | |||
+ | \\ \\ {{: | ||
+ | |||
+ | \\ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | You could perform the following tasks:\\ | ||
+ | |||
+ | **Toggle interface state**\\ | ||
+ | |||
+ | '' | ||
+ | |||
+ | \\ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | **Force Interface Off** | ||
+ | |||
+ | \\ \\ '' | ||
+ | |||
+ | \\ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | **Force Interface On** | ||
+ | |||
+ | \\ \\ '' | ||
+ | |||
+ | \\ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | |||
+ | ==== WiFi SSID-specific operation ==== | ||
+ | |||
+ | Often, a specific defined | ||
+ | |||
+ | You can disable | ||
+ | |||
+ | \\ | ||
+ | |||
+ | **Force Off** | ||
+ | |||
+ | \\ \\ '' | ||
+ | |||
+ | \\ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | **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" |