You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python library for AT&T Fiber Gateways (BGW210, BGW320, CGW452).
Installation
pip install att-gateway-api
Or install from source:
pip install -e .
Usage
As a library
importasynciofromatt_gatewayimportATTGatewayClientasyncdefmain():
asyncwithATTGatewayClient(
host="192.168.1.254", # or your gateway IPpassword="your-device-access-code",
) asclient:
# Get broadband statisticsstats=awaitclient.get_broadband_stats()
print(f"Downstream: {stats.downstream.rate_mbps} Mbps")
print(f"Upstream: {stats.upstream.rate_mbps} Mbps")
print(f"Uptime: {stats.uptime_str}")
# Get device infoinfo=awaitclient.get_device_info()
print(f"Model: {info.model}")
print(f"Firmware: {info.firmware_version}")
# Get NAT tablenat=awaitclient.get_nat_table()
print(f"NAT entries: {nat.count} / {nat.max_entries}")
asyncio.run(main())
CLI
# Test connection
att-gateway --host 192.168.1.254 test# Get broadband stats
att-gateway --host 192.168.1.254 stats
# Get device info
att-gateway --host 192.168.1.254 info
# Get NAT table
att-gateway --host 192.168.1.254 nat
# Get raw HTML from any endpoint
att-gateway --host 192.168.1.254 raw broadband
att-gateway --host 192.168.1.254 raw /cgi-bin/custom.ha
Supported Gateways
Model
Type
Tested
Notes
BGW210-700
Fiber
Expected to work
Same firmware base
BGW320-500
Fiber
Expected to work
Same firmware base
BGW320-505
Fiber
Expected to work
Nokia hardware, Arris firmware
CGW452-400
5G Fiber
✅ Tested
Includes cellular/mobility status
All gateways use the same Arris-based web interface. The only model-specific feature is get_mobility_status() which is only available on 5G gateways (CGW452).
Authentication
The gateway uses nonce-based MD5 authentication. The password is the Device Access Code found on the back of your gateway.
Many status endpoints (broadband, fiber, devices) work without authentication. Configuration endpoints require the device access code.
Available Endpoints
Status (No Auth Required)
Method
Description
get_broadband_stats()
WAN connection, IP addresses, traffic stats
get_fiber_stats()
SFP module, optical power levels
get_device_info()
Model, serial, firmware, MAC address
get_lan_status()
Ethernet ports, DHCP status
get_device_list()
Connected devices (wired + wireless)
get_firewall_log()
Blocked traffic entries
get_firewall_status()
Firewall settings
get_voip_status()
Voice line status
get_home_status()
Quick overview
Status (Auth Required)
Method
Description
get_nat_table()
Active NAT connections
get_mobility_status()
5G/LTE signal, cell info (CGW452 only)
get_speed_test_history()
Past speed test results
Configuration (Auth Required)
Method
Description
get_wifi_config()
SSID, security, channels
get_dhcp_config()
DHCP server settings
get_ip_allocation()
DHCP reservations
get_ip_passthrough_config()
IP passthrough settings
get_port_forwarding()
Port forwarding rules
get_mac_filter_config()
MAC filtering
get_ethernet_lan_config()
Port speed/duplex
get_ipv6_lan_config()
IPv6 settings
get_broadband_config()
WAN MTU, VLAN
get_firewall_advanced()
DoS protection
get_syslog_config()
Remote logging
get_event_notifications()
Email alerts
get_remote_access()
Remote management
Bulk Methods
Method
Description
get_all_data()
Fetch all status data in parallel
get_all_config()
Fetch all config data in parallel
validate_connection()
Test connectivity and auth
Diagnostics (Auth Required)
Method
Description
ping(target)
Ping from gateway
traceroute(target)
Traceroute from gateway
nslookup(hostname)
DNS lookup from gateway
run_diagnostics()
Full network diagnostics
run_speed_test()
Run speed test (impacts network)
Actions (Auth Required)
Method
Description
restart_device()
Reboot gateway
reset_connection()
Reset WAN connection
reset_ip()
Release/renew DHCP
License
MIT
About
Python API for AT&T Fiber Gateways (BGW210, BGW320, CGW452)