Skip to content

Add Google IP address list updater script for RouterOS - #14

Merged
gpas45 merged 1 commit into
mainfrom
claude/charming-hopper-jmw79h
Jun 12, 2026
Merged

Add Google IP address list updater script for RouterOS#14
gpas45 merged 1 commit into
mainfrom
claude/charming-hopper-jmw79h

Conversation

@gpas45

@gpas45 gpas45 commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Summary

Added a new RouterOS script that automatically downloads and maintains an up-to-date list of Google's public IP address ranges for policy routing and VPN purposes.

Changes

  • New file: routeros/google-ip-updater.rsc

    • Fetches official Google IP ranges from https://www.gstatic.com/ipranges/goog.json
    • Parses JSON response to extract IPv4 prefixes without requiring temporary files
    • Updates RouterOS address-list named VPN_ytb with Google's IP ranges
    • Includes error handling for network failures, empty responses, and invalid entries
    • Provides detailed logging of operations (added/removed/skipped entries)
    • Compatible with RouterOS 6.43+ and 7.x
  • Updated: README.md

    • Added documentation entry for the new google-ip-updater.rsc script

Implementation Details

  • In-memory JSON parsing: Downloads JSON directly into a variable and parses it using string operations, avoiding temporary file creation
  • Safe list updates: Collects all valid entries before updating the address-list, preventing the list from becoming empty during updates
  • Robust error handling: Gracefully handles network errors, malformed JSON, and invalid CIDR entries with appropriate logging
  • Scheduler-ready: Designed to run on a schedule (e.g., daily/weekly) via RouterOS scheduler
  • TLS flexibility: Uses check-certificate=no for environments without complete CA certificate stores

https://claude.ai/code/session_01G7uENR3Un39dzN9EVxjZfk

Parses official goog.json and loads IPv4 prefixes into the VPN_ytb
address-list. Follows the cloudflare/telegram updater house style:
fetch with check-certificate=no + error handling, nil-safe JSON
parsing (no infinite-loop risk), temp-array build then swap so the
list is never empty mid-update, and summary logging.
@gpas45
gpas45 merged commit 36147f5 into main Jun 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants