How to find out which local IP band is being used by all networks?

Solved
Snika
Getting noticed

How to find out which local IP band is being used by all networks?

We have dozens of networks in one ORGANIZATION.

I want to know which local IP band is being used by all networks.

My goal is to find an unused IP band.

Any ideas?

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

If you have AutoVPN enabled for all sites, go to a hub, and then Security & SDWAN/Route Table.

View solution in original post

9 Replies 9
RomanMD
Building a reputation

IP band? Or IP subnet? Are you looking for the IP subnet on the WAN interface or the IP subnets configured as L3 on the MXes (Addresses and VLANs) or maybe on L3 switches?

If is one of the above, the information can be easily extracted by leveraging APIs.

PhilipDAth
Kind of a big deal
Kind of a big deal

If you have AutoVPN enabled for all sites, go to a hub, and then Security & SDWAN/Route Table.

We have dozens of Meraki networks.
It is inefficient to check all MX's IPSEC VPN settings to find the hub firewall.
Is there a good way to find the HUB firewall?

RomanMD
Building a reputation

Name the networks accordingly and you will find the networks at a glance in dashboard. If you have multiple organizations/networks you need to have a well established naming concept.

Snika
Getting noticed

One organization has dozens of networks.
What does the dashboard say?
To check HUB MX, in which menu do you check what?

PhilipDAth
Kind of a big deal
Kind of a big deal

Actually you don't even have to go to the hub.  You can do this at any site with AutoVPN enabled.

RomanMD
Building a reputation

Because I thought that it might be useful for me in the future. I might have some misses here and there, or not very efficient, but if you're like me and have 40 organizations.. then...

 

 

dashboard = meraki.DashboardAPI(x_cisco_meraki_api_key, suppress_logging=True)
organizations = dashboard.organizations.getOrganizations()

SWITCH = True # Set to True if you want to display the vlans from MX
APPLIANCE = True # set to True if you want to display the vlans from MS

print("Organization,Network,Type,Subnet,Vlan name,Vlan ID")
for org in organizations:
    networks = dashboard.organizations.getOrganizationNetworks(organizationId=org["id"])
    devices = dashboard.organizations.getOrganizationDevices(organizationId=org["id"], productTypes=["appliance", "switch"])

    for network in networks:
        if "appliance" in network["productTypes"] and APPLIANCE is True:
            networkSettings = dashboard.networks.getNetworkSettings(networkId=network["id"])
            try:
                singleVlan = dashboard.appliance.getNetworkApplianceSingleLan(networkId=network["id"])
                print(f"{org['name']},{network['name']},MX,{singleVlan['subnet']},,1")
            except Exception as e:
                pass

            try:
                vlans = dashboard.appliance.getNetworkApplianceVlans(networkId=network["id"])
                for vlan in vlans:
                    print(f"{org['name']},{network['name']},MX,{vlan['subnet']},{vlan['name']},{vlan['id']}")
            except Exception as e:
                pass
                
        if "switch" in network["productTypes"] and SWITCH is True:
            switchStacks = dashboard.switch.getNetworkSwitchStacks(networkId=network["id"])
            switches = [switch for switch in devices if switch["productType"] == "switch" and switch["networkId"] == network["id"]]

            for stack in switchStacks:
                for serial in stack['serials']:
                    for index, switch in enumerate(switches):
                        switches.pop(index)

                stackVlans = dashboard.switch.getNetworkSwitchStackRoutingInterfaces(networkId=network["id"], switchStackId=stack["id"])
                for stackVlan in stackVlans:
                    print(f"{org['name']},{network['name']},MS-stack,{stackVlan['subnet']},{stackVlan['name']},{stackVlan['vlanId']}")

            for switch in switches:
                switchVlans = dashboard.switch.getDeviceSwitchRoutingInterfaces(serial=switch["serial"])
                for switchVlan in switchVlans:
                    print(f"{org['name']},{network['name']},MS-nonstack,{switchVlan['subnet']},{switchVlan['name']},{switchVlan['vlanId']}")

 

 

 

Snika
Getting noticed

your script is awesome.
I don't know how to use the API.
Can you provide an additional detailed guide?
There is much to learn from your passion.
RomanMD
Building a reputation

Well, when you go to University it is supposed that you already know the alphabet. 

This is true also about the Meraki - when you embrace a cloud solution like Meraki, you like the fact that you can click in a nice dashboard but then when you scale, you find out that it does not work and also the old way of making excel templates also don't work, and you can only use APIs. And you must be ready to use the APIs. 

 

The script is in Python and uses the meraki library. I am sure if you'll search in the community you'll find some video guides of how to get started with Python, and then Meraki APIs. I've posted a xx$ worth script, if you want to use of it.. feel free. 

Get notified when there are additional replies to this discussion.