- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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."
Powershell Gallary: https://www.powershellgallery.com/packages?q=Meraki-API-V1
Project Site: https://github.com/Clifra-Jones/Meraki-API-V1
Solved! Go to solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Please, if this post was useful, leave your kudos and mark it as solved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your next hop IP must be the IP of the other device on the end, not the IP of the MX interface.
Please, if this post was useful, leave your kudos and mark it as solved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Please, if this post was useful, leave your kudos and mark it as solved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
Powershell Gallary: https://www.powershellgallery.com/packages?q=Meraki-API-V1
Project Site: https://github.com/Clifra-Jones/Meraki-API-V1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Powershell Gallary: https://www.powershellgallery.com/packages?q=Meraki-API-V1
Project Site: https://github.com/Clifra-Jones/Meraki-API-V1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please, if this post was useful, leave your kudos and mark it as solved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Also note that you are currently using the same ip on the mx and switch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Powershell Gallary: https://www.powershellgallery.com/packages?q=Meraki-API-V1
Project Site: https://github.com/Clifra-Jones/Meraki-API-V1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wrong, it will not work.
Please, if this post was useful, leave your kudos and mark it as solved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, you are right, the dashboard accepted it. Even though it will not work. The API throws an error.
Powershell Gallary: https://www.powershellgallery.com/packages?q=Meraki-API-V1
Project Site: https://github.com/Clifra-Jones/Meraki-API-V1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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)
