Skip to content

Instantly share code, notes, and snippets.

@natemccurdy
Created April 26, 2024 18:41
Show Gist options
  • Save natemccurdy/03e9e3a8c692d010858add721a32d01c to your computer and use it in GitHub Desktop.
Save natemccurdy/03e9e3a8c692d010858add721a32d01c to your computer and use it in GitHub Desktop.
T-Mobile 5G gateway - Advanced configuration
{
"2.4ghz": {
"airtimeFairness": true,
"channel": "1",
"channelBandwidth": "Auto",
"isMUMIMOEnabled": true,
"isRadioEnabled": true,
"isWMMEnabled": true,
"maxClients": 128,
"mode": "auto",
"ssid": {
"encryptionMode": "AES",
"encryptionVersion": "WPA2/WPA3",
"isBroadcastEnabled": true,
"ssidName": "YourSSIDHere",
"steered": false,
"wpaKey": "YourPasswordHere"
},
"transmissionPower": "100%"
},
"5.0ghz": {
"airtimeFairness": true,
"channel": "Auto",
"channelBandwidth": "80MHz",
"isMUMIMOEnabled": true,
"isRadioEnabled": true,
"isWMMEnabled": true,
"maxClients": 128,
"mode": "auto",
"ssid": {
"encryptionMode": "AES",
"encryptionVersion": "WPA2/WPA3",
"isBroadcastEnabled": true,
"ssidName": "YourSSIDHere",
"steered": false,
"wpaKey": "YourPasswordHere"
},
"transmissionPower": "100%"
}
}
#!/bin/bash
# This script reads the config from a T-Mobile Gateway, showing it as JSON on STDOUT.
# This has been tested on the T-Mobile Arcadyan KVD21 gateway.
#
# Example usage:
#
# export GW_PASSWORD=your.gw.admin.password
# ./read-gw-config.sh > current-config.json
#
set -euo pipefail
: "${GW_PASSWORD:?Please set GW_PASSWORD to the gateway admin password}"
: "${GW_IP:=192.168.12.1}"
bearer_token=$(curl -sS -X POST "http://${GW_IP}/TMI/v1/auth/login" -d "{\"username\": \"admin\", \"password\": \"${GW_PASSWORD}\" }" | jq -r .auth.token)
curl -sS "http://${GW_IP}/TMI/v1/network/configuration?get=ap" -H "Authorization: Bearer ${bearer_token}"
#!/bin/bash
# This script writes the config for a T-Mobile Gateway. It reads the config from STDIN as JSON.
# This has been tested on the T-Mobile Arcadyan KVD21 gateway.
#
# Example usage:
#
# export GW_PASSWORD=your.gw.admin.password
# cat new-config.json | ./write-gw-config.sh
#
set -euo pipefail
: "${GW_PASSWORD:?Please set GW_PASSWORD to the gateway admin password}"
: "${GW_IP:=192.168.12.1}"
bearer_token=$(curl -sS -X POST "http://${GW_IP}/TMI/v1/auth/login" -d "{\"username\": \"admin\", \"password\": \"${GW_PASSWORD}\" }" | jq -r .auth.token)
curl -d "@-" "http://${GW_IP}/TMI/v1/network/configuration?set=ap" -H "Authorization: Bearer ${bearer_token}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment