Add radius server for multiple networks

Rahali
Conversationalist

Add radius server for multiple networks

Hey Guys,

 

I'm struggling to add a radius server for 50+ networks , tried to work with couple of python scripts but didn't work even when I used Meraki SDK couldn't make it work .

 

If anyone did this before or have an idea , please help !

 

one of the python script I used  using Meraki SDK

 

import meraki
import requests

# Replace with your actual Meraki API key and network ID
API_KEY = 'your_meraki_api_key'
NETWORK_ID = 'your_network_id'

# Define the RADIUS server details
radius_server = {
"host": "10.2.2.11", # Replace with your RADIUS server's IP address
"port": 1812, # Replace with the RADIUS port (usually 1812)
"secret": "" # Replace with your RADIUS secret
}

# Create the base URL for the Meraki API
url = f'https://api.meraki.com/api/v1/networks/{NETWORK_ID}/wireless/radiusServers'

# Set up headers with the Meraki API Key
headers = {
'X-Cisco-Meraki-API-Key': API_KEY,
'Content-Type': 'application/json'
}

# Prepare the payload to update the radius server
payload = [radius_server] # The payload must be a list of servers

# Make the PUT request to update the RADIUS server
try:
response = requests.put(url, headers=headers, json=payload)
response.raise_for_status() # Raise an exception for HTTP errors
print("RADIUS server updated successfully:", response.json())
except requests.exceptions.RequestException as e:
print(f"Error occurred while updating RADIUS server: {e}")

2 Replies 2
Rahali
Conversationalist

Error that i got 

Rahali_0-1737668055739.png

 

Mloraditch
Head in the Cloud

I'm not sure where that URL is from (perhaps an older version of the api?) but the API to update radius for Wireless is this one: https://developer.cisco.com/meraki/api-v1/update-network-wireless-ssid/

 

You have to do it per SSID.

Org Wide Radius does exist but only for wired devices at this point.

 

If you found this post helpful, please give it Kudos. If my answer solves your problem please click Accept as Solution so others can benefit from it.
Get notified when there are additional replies to this discussion.