LAN Port (PoE) recycle on MX-67

Solved
Thygesen
Building a reputation

LAN Port (PoE) recycle on MX-67

Hi Wizards 😁

 

I have a customer template based setup with ie. MX-65 as SDwan terminators..

When having AP's directly connected to the MX, we sometimes need to recyle the PoE port ..


But .. when bound to the template, there is no access to the port configs / tools ?

 

How do we go about doing that without restarting the whole device ?

1 Accepted Solution
alemabrahao
Kind of a big deal
Kind of a big deal

But you can disable and enable it via API. 
 
Here is an example of a Powershell script.
 
# Set your Meraki API credentials
$apiKey = 'your-api-key'
 
# Sets the network ID and port number
$networkId = 'your-network-id'
$portNumber = 'your-port-number'
 
# Create the API header
$headers = @{
     'X-Cisco-Meraki-API-Key' = $apiKey
     'Content-Type' = 'application/json'
}
 
# Set the API URL to update the port
 
# Disable the port
Invoke-RestMethod -Uri $updatePortUrl -Method PUT -Body ('{"enabled": false}') -Headers $headers
 
# Wait for a specified time
Start-Sleep -Seconds 60
 
# Enable the port
Invoke-RestMethod -Uri $updatePortUrl -Method PUT -Body ('{"enabled": true}') -Headers $headers
I am not a Cisco Meraki employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.

Please, if this post was useful, leave your kudos and mark it as solved.

View solution in original post

6 Replies 6
alemabrahao
Kind of a big deal
Kind of a big deal

Even outside the template you cannot recycle PoE ports on an MX, only on the MS.

I am not a Cisco Meraki employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.

Please, if this post was useful, leave your kudos and mark it as solved.
CharlieCrackle
Building a reputation

You can do it from the Meraki Local Status page.  Disable and Enable.   It is a total pain but can be done.  Remotely you need to add your remote IP to the firewall to access.

RaphaelL
Kind of a big deal
Kind of a big deal

Only support can cycle an MX port. You have to call them.

 

If the MX is not on a template you can admin down admin up the port.

alemabrahao
Kind of a big deal
Kind of a big deal

But you can disable and enable it via API. 
 
Here is an example of a Powershell script.
 
# Set your Meraki API credentials
$apiKey = 'your-api-key'
 
# Sets the network ID and port number
$networkId = 'your-network-id'
$portNumber = 'your-port-number'
 
# Create the API header
$headers = @{
     'X-Cisco-Meraki-API-Key' = $apiKey
     'Content-Type' = 'application/json'
}
 
# Set the API URL to update the port
 
# Disable the port
Invoke-RestMethod -Uri $updatePortUrl -Method PUT -Body ('{"enabled": false}') -Headers $headers
 
# Wait for a specified time
Start-Sleep -Seconds 60
 
# Enable the port
Invoke-RestMethod -Uri $updatePortUrl -Method PUT -Body ('{"enabled": true}') -Headers $headers
I am not a Cisco Meraki employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.

Please, if this post was useful, leave your kudos and mark it as solved.
alemabrahao
Kind of a big deal
Kind of a big deal

I just tested It and worked as expected.

 

Yes, I know this is via network, but just create a loop, I think it's much easier this way than going network by network to do it manually.

I am not a Cisco Meraki employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.

Please, if this post was useful, leave your kudos and mark it as solved.
Thygesen
Building a reputation

Wow ! 😀
Thanx Alembrahao!
That was a neat piece of code !!  I will do a routine using that (and of course have Your credits in there) ..


Maybe we some time in the future will get same tools for ports in every device ..

Get notified when there are additional replies to this discussion.