Proxmox API - POST lxc - Error code 400

Cubix

Member
Jun 17, 2022
10
0
6
Hello,
I am sending api requests and my tool returned this error:
Code:
net0.ip: invalid format - value does not look like a valid ipv4 network configuration

net0 has this information: (I just removed the gw6)
Code:
name=vmbr0, ip6=auto, gw6=hide, gw=10.0.0.1, ip=10.0.0.21, rate=100

And I don't understand because 10.0.0.21 is a valid ip normally.

If anyone can help me please
 
Hey,

this is the regex the net config has to match [1]
Code:
name=<string> [,bridge=<bridge>] [,firewall=<1|0>] [,gw=<GatewayIPv4>] [,gw6=<GatewayIPv6>] [,hwaddr=<XX:XX:XX:XX:XX:XX>] [,ip=<(IPv4/CIDR|dhcp|manual)>] [,ip6=<(IPv6/CIDR|auto|dhcp|manual)>] [,mtu=<integer>] [,rate=<mbps>] [,tag=<integer>] [,trunks=<vlanid[;vlanid...]>] [,type=<veth>]
the netmask is missing in your IP(it probably is /24, but that depends on your network setup).

[1] https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/lxc
 
Last edited: