Blog

  • High Availability (HA) configuration for Cisco Meraki MX67

    ⚙️ About HA in Meraki MX67

    • Meraki MX67 supports Warm Spare / High Availability (HA) in Active–Passive mode.
    • You need two MX67 appliances (same model) and Advanced Security license for each (or a single shared license if you have Meraki’s per-network licensing).
    • The HA works by monitoring uplinks and LAN, and failing over automatically if the primary fails.

    🛠 How to configure HA in Meraki MX67

    ✅ 1. Physical setup

    • Place both MX67 units on the same LAN segment.
    • Connect:
      • Each MX to the Internet (same or different uplinks).
      • The LAN ports of both MXs to the same switch or switches.
    • Connect the dedicated HA/Spare port (Port 4 on MX67) from the primary to the secondary (this is the Heartbeat connection).

    Tip: Make sure the heartbeat cable is direct or via switch but must be in the same VLAN/subnet.


    ✅ 2. Configure in Meraki Dashboard

    1. Go to: Security & SD-WAN > Monitor > Appliance status
    2. Add the secondary MX:
      • Go to Security & SD-WAN > Configure > Addressing & VLANs.
      • Enable Warm Spare.
    3. Enter the serial number of the secondary MX in the Warm Spare field.
    4. Dashboard automatically creates:
      • Shared Virtual IP (VIP) for WAN.
      • Shared Virtual IP for LAN.

    ⚠ Both MXs must be in the same network in the Meraki Dashboard.


    ✅ 3. WAN configuration

    • If you have multiple WAN uplinks, configure WAN1 and WAN2 on both MXs identically.
    • Ensure the ISP allows the use of a Virtual IP (VIP).

    ✅ 4. LAN configuration

    • LAN interfaces should be identical.
    • Enable Use MX uplink IPs or configure Virtual IPs:
      • WAN VIP: shared IP that moves between MXs.
      • MX uplink IPs: individual IPs on each MX.

    📊 Failover

    • Heartbeat checks happen over the dedicated HA port.
    • Failover typically occurs in seconds (about 30 seconds or less).

    Verify HA status

    • In Dashboard: Security & SD-WAN > Appliance status → Warm Spare status shows which is active.
    • You can simulate failover by disconnecting the primary MX uplink.

    🔒 Important notes:

    • Meraki MX HA is Active-Passive; no Active-Active.
    • Both MXs must be the same model and firmware.
    • Heartbeat connection is essential for proper failover detection.
    • Use Virtual IP for seamless failover.
  • How to set a bandwidth restriction per individual user on Sophos Firewall (SFOS v19.5 or v20.x)

    Goal:

    Limit each user to:

    • Download: 2 Mbps
    • Upload: 512 Kbps

    (You can change numbers as needed.)


    🛠 Step-by-step

    Step 1: Create Traffic Shaping Policy

    1. Log in to Sophos Firewall web admin (https://<firewall-ip>:4444)
    2. Go to:
      Protect > Traffic Shaping
    3. Click Add
    4. Fill like this:
      | Field | Example |
      |——|———|
      | Name | Limit_2Mbps_per_user |
      | Policy Association | User |
      | Rule type | Individual |
      | Priority | 5 (lower is higher priority) |
      | Bandwidth usage type | Limit |
      | Guaranteed bandwidth | (leave empty) |
      | Maximum bandwidth (download) | 2048 Kbps |
      | Maximum bandwidth (upload) | 512 Kbps |

    Save


    Step 2: Apply to individual users

    1. Go to:
      Authentication > Users
    2. Click on the user you want to limit
    3. Under Traffic shaping policy, choose:
      Limit_2Mbps_per_user
    4. Save

    Repeat for each user you want to limit.


    Step 3: Confirm the firewall rule matches

    Bandwidth limit only applies to traffic that matches a firewall rule.

    1. Go to:
      Rules and Policies > Firewall Rules
    2. Confirm you have a rule like:
    • Source zone: LAN
    • Destination zone: WAN
    • User/Network: Any or specific users
    1. If you already have a firewall rule for internet access, you don’t need to change it.
    2. If you want to create a dedicated rule:
    • Click Add Firewall Rule > New User/Network Rule
    • Source zone: LAN
    • Destination zone: WAN
    • Source network: users you want to limit
    • Apply as needed

    Step 4: Test & Monitor

    Go to:
    Monitor & Analyze > Current Activities > Live Users

    Watch the bandwidth column to see usage stays around your limit.

    You can also see under:

    • Monitor & Analyze > Current Activities > Live Connections

    📝 Sample Traffic Shaping Policy Screenshot (for reference)

    NameLimit_2Mbps_per_user
    Policy associationUser
    Rule typeIndividual
    Priority5
    Guaranteed download(leave empty)
    Guaranteed upload(leave empty)
    Max download2048 Kbps
    Max upload512 Kbps

    Summary

    • Create a User-based, Individual traffic shaping policy
    • Apply it to each user under Authentication > Users
    • Make sure there’s a firewall rule that matches those users’ traffic
  • High Availability status in Aruba Mobility Controller

    To check the High Availability (HA) status in an Aruba Mobility Controller, you can use the CLI (Command Line Interface) or the Web UI. Here’s how you can do it:


    🔧 Using CLI (SSH or Console):

    1. Login to the controller via SSH or console.
    2. Run the following command:

    show ha

    This will display the HA configuration and status including:

    • Role (Active/Standby)
    • HA state (UP/DOWN)
    • Synchronization status
    • Heartbeat info
    • Peer IP and state

    💡 Additional Useful CLI Commands:

    Command Description show ha Shows general HA status show ha group-membership Shows the group membership of controllers in HA setup show switchinfo Shows controller role (master, standby, etc.) show redundancy Displays detailed HA redundancy state show log system 50 Check system logs for HA-related events


    🌐 Using Web UI:

    1. Log in to the Aruba Controller Web UI.
    2. Go to Configuration > Redundancy or Dashboard > System > Redundancy (depending on firmware).
    3. You’ll see the controller role, peer info, and synchronization status.

    📝 Tips:

    • Active controller handles client traffic.
    • Standby controller takes over if the active one fails.
    • Ensure both controllers are synchronized and licenses are shared if using license pooling.

  • SNMP v2c on Aruba (HPE) switch

    Here’s how to configure SNMP v2c on an Aruba (HPE) switch, specifically for the ArubaOS-Switch series (formerly HP ProCurve).


    🔧 SNMP v2c Configuration Steps – ArubaOS-Switch (CLI)

    1. Enable SNMP Service (if not already enabled)

    switch(config)# snmp-server

    2. Set the SNMP Read-Only Community String

    switch(config)# snmp-server community public operator-unrestricted

    • public – replace with your preferred community string.
    • operator-unrestricted – gives read-only access.

    3. Set the SNMP Read-Write Community String (if needed)

    switch(config)# snmp-server community private manager-unrestricted

    • private – change to a secure community name.
    • manager-unrestricted – allows full configuration access.

    4. Define SNMP Trap Receiver (Optional)

    switch(config)# snmp-server host 192.168.1.100 community public

    • Replace 192.168.1.100 with your SNMP monitoring server IP.

    5. Enable SNMP Traps (Optional)

    switch(config)# snmp-server enable traps


    ✅ Example Configuration

    switch(config)# snmp-server switch(config)# snmp-server community monitor operator-unrestricted switch(config)# snmp-server community manage manager-unrestricted switch(config)# snmp-server host 192.168.1.10 community monitor switch(config)# snmp-server enable traps


    🔍 To Verify Configuration

    show snmp-server


  • 🤖 Bridging Manual AWS Infrastructure to Terraform: Automating Security Group Imports with Python

    In modern cloud engineering, Infrastructure as Code (IaC) is more than a best practice—it’s a necessity. But what happens when your AWS infrastructure already exists, created manually through the console or scripts, long before Terraform entered the picture?

    This blog post walks through a hybrid solution: using Python and Boto3 to detect and import existing AWS Security Groups into Terraform, then converting them into reproducible, editable .tf files. It’s fast, scalable, and minimizes human error.


    🚩 Problem Statement

    Many teams start their cloud journey without IaC. As the environment grows, managing resources manually becomes error-prone and unscalable. Transitioning to Terraform becomes inevitable—but re-creating everything manually in .tf files is:

    • Time-consuming
    • Risky
    • Hard to validate

    💡 Solution:

    Use Python to automate the Terraform import process and dynamically generate configuration files per AWS Security Group.


    ⚙️ Tech Stack

    ToolRole
    TerraformInfrastructure provisioning
    Python (Boto3)AWS resource discovery
    AWS CLI / IAM RoleCredentials & API access
    Shell CommandsAutomating imports

    🔄 Workflow Overview

    • Discover all Security Groups in a region
    • Create Terraform directories per group
    • Write provider.tf and main.tf
    • Run terraform import to sync state
    • Output the state into HCL format via terraform show
    • Format and validate using terraform fmt

      📜 Python Script Breakdown

      Here’s the key automation script: securitygroupimporter.py

      import boto3
      import os

      region = "us-west-1"
      client = boto3.client('ec2', region_name=region)

      for group in client.describe_security_groups()['SecurityGroups']:
      dir_name = group['GroupId']
      os.system("mkdir " + dir_name)

      with open(os.path.join(dir_name, "provider.tf"), "w") as file:
      file.write(f"""provider "aws" {{
      region = "{region}"
      }}""")

      with open(os.path.join(dir_name, "main.tf"), "w") as file:
      file.write(f"""resource "aws_security_group" "imported_sg_tf" {{
      name = "{group['GroupName']}"
      description = "{group['Description']}"
      vpc_id = "{group['VpcId']}"
      }}""")

      os.system(f"cd {dir_name} && terraform init && terraform fmt && terraform import aws_security_group.imported_sg_tf {group['GroupId']} && terraform show -no-color > main.tf")

      🧾 Example Output

      The script generates a clean folder structure like:

      bashCopyEditsg-0a1b2c3d4e5f67890/
      ├── provider.tf  # AWS provider config
      ├── main.tf      # Full resource definition (after import)
      

      This makes it easy to commit, audit, and manage each security group individually.


      📦 Terraform Usage

      Once the .tf files are created:

      cd sg-0a1b2c3d4e5f67890
      terraform plan
      terraform apply

      You can now modify the SG rules as code and re-apply them safely!


      📈 Benefits of This Approach

      No Manual Rewrites: Automates tedious .tf file generation
      Version Control: All SGs under Git with Terraform
      Audit-Friendly: Clear, editable .tf source
      Repeatable: Works in any region with any account
      Safe Migration: No downtime or resource recreation


      💡 Possible Enhancements

      Here’s how we can take this further:

      • ✳️ Add user prompts for selective SG import
      • 🔍 Extract individual ingress/egress rules instead of full state dump
      • 📦 Refactor into reusable Terraform modules
      • 📊 Add CloudWatch alerts for drift detection
      • ⚙️ Integrate into CI/CD pipeline

      🌐 Real-World Use Case

      Imagine you’re handed an AWS account with 100+ resources but no existing Terraform config. This script gives you a jumpstart, extracting current state and turning it into a fully manageable codebase — all without starting from scratch.


      🔐 Security Considerations

      • Use IAM roles with read-only EC2 access
      • Validate the Terraform plan before applying changes
      • Consider sanitizing or encrypting sensitive outputs if saved

      📸 Architecture Diagram

      This tool can be a part of a larger provisioning pipeline (e.g., VPCs, EC2, Load Balancers, etc.).


      🧪 Try It Yourself

      pip install boto3
      export AWS_ACCESS_KEY_ID=...
      export AWS_SECRET_ACCESS_KEY=...
      python securitygroupimporter.py

      Each SG is imported and converted into Terraform-ready format in its own folder. You can version it, tweak rules, and manage it from here on out like any other .tf module.


      🧩 Final Thoughts

      Cloud infrastructure is not always born as code — but it should evolve that way. With this approach, we take a real-world AWS environment and transform it into Terraform IaC with minimal friction.

      This saves hours of repetitive work and brings undocumented infrastructure under the umbrella of security, compliance, and automation.


      🤝 Let’s Connect

      If you found this useful or have ideas to improve it, let’s talk!
      I’d love to collaborate with other DevOps engineers and cloud enthusiasts.

      📬 DM me on LinkedIn or drop a comment below.


      #Terraform #AWS #Python #Boto3 #DevOps #InfrastructureAsCode #IaC #CloudMigration #Security #Automation

    1. Dual internet configuration using BGP in cisco router

      To configure dual internet connections using BGP on a Cisco router for redundancy and failover, follow these key steps and considerations:

      Basic BGP Configuration

      Establish BGP Sessions with Both ISPs
      Configure BGP neighbors using the ISPs’ AS numbers and your assigned ASN. For example:
      router bgp 65001
      neighbor 203.0.113.1 remote-as ISP1_ASN
      neighbor 198.51.100.1 remote-as ISP2_ASN
      address-family ipv4
      network 192.0.2.0 mask 255.255.255.0 # Advertise your public subnet
      exit-address-family

      Replace ISP1_ASN and ISP2_ASN with the respective ISP AS numbers

      Advertise Networks
      Use the network command to announce your public IP ranges to both ISPs. Ensure both ISPs accept the advertised prefixes

      Traffic Control and Path Selection

      Outbound Traffic

      Local Preference: Prioritize one ISP for outbound traffic by setting a higher local preference (default is 100):

      route-map PREFER_ISP1 permit 10

      set local-preference 200

      !

      router bgp 65001

      neighbor 203.0.113.1 route-map PREFER_ISP1 in

      This makes ISP1 the preferred path

      Inbound Traffic

      AS Path Prepending: Lengthen the AS path for the backup ISP to make the primary ISP more attractive:

      route-map PREPEND_ISP2 out

      set as-path prepend 65001 65001 65001

      !

      router bgp 65001

      neighbor 198.51.100.1 route-map PREPEND_ISP2 out

      This reduces the likelihood of inbound traffic using ISP2 unless ISP1 fails

      Failover Mechanisms

      BGP Conditional Advertisement
      Advertise routes to the backup ISP only if the primary ISP’s BGP session fails:

      router bgp 65001

      neighbor 198.51.100.1 advertise-map ADVERTISE_ONLY_IF_ISP1_DOWN non-exist-map CHECK_ISP1

      !

      ip prefix-list ISP1_ROUTES seq 5 permit 203.0.113.0/24

      !

      route-map CHECK_ISP1 permit 10

      match ip address prefix-list ISP1_ROUTES

      !

      route-map ADVERTISE_ONLY_IF_ISP1_DOWN permit 10

      set ip address prefix-list YOUR_PUBLIC_SUBNET

      This ensures ISP2 receives your prefix only when ISP1 is unavailable

      Fast External Fall over
      Enable rapid detection of link failures:

      router bgp 65001

      bgp fast-external-fallover

      This terminates BGP sessions immediately if the physical interface goes down3.

      Additional Considerations

      • NAT Configuration: If using NAT, ensure the firewall or router translates internal addresses to the public IPs provided by the primary ISP. Verify the secondary ISP allows routing the primary’s IP range35.
      • Default Routes: Receive default routes from both ISPs using neighbor <IP> default-originate or configure static defaults with floating AD values for backup25.
      • Route Filtering: Use prefix-lists or route-maps to filter unwanted routes from ISPs to prevent becoming a transit AS5.

      Verification Commands

      • Check BGP neighbor status:
        show ip bgp summary
      • Verify advertised/received routes:
        show ip bgp neighbors <IP> advertised-routes
        show ip bgp neighbors <IP> routes
      • Monitor path selection:
        show ip bgp

      By combining these techniques, you achieve redundancy, control traffic flow, and automate failover. Always coordinate with ISPs to ensure they accept your BGP policies

    2. Enhanced Python script for Meraki Switch with VLAN deletion or port monitoring

      • ✅ VLAN creation
      • ❌ VLAN deletion
      • 🔧 Switch port config
      • 👀 Port monitoring (get port status like usage, errors)

      🧰 Full Python Script – Meraki Switch Automation

      import requests

      # Config
      API_KEY = "YOUR_MERAKI_API_KEY"
      ORG_ID = "YOUR_ORG_ID"
      NETWORK_ID = "YOUR_TEMPLATE_BOUND_NETWORK_ID"
      DEVICE_SERIAL = "YOUR_SWITCH_SERIAL" # Example: Q2XX-XXXX-XXXX

      BASE_URL = "https://api.meraki.com/api/v1"

      HEADERS = {
      "X-Cisco-Meraki-API-Key": API_KEY,
      "Content-Type": "application/json"
      }

      # --- VLAN FUNCTIONS ---

      # ✅ Create VLAN
      def create_vlan(vlan_id, name, subnet, appliance_ip):
      url = f"{BASE_URL}/networks/{NETWORK_ID}/vlans"
      payload = {
      "id": vlan_id,
      "name": name,
      "subnet": subnet,
      "applianceIp": appliance_ip
      }
      response = requests.post(url, headers=HEADERS, json=payload)
      print(f"[CREATE VLAN {vlan_id}] Status: {response.status_code} - {response.text}")

      # ❌ Delete VLAN
      def delete_vlan(vlan_id):
      url = f"{BASE_URL}/networks/{NETWORK_ID}/vlans/{vlan_id}"
      response = requests.delete(url, headers=HEADERS)
      print(f"[DELETE VLAN {vlan_id}] Status: {response.status_code} - {response.text}")

      # --- PORT FUNCTIONS ---

      # 🔧 Configure Switch Port
      def configure_switch_port(port_number, port_name="Trunk Port", allowed_vlans="1,10,20"):
      url = f"{BASE_URL}/devices/{DEVICE_SERIAL}/switch/ports/{port_number}"
      payload = {
      "name": port_name,
      "type": "trunk",
      "vlan": 1,
      "allowedVlans": allowed_vlans,
      "poeEnabled": True,
      "rstpEnabled": True,
      "stpGuard": "disabled"
      }
      response = requests.put(url, headers=HEADERS, json=payload)
      print(f"[CONFIGURE PORT {port_number}] Status: {response.status_code} - {response.text}")

      # 👀 Get Port Status
      def get_port_status():
      url = f"{BASE_URL}/devices/{DEVICE_SERIAL}/switch/ports"
      response = requests.get(url, headers=HEADERS)
      if response.status_code == 200:
      ports = response.json()
      for port in ports:
      print(f"Port {port['portId']}: {port.get('enabled', 'N/A')} | "
      f"Type: {port.get('type')} | VLAN: {port.get('vlan')} | "
      f"Usage: {port.get('usageInKb', 'N/A')} Kbps")
      else:
      print(f"[GET PORT STATUS] Error: {response.status_code} - {response.text}")

      # --- EXECUTION ---

      # VLAN Management
      create_vlan(10, "Staff", "192.168.10.0/24", "192.168.10.1")
      create_vlan(20, "IoT", "192.168.20.0/24", "192.168.20.1")
      # delete_vlan(20) # Uncomment to delete VLAN 20

      # Port Configurations
      configure_switch_port(1)
      configure_switch_port(2, port_name="Uplink to Router")

      # Port Monitoring
      get_port_status()




      ✅ Output Example:

      [CREATE VLAN 10] Status: 201 - {"id":"10",...}
      [CONFIGURE PORT 1] Status: 200 - { ... }
      Port 1: True | Type: trunk | VLAN: 1 | Usage: 120 Kbps


      🛡️ Recommendations:

      • Use environment variables or config files for sensitive info (API keys).
      • Add retry logic or logging for production scripts.
      • Use the Meraki Python SDK (meraki package) if you prefer an abstracted interface.
    3. Python script using the Meraki Dashboard API to automate switch port configuration and VLAN creation in a template-bound network.

      🔐 Step 1: Setup

      Make sure you have:

      • API key from Meraki Dashboard (keep it secret!)
      • Template-bound Network ID
      • requests library installed (pip install requests)

      🧠 Step 2: Python Script

      import requests

      # Replace with your Meraki API key
      API_KEY = "YOUR_MERAKI_API_KEY"
      ORG_ID = "YOUR_ORG_ID"
      NETWORK_ID = "YOUR_TEMPLATE_BOUND_NETWORK_ID"
      DEVICE_SERIAL = "YOUR_SWITCH_SERIAL" # e.g., Q2XX-XXXX-XXXX

      # Meraki base URL
      BASE_URL = "https://api.meraki.com/api/v1"

      # Headers
      HEADERS = {
      "X-Cisco-Meraki-API-Key": API_KEY,
      "Content-Type": "application/json"
      }

      # Step 1: Create VLAN
      def create_vlan(vlan_id, name, subnet, appliance_ip):
      url = f"{BASE_URL}/networks/{NETWORK_ID}/vlans"
      payload = {
      "id": vlan_id,
      "name": name,
      "subnet": subnet,
      "applianceIp": appliance_ip
      }
      response = requests.post(url, headers=HEADERS, json=payload)
      print(f"VLAN Creation ({vlan_id}):", response.status_code, response.text)

      # Step 2: Configure a switch port
      def configure_switch_port(port_number):
      url = f"{BASE_URL}/devices/{DEVICE_SERIAL}/switch/ports/{port_number}"
      payload = {
      "name": "Uplink Port",
      "type": "trunk",
      "vlan": 1,
      "allowedVlans": "1,10,20",
      "poeEnabled": True,
      "rstpEnabled": True,
      "stpGuard": "disabled"
      }
      response = requests.put(url, headers=HEADERS, json=payload)
      print(f"Port {port_number} Config:", response.status_code, response.text)

      # --- Execution ---
      # Create VLANs
      create_vlan(10, "Staff", "192.168.10.0/24", "192.168.10.1")
      create_vlan(20, "IoT", "192.168.20.0/24", "192.168.20.1")

      # Configure ports 1 and 2 as trunk ports
      configure_switch_port(1)
      configure_switch_port(2)


      📝 Customize As Needed

      • Change NETWORK_ID and DEVICE_SERIAL to match your environment.
      • You can loop through multiple ports/VLANs for bulk updates.
      • Add error handling for production use.
    4. How to Create and Modify Meraki Switch Templates

      🧩 1. What is a Meraki Switch Template?

      In Cisco Meraki, templates are configurations that can be applied across multiple networks, especially useful in large-scale deployments to ensure consistency.

      • A switch template allows you to configure:
        • VLANs
        • Port settings
        • STP settings
        • QoS policies
        • Link aggregation
        • Access policies (802.1X)
        • Voice VLANs
        • PoE settings

      🖥️ 2. Creating a Switch Template (via GUI)

      • Login to the Meraki Dashboard
      • Go to:
        Organization > Configuration templates
      • Click “Create a new template”
      • Name your template (e.g., Branch-Switch-Template)
      • Click Create
      • Click on the template name → Switch tab
      • Configure:
        • VLANs under Switch settings > Routing and DHCP
        • Per-port settings via Switch ports
        • QoS, STP, etc. under Switch settings
      • Bind networks to this template under:
        Organization > Configuration templates > Template > Bind networks

      ⚙️ 3. Modifying a Switch Template (via GUI)

      • Go to:
        Organization > Configuration templates > [Your Template]
      • Under the Switch tab, modify:
        • VLANs
        • Switch port configs
        • Layer 3 interfaces
        • Access policies
      • Changes auto-apply to all bound networks

      🔧 4. Creating/Modifying Switch Templates (via API)

      📌 Prerequisites:

      • Dashboard API key
      • Network ID or template ID
      • API base URL: https://api.meraki.com/api/v1

      ✅ Create a Configuration Template:

      POST /organizations/{organizationId}/configTemplates

      {
      "name": "Branch Switch Template"
      }

      ✅ Modify VLAN Settings in a Template:

      PUT /networks/{networkId}/switch/settings

      {
      "vlan": 20,
      "useCombinedPower": true,
      "voiceVlanId": 100
      }

      ✅ Update Switch Port:

      PUT /devices/{serial}/switch/ports/{portId}

      {
      "name": "Uplink Port",
      "type": "trunk",
      "vlan": 1,
      "allowedVlans": "1,10,20",
      "poeEnabled": true
      }

      📚 Extra Notes:

      • Templates can be bound to multiple networks. Once bound, you cannot configure those networks individually, unless you unbind them.
      • Best Practice: Create staging/testing networks to validate templates before applying widely.
    5. How to enable Meraki API

      The Meraki API allows you to automate and manage your Meraki network programmatically. It is a RESTful API that provides access to Meraki dashboard data and configurations.


      1. Enable Meraki API

      Before using the API, you must enable it in the Meraki Dashboard:

      • Login to Meraki Dashboarddashboard.meraki.com
      • Go to “Organization” > “Settings”
      • Scroll to “Dashboard API access” and toggle it ON.
      • Click “Save”.

      2. Generate an API Key

      • Go to “My Profile” (top-right corner in the dashboard).
      • Scroll to “API access”.
      • Click “Generate API Key”.
      • Copy and save the API Key (It won’t be shown again).

      ⚠️ Security Note: Treat your API key like a password—never expose it in public or store it in unsecured locations.


      3. Test API Connectivity

      Use Postman or cURL to test API access.

      Example: Get Organization List

      Using cURL:

      curl -L -H "X-Cisco-Meraki-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -X GET "https://api.meraki.com/api/v1/organizations"

      Using Python:

      import requests

      API_KEY = "YOUR_API_KEY"
      url = "https://api.meraki.com/api/v1/organizations"

      headers = {
      "X-Cisco-Meraki-API-Key": API_KEY,
      "Content-Type": "application/json"
      }

      response = requests.get(url, headers=headers)
      print(response.json())

      4. Common Meraki API Endpoints

      Here are some useful endpoints:

      Organization Management

      ActionMethodEndpoint
      List organizationsGET/organizations
      Get org detailsGET/organizations/{orgId}
      Claim devices to orgPOST/organizations/{orgId}/claim

      Network Management

      ActionMethodEndpoint
      List networksGET/organizations/{orgId}/networks
      Create a networkPOST/organizations/{orgId}/networks
      Delete a networkDELETE/networks/{networkId}

      Device Management

      ActionMethodEndpoint
      List devices in a networkGET/networks/{networkId}/devices
      Get device detailsGET/devices/{serial}
      Update device settingsPUT/devices/{serial}

      5. Advanced Usage

      • Meraki Python SDK: Use the official Meraki Python library for easier API calls. bashCopyEditpip install meraki pythonCopyEditimport meraki API_KEY = "YOUR_API_KEY" dashboard = meraki.DashboardAPI(API_KEY) orgs = dashboard.organizations.getOrganizations() print(orgs)
      • Webhooks: Configure webhooks for real-time alerts.
      • Automation: Automate network provisioning, VLAN assignments, SSID management, etc.

      6. API Documentation

      For a complete list of API endpoints, visit Meraki API Docs.