Skip to main content

Detect simulated route table changes using Invariant

To detect changes in simulated route tables between two network snapshots, fetch the routes report for each snapshot and compare them.

First, retrieve the routes report for your current snapshot and save it as JSON. Replace <current_snapshot_uuid> with the actual snapshot ID.

invariant show routes --snapshot <current_snapshot_uuid> --json > current_routes.json

Next, retrieve the routes report for the previous or baseline snapshot you want to compare against. Replace <previous_snapshot_uuid> with its ID.

invariant show routes --snapshot <previous_snapshot_uuid> --json > previous_routes.json

Finally, use a diff tool to compare the two JSON files. Differences indicate changes in the route tables between the snapshots.

diff current_routes.json previous_routes.json
# Example output might show added (+) or removed (-) routes:
# < "Network": "10.20.0.0/16",
# < "Next_Hop_IP": "169.254.25.161",
# ---
# > "Network": "10.20.0.0/16",
# > "Next_Hop_IP": "0.0.0.0", # Example change indicating route loss

See Output > Network Information > routes for report details.