Skip to content

RUT Router Provisioning Automation #34

Description

@fe51

Goal

Provide a simple, repeatable way to provision Teltonika RUT routers using a single shell script and environment variables.

The goal is to replace manual web UI configuration with a minimal SSH-based setup process.

Scope

This automation covers:

  • Initial admin password setup/change
  • SIM PIN configuration (if required)
  • Firewall rules to block Internet access for camera devices

No additional features are included.

User Workflow (suggested)

cp router/.env.example router/.env
# edit values
nano router/.env
# run the script
./router/provision.sh

Steps:

  1. Connect router to local network
  2. Ensure router is reachable via SSH
  3. Insert SIM card
  4. Fill .env
  5. Run provisioning script
  6. Wait for completion (may include reboot)
  7. Run post-provisioning connectivity check (admin access + WAN/internet via mobile)

Configuration Variables

Required

ROUTER_IP=192.168.1.1
DEFAULT_ADMIN_PASSWORD=password_written_on_device
ADMIN_PASSWORD=your_admin_password

Optional

SIM_PIN=1234
CAMERA_IPS=192.168.1.50,192.168.1.51,192.168.1.52

Provisioning Tasks

The provision.sh script must:

  • Connect to router via SSH
  • Change or enforce administrator password
  • Configure SIM PIN if provided
  • Apply firewall rules to block Internet access for camera IPs (if provided)
  • Persist configuration changes
  • Reload firewall and/or network services
  • Reboot router if required to apply changes safely
  • Run checks

Firewall Behavior

If CAMERA_IPS is defined:

  • Each IP must be blocked from accessing WAN (Internet)
  • LAN-to-LAN communication must remain unaffected
  • Internal access from trusted devices must remain possible

Implementation Notes

  • SSH access is assumed to be available on first provisioning
  • Configuration should use standard OpenWrt/RutOS mechanisms (e.g. uci)
  • Script should be idempotent when possible but this is not a strict requirement
  • Fail fast on SSH connection or authentication errors

Documentation Requirement

The main README must include a short section:

Router Setup

cp router/.env.example router/.env
vim router/.env
./router/provision.sh

No additional explanation required in the main README.


Non-Goals

  • No web UI automation
  • No cloud or remote management platform
  • No fleet orchestration system
  • No VLAN / network redesign
  • No long-term configuration management

Future Improvements (optional)

  • DHCP reservation for camera devices
  • Support for multiple router models
  • Validation of connectivity after provisioning

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions