Skip to content

Instantly share code, notes, and snippets.

@natemccurdy
Last active June 9, 2024 04:54
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": "6",
"channelBandwidth": "20MHz",
"isMUMIMOEnabled": true,
"isRadioEnabled": true,
"isWMMEnabled": true,
"maxClients": 128,
"mode": "auto",
"transmissionPower": "100%"
},
"5.0ghz": {
"airtimeFairness": true,
"channel": "149",
"channelBandwidth": "40MHz",
"isMUMIMOEnabled": true,
"isRadioEnabled": true,
"isWMMEnabled": true,
"maxClients": 128,
"mode": "auto",
"transmissionPower": "100%"
},
"bandSteering": {
"isEnabled": true
},
"ssids": [
{
"2.4ghzSsid": true,
"5.0ghzSsid": true,
"encryptionMode": "AES",
"encryptionVersion": "WPA2/WPA3",
"guest": false,
"isBroadcastEnabled": true,
"ssidName": "wi fi? wi not fi",
"wpaKey": "CCD7E118-F6F8-440D-9383-9FC0754F3F16"
}
]
}
#!/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/v2?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 -v -d "@-" "http://${GW_IP}/TMI/v1/network/configuration/v2?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