{"id":17925001,"url":"https://github.com/mwpastore/rg_refresh","last_synced_at":"2025-04-03T11:15:10.479Z","repository":{"id":56892206,"uuid":"136396440","full_name":"mwpastore/rg_refresh","owner":"mwpastore","description":"Automated refresh script for the AT\u0026T Residential Gateway bypass","archived":false,"fork":false,"pushed_at":"2018-06-07T01:22:16.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-24T04:11:57.687Z","etag":null,"topics":["att-fiber","gigapower","network"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mwpastore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-06T23:26:57.000Z","updated_at":"2018-11-21T04:58:19.000Z","dependencies_parsed_at":"2022-08-20T16:10:21.452Z","dependency_job_id":null,"html_url":"https://github.com/mwpastore/rg_refresh","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwpastore%2Frg_refresh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwpastore%2Frg_refresh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwpastore%2Frg_refresh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwpastore%2Frg_refresh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mwpastore","download_url":"https://codeload.github.com/mwpastore/rg_refresh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246989753,"owners_count":20865331,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["att-fiber","gigapower","network"],"created_at":"2024-10-28T20:51:56.280Z","updated_at":"2025-04-03T11:15:10.454Z","avatar_url":"https://github.com/mwpastore.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rg_refresh\n\nExecute a VLAN \"flop\" to allow the AT\u0026T Residential Gateway (RG) to perform\n802.1x authentication via the Optical Network Terminal (ONT) before falling\nback to the subscriber's \"own\" router/gateway hardware. The RG is toggled off\nand on as needed via a remote-controlled power outlet (see below).\n\nFor more information about this procedure, please see brianlan's [original\ndocument][1] on DSL Reports.\n\n## Requirements\n\n* [Netgear gigabit-speed \"Smart Managed Plus\" switch][2]. The following models\n  are known to work:\n  * GS108Ev2\n  * GS105PE\n\n  Please submit a PR if you confirm another working model.\n* [MQTT broker][3] (like [this one][9])\n* \"Smart\" outlet that can be remotely-controlled (i.e. set \"on\" or \"off\") via a\n  message published to a MQTT bus. For example:\n  * SmartThings Hub, Zigbee or Z-Wave outlet, and [MQTT bridge][4]\n  * Z-Wave \"stick\" and outlet and [Home Assistant][5]\n  * Z-Wave \"stick\" and outlet and [MQTT bridge][6] (or [this one][7])\n  * Sonoff outlet flashed w/ [Tasmota][8] firmware\n* Host (for the script) with:\n  * Ruby interpreter\n  * Access to the Netgear management console via HTTP\n  * Access to the MQTT broker via TCP/IP\n\n\u003e N.B. With a SmartThings- or other cloud-based solution, an Internet\n\u003e connection is required to perform the VLAN flop, so if the operation fails\n\u003e (or is attempted after your router has already lost its DHCP lease), your\n\u003e network may get stuck in an inconsistent state. To recover, run the script\n\u003e and toggle the RG power manually as indicated.\n\n## Installation\n\nFollow the [guide][1] to establish the initial network environment, which\nincludes copying information from the RG to your own router. You should perform\nthe VLAN flop one time through by hand to make sure everything is set up and\nworking correctly. Jot down your VLAN IDs and port assignments for later.\n\nNext, pick a server where the script will run and install it:\n\n```console\n$ gem install rg_refresh\n```\n\nCreate a configuration file and write it somewhere sensible, e.g.\n`/etc/rg_refresh.yml`, using the following template:\n\n```yaml\n---\n:netgear:\n  # Tip: Give your switch a static IP address or DNS name if possible.\n  :address: 'http://a.b.c.d'\n  :password: password\n  :vlans:\n    :rg: 2\n    :my_router: 3\n  :ports_vlans:\n    # ONT is on switch port #1 in this example.\n    # Put .\u003cvlan\u003e to reference above VLAN assignments.\n    # Put ~ to preserve the port's current VLAN assignment; trailing ~ can be\n    # omitted if desired.\n    :reauth: [.rg, .rg, .my_router]\n    :bypass: [.my_router, .rg, .my_router]\n:mqtt:\n  :client:\n    # This section is passed to MQTT::Client.connect as-is.\n    # https://www.rubydoc.info/gems/mqtt/MQTT/Client#instance_attr_details\n    :host: localhost\n    :port: 1883\n  :topic: smartthings/RG/switch\n  :messages:\n    # Remember to quote YAML-reserved terms like \"on\" and \"off\".\n    :reauth: 'on'\n    :bypass: 'off'\n```\n\nRun the script to make sure it works correctly, passing in the path to the\nconfiguration file created above. For example:\n\n```console\n$ rg_refresh -c /etc/rg_refresh.yml\n```\n\nFinally, schedule the script to run once a week or so, during off-hours,\nand/or when your router loses its DHCP lease.\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run\n`rake test` to run the tests. You can also run `bin/console` for an interactive\nprompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To\nrelease a new version, update the version number in `version.rb`, and then run\n`bundle exec rake release`, which will create a git tag for the version, push\ngit commits and tags, and push the `.gem` file to\n[rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at\nhttps://github.com/mwpastore/rg_refresh.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT\nLicense](https://opensource.org/licenses/MIT).\n\n[1]: http://www.dslreports.com/forum/r29903721-AT-T-Residential-Gateway-Bypass-True-bridge-mode\n[2]: https://www.netgear.com/business/products/switches/web-managed/gigabit-web-managed-switch.aspx\n[3]: https://github.com/mqtt/mqtt.github.io/wiki/servers\n[4]: https://github.com/stjohnjohnson/smartthings-mqtt-bridge#readme\n[5]: https://www.home-assistant.io/components/mqtt/\n[6]: https://github.com/adpeace/zwave-mqtt-bridge#readme\n[7]: https://github.com/ltoinel/ZWave2MQTT#readme\n[8]: https://github.com/arendst/Sonoff-Tasmota/wiki/MQTT-Overview\n[9]: https://github.com/mcollina/mosca#readme\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmwpastore%2Frg_refresh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmwpastore%2Frg_refresh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmwpastore%2Frg_refresh/lists"}