cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DHCP Reservations on Network with No VLANs

Highlighted
Getting noticed

DHCP Reservations on Network with No VLANs

Normally I can do the call:

myvlans = meraki.getvlans(apikey, networkid, suppressprint=False)
And then I can modify DHCP reservations to my heart's content. Today I needed to have my script do this for a small branch office with a flat network. It's small enough that I'm not using VLANs, so my getvlans call is returning ['VLANs are not enabled for this network']
So, is there a workaround? How do I get to the DHCP info for this network? Do I have to enable VLANs to access this information through the API?
 
Sorry if I've totally missed something that has developed recently. I split my time between firewall, LAN, and server admin. Sometimes I can go for months without touching the meraki API.
6 REPLIES 6
Highlighted
Head in the Cloud

Re: DHCP Reservations on Network with No VLANs

Seems like there are several areas you need VLANs enabled, even if they‘re not needed:

https://community.meraki.com/t5/Developers-APIs/Getting-LAN-Config-via-API-when-VLANs-are-disabled/m...

Highlighted
Kind of a big deal

Re: DHCP Reservations on Network with No VLANs

Highlighted
Building a reputation

Re: DHCP Reservations on Network with No VLANs

I am in no way experienced in the Meraki API.

However, I've found this.

 

You can check if vlans are enabled by using this endpoint;

 

HTTP REQUEST
GET /networks/{networkId}/vlansEnabledState

 

If that returns true, then go ahead using your  getvlans()-call

If false, you can maybe you can use 

 

HTTP REQUEST
GET /networks/{networkId}/vlans/{vlanId}

 

and then return for vlan 1 or 0? I'm not sure if this would work...

Building a reputation

Re: DHCP Reservations on Network with No VLANs

What's returned if you call this?

HTTP REQUEST
GET /networks/{networkId}/appliancePorts
Highlighted
Here to help

Re: DHCP Reservations on Network with No VLANs

The '/networks/{networkId}/appliancePorts' only works if VLANs are enabled. But it doesn't have DHCP information, just says what VLANs are on the MX ports.
Highlighted
Getting noticed

Re: DHCP Reservations on Network with No VLANs

Thanks guys. I hit the easy button--enabled the VLANs and hoped that didn't break anything. It doesn't seem like it should break anything, but right after I did that our monitoring software stopped being able to ping the device. It was only after digging through the dashboard for a while that we figured out that the change broke the VPN mesh. I had to enable it for VLAN 1. 

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.