Response: 400 Bad Request: "Could not auto-detect IP version for ''."

RandomTable1
Conversationalist

Response: 400 Bad Request: "Could not auto-detect IP version for ''."

Hello, I am using the 'Update Device Appliance Uplinks Settings' Endpoint to update the two WAN interfaces of a Meraki appliance. I used the Configuration panel on the right site of the Meraki API documentation to manually set the parameters and then sent the request, but I got a 'Response: 400 Bad Request' in response, with the error: "Could not auto-detect IP version for ''." . My request JSON body looks like this, I swapped the IP with a random IP address in this post: 

 

{
"interfaces": {
"wan1": {
"vlanTagging": {
"enabled": false
},
"svis": {
"ipv4": {
"nameservers": {
"addresses": []
},
"assignmentMode": "dynamic",
"address": "",
"gateway": ""
},
"ipv6": {
"nameservers": {
"addresses": []
},
"address": "",
"gateway": ""
}
},
"pppoe": {
"authentication": {
"enabled": false,
"username": "",
"password": ""
},
"enabled": false
},
"enabled": true
},
"wan2": {
"vlanTagging": {
"enabled": false
},
"svis": {
"ipv4": {
"nameservers": {
"addresses": []
},
"assignmentMode": "static",
"address": "1.1.1.1/11",
"gateway": "1.1.1.2"
},
"ipv6": {
"nameservers": {
"addresses": []
},
"address": "",
"gateway": ""
}
},
"pppoe": {
"authentication": {
"enabled": false,
"username": "",
"password": ""
},
"enabled": false
},
"enabled": true
}
}
}

My requirements are as follows:
- I want both of the WAN uplinks to have no vlanTagging, no nameservers, no IPv6 and no PPPoE.
- WAN1 should be in IPv4 assignmentMode dynamic.

- WAN2 should have a static IP address, e.g. '1.1.1.1/11' and a static gateway, e.g. '1.1.1.2'

I think I am using the correct endpoint, but I don't know how to handle the error.
Thank you for your time; any advice is much appreciated!

1 Reply 1
ShawnHu
Meraki Employee
Meraki Employee

@RandomTable1  Can you share the whole error message from the interactive API documentation? I don't see the same message in the Python library.

 

Also, you don't need to set every single parameter in the JSON body if you don't need to change it. I recommend you perform the GET uplink setting first and only include the parameters you want to change in the JSON body.

 

For example, below is a JSON body that changes the uplink WAN2 with a static IPv4 address and gateway. Other parameters will remain the same.

 

ShawnHu_0-1672824962278.png

 

{
"interfaces": {
 "wan2": {
"svis": {
"ipv4": {
"assignmentMode": "static",
"address": "1.2.3.4/24",
"gateway": "1.2.3.1",
"nameservers": {
"addresses": [
"1.2.3.1"
]
}
}
}
}
}
}

 

 

Get notified when there are additional replies to this discussion.