API end point Create Network Appliance Static Route error invalid next hop (DevNet)

Solved
Clifra-Jones
Conversationalist

API end point Create Network Appliance Static Route error invalid next hop (DevNet)

I am working in the Enterprise DevNet.

 

I am attempting to use this endpoint to create an appliance static route.

 

I have 1 VLAN in the MX.

id                     : 1
networkId              : L_646829496481116086
name                   : Default
applianceIp            : 192.168.128.1
subnet                 : 192.168.128.0/24
fixedIpAssignments     : 
reservedIpRanges       : {}
dnsNameservers         : upstream_dns
dhcpHandling           : Run a DHCP server
dhcpLeaseTime          : 1 day
dhcpBootOptionsEnabled : False
dhcpOptions            : {}
interfaceId            : 646829496481737561
ipv6                   : @{enabled=False}
mandatoryDhcp          : @{enabled=False}

 

I have 2 interfaces in the switch:

interfaceId      : 646829496481104683
name             : Bob
subnet           : 192.168.128.0/24
interfaceIp      : 192.168.128.1
multicastRouting : disabled
vlanId           : 1
defaultGateway   : 192.168.128.1
switchName       : SW-F02
serial           : Q2GW-2CPC-JCYZ

interfaceId      : 646829496481104684
name             : Joe
subnet           : 192.168.132.0/24
interfaceIp      : 192.168.132.1
multicastRouting : disabled
vlanId           : 132
switchName       : SW-F02
serial           : Q2GW-2CPC-JCYZ

When I try to pass the following JSON to the this endpoint I get an invalid next hop error. Configuring this Static Route in the dashboard works.

{                     
  "gatewayIp": "192.168.132.1",
  "subnet": "192.168.132.0/24",
  "name": "VLAN132"
}

Error message is:

"The static LAN route \u0022VLAN132\u0022 has an invalid next hop IP. The IP address 192.168.132.1 is not on a configured subnet."

 

 

Check out my Meraki API PowerShell Module.
Powershell Gallary: https://www.powershellgallery.com/packages?q=Meraki-API-V1
Project Site: https://github.com/Clifra-Jones/Meraki-API-V1
1 Accepted Solution

And you must create the VLAN interface on the MX, otherwise you need to create the route using the interface you already have created on the MX.

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

11 Replies 11
alemabrahao
Kind of a big deal
Kind of a big deal

Your next hop IP must be the IP of the other device on the end, not the IP of the MX interface.

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.

And you must create the VLAN interface on the MX, otherwise you need to create the route using the interface you already have created on the MX.

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.

Ya know what, you are right! I went back and looked at my networks and the next hop is always interface IP of the VLAN that is also configured on the MX.

 

I guess I got confused when the dashboard allowed me to create the static route with the IP of the 192.168.132.1 as the next hop. Seems that should bark at you also!

 

Thanks for the kick in the  brain!

Check out my Meraki API PowerShell Module.
Powershell Gallary: https://www.powershellgallery.com/packages?q=Meraki-API-V1
Project Site: https://github.com/Clifra-Jones/Meraki-API-V1

192.168..132.1 is not the IP of the MX. The MX has an IP of 192.168.128.1

I did see an error where the 192.168.128.0/24 interface on the switch had an Interface IP the same as the MX.

I corrected that and tried again and get the same error.

We have over 200 sites in our network and I do this all the time through the dashboard. The Dashboard works.

 

Check out my Meraki API PowerShell Module.
Powershell Gallary: https://www.powershellgallery.com/packages?q=Meraki-API-V1
Project Site: https://github.com/Clifra-Jones/Meraki-API-V1

Either way your static route is wrong. The first thing I noticed is that the MX and the Switch have the same IP 192.168.128.1, so I suggest you change the switch's IP to 192.168.128.2.
 
Then create the route to the network 192.168.132.0/24 pointing the switch IP (192.168.128.2) as the next hop, since it is the one that knows this network.
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.
Ryan_Miles
Meraki Employee
Meraki Employee

Does it work if you send this as separate requests? First send the req to create the 192.168.128.0/24 interface. Once that's created send the next to create the 192.168.132.0/24 network.

ww
Kind of a big deal
Kind of a big deal

Also note that you are currently using the same ip on the mx and switch 

Clifra-Jones
Conversationalist

Yes, saw that, fixed it, same error.

In the dashboard:

Add Static Route

Name: VLAN132

IPVersion: IPv4

Subnet: 192.168.132.0/24

Next Hop IP 192.168.132.1

 

It works.

 

Check out my Meraki API PowerShell Module.
Powershell Gallary: https://www.powershellgallery.com/packages?q=Meraki-API-V1
Project Site: https://github.com/Clifra-Jones/Meraki-API-V1

Wrong, it will not work.

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.

Yes, you are right, the dashboard accepted it. Even though it will not work. The API throws an error.

 

Check out my Meraki API PowerShell Module.
Powershell Gallary: https://www.powershellgallery.com/packages?q=Meraki-API-V1
Project Site: https://github.com/Clifra-Jones/Meraki-API-V1
ww
Kind of a big deal
Kind of a big deal

Like @alemabrahao already said.

Asuming you working  on the mx route not the switch.

You need to to point the route for subnet 192.168.132.0/24 to the next hop(switch ip)  192.168.128.2 (or whatever ip you gave the switch)

 

Get notified when there are additional replies to this discussion.