Skip to main content

Python client for Verizon Fios router APIs (CR1000A web UI endpoints).

Project description

verizon-router-client

Python client for Verizon Fios router APIs (focused on the CR1000A web UI endpoints).

Features

  • Login/token helpers for the web UI.
  • Fetch status details (uptime, WAN IPs, DNS servers).
  • Read/write local DNS entries.
  • Read/add/remove port forwarding rules.
  • Parse known device lists.

Install

Local editable install:

pip install -e .

Or with uv:

uv pip install -e .

Quickstart

from verizon_router_client.cr1000a import VerizonRouterClient

client = VerizonRouterClient(
    base_url="https://192.168.1.1",
    # The router uses a hostname-bound TLS cert; this adapter handles it.
    tls_hostname="mynetworksettings.com",
)

client.login("admin", "your-password")

print(client.get_uptime_seconds())
print(client.get_wan_ipv4())
print(client.get_wan_ipv6())

DNS entries

from verizon_router_client.cr1000a import VerizonRouterClient

client = VerizonRouterClient(
    base_url="https://192.168.1.1",
    # The router uses a hostname-bound TLS cert; this adapter handles it.
    tls_hostname="mynetworksettings.com",
)
client.login("admin", "your-password")

print(client.get_dns_entries_v4())
slot = client.add_dns_ipv4("nas", "192.168.1.10")
client.clear_dns_ipv4_slot(slot)

Port forwarding

from verizon_router_client.cr1000a import VerizonRouterClient

client = VerizonRouterClient(
    base_url="https://192.168.1.1",
    # The router uses a hostname-bound TLS cert; this adapter handles it.
    tls_hostname="mynetworksettings.com",
)
client.login("admin", "your-password")

rule_id = client.add_port_forward(
    name="ssh",
    private_ip="192.168.1.20",
    forward_port=22,
    dest_port=22,
)

client.remove_port_forward(rule_id=rule_id)

Known devices

from verizon_router_client.cr1000a import VerizonRouterClient

client = VerizonRouterClient(
    base_url="https://192.168.1.1",
    # The router uses a hostname-bound TLS cert; this adapter handles it.
    tls_hostname="mynetworksettings.com",
)
devices = client.fetch_known_devices()

If you are not already logged in, pass a sysauth cookie value:

from verizon_router_client.cr1000a import VerizonRouterClient

client = VerizonRouterClient(
    base_url="https://192.168.1.1",
    # The router uses a hostname-bound TLS cert; this adapter handles it.
    tls_hostname="mynetworksettings.com",
)
devices = client.fetch_known_devices(sysauth_cookie_value="...")

TLS notes

By default the client uses the bundled Verizon Fios root CA (cert/Verizon Fios Root CA.pem) and sets the TLS SNI/Host header to mynetworksettings.com when the base URL is an IP. If your router uses different TLS settings, override verify_tls or tls_hostname.

Development

  • Python: 3.9+
  • Runtime dependency: requests

Kubernetes Operator

The verizon-router-client can also be deployed as a Kubernetes operator using kopf. The operator manages custom resources for DNS and Port Forwarding.

Setup

First, install the package with operator dependencies:

pip install -e ".[operator]"

Or build and use the provided Docker image:

docker build -t verizon-router-operator:latest .

Apply CRDs & RBAC

Apply the Custom Resource Definitions (CRDs) and Role-Based Access Control (RBAC):

kubectl apply -f k8s/crd-fiosdnsrecord.yaml
kubectl apply -f k8s/crd-fiosportforward.yaml
kubectl apply -f k8s/rbac.yaml

Configure Authentication

Create a secret with your router password:

kubectl create secret generic verizon-router-secret \
  --from-literal=password='YOUR_ROUTER_PASSWORD'

Deploy the operator:

kubectl apply -f k8s/deployment.yaml

Custom Resources

You can now manage your router via standard Kubernetes manifests.

Add a DNS Record:

apiVersion: network.verizon.com/v1alpha1
kind: FiosDnsRecord
metadata:
  name: nas-entry
spec:
  hostname: nas
  ip: 192.168.1.10

Add a Port Forwarding Rule:

apiVersion: network.verizon.com/v1alpha1
kind: FiosPortForward
metadata:
  name: ssh-forward
spec:
  name: ssh
  private_ip: 192.168.1.20
  forward_port: 22
  dest_port: 22

Disclaimer

This project is not affiliated with Verizon. Use at your own risk.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

verizon_router_client-0.2.0.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

verizon_router_client-0.2.0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file verizon_router_client-0.2.0.tar.gz.

File metadata

  • Download URL: verizon_router_client-0.2.0.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for verizon_router_client-0.2.0.tar.gz
Algorithm Hash digest
SHA256 329e565bbe63c0f6b743c70f79cfa3a29202801d0c55f704a5f6da7de133fb2c
MD5 e2399a272867f8b3b7d58c2d0ae42021
BLAKE2b-256 1ce7cc845a0f4b3b7cdb146447fff9d26cea1008681db25677de07070a6887bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for verizon_router_client-0.2.0.tar.gz:

Publisher: release.yml on Brishen/verizon_router_client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file verizon_router_client-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for verizon_router_client-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ea84a46438c7dc3e19fdbf72c53e98ba769c9ffdb7f6b36c1b9452201b3550bd
MD5 0982b5b21fc8aba76372495d968b02a0
BLAKE2b-256 df17369397546603c0e369723385041708e1f4e07e72c095c7b3f06b5de5cfdd

See more details on using hashes here.

Provenance

The following attestation bundles were made for verizon_router_client-0.2.0-py3-none-any.whl:

Publisher: release.yml on Brishen/verizon_router_client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page