How do I view the actual subnets Merkai has assigned to remote spokes?

Solved
anxious
Conversationalist

How do I view the actual subnets Merkai has assigned to remote spokes?

Crazy customer of mine gave Meraki a block of IP addresses to assign that overlaps IP space already in use in their data center (gave Meraki a 10/8 to hand out /24). By some miracle, Merkai has not yet assigned one of the overlapping /24 to a store. I have talked to Meraki Support and they do not believe they have an API that can query for this information.

 

This information must be saved somewhere in a Meraki database, otherwise Meraki itself, would reassign a subnet it had already assigned. Does anyone know a way, short of going to each site, to determine what i[ addresses have been assigned, and, hopefully, what IP are active within each scope????

1 Accepted Solution
anxious
Conversationalist

Thanks, and I'll take that python script when you find it.

View solution in original post

5 Replies 5
ww
Kind of a big deal
Kind of a big deal

The mx routing table shows  the active subnet that are used. Non vpn subnets can be the same

 

See also https://community.meraki.com/t5/Security-SD-WAN/I-need-to-be-able-to-export-the-routing-table-on-Mer...

anxious
Conversationalist

Good answer. Sort of kicking myself for not thinking of this. Add this to the list of what my customer is doing wrong--they are allowing all 3500 spokes to elarn every other spoke's IPs, even though the MX450s are advertsing a 0/0. 

 

Though, I do wish Meraki had a better API to display the DHCP info....

JGill
Building a reputation

This V1 API call for vpnStatuses will pull the VPN subnets.

 

vpnstatuses = dashboard.appliance.getOrganizationApplianceVpnStatuses(organization_id, total_pages='all')

 

Simple loop to get all in use subnets by location.  I may have a sample python script that does just that if you need it.  

 

{'deviceSerial': 'Q2PN-****-****',
'deviceStatus': 'online',
'exportedSubnets': [{'name': 'Office', 'subnet': '10.21.180.0/24'},
{'name': 'DMZ', 'subnet': '10.21.181.0/24'},
{'name': 'Wireless', 'subnet': '10.21.182.0/24'}],
'merakiVpnPeers': [{'networkId': 'N_*****************',
'networkName': 'Datacenter********1',
'reachability': 'reachable'},
{'networkId': 'N_*************************',
'networkName': 'Datacenter***********2',
'reachability': 'reachable'},
{'networkId': 'N_******************************',
'networkName': 'Datacenter*************3',
'reachability': 'reachable'}],
'networkId': 'L_***************************',
'networkName': 'Remote Location **********1',
'thirdPartyVpnPeers': [],
'uplinks': [{'interface': 'wan1', 'publicIp': '198.###.###.###'},
{'interface': 'wan2', 'publicIp': '47.###.###.###'}],
'vpnMode': 'spoke'}

 

 

 

anxious
Conversationalist

Thanks, and I'll take that python script when you find it.

JGill
Building a reputation

Didn't find the one that writes to a csv filem, but this will dump to the screen and be pretty close for pulling into excel.

 

# Get a list of VPN Statuses and dump to screen
# JG -- 
import meraki
 
# Update with Key or envronment varible
API_KEY = '****************************************'
dashboard = meraki.DashboardAPI(API_KEY)
 
#Update with Orgid or envronment varible
organization_id = '******'
 
vpnstatuses = dashboard.appliance.getOrganizationApplianceVpnStatuses(organization_id, total_pages='all')
 
for vpnstatus in vpnstatuses:
    print ('"'+  vpnstatus['networkName'] + '","' + vpnstatus['deviceSerial'] + '","' + vpnstatus['deviceStatus'] + '","' + str(vpnstatus['exportedSubnets'])+ '"') 

 

 

Get notified when there are additional replies to this discussion.
Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.