Hello,

My env:

  • phpIPAM: 1.5.0
  • dbschema: 1.5 dbversion 39
  • php: 7.4.30
  • MySQL: 10.5.15-MariaDB-0+deb11u1
  • OS: Debian 11

When i call the api first_free for ipv6, i get the network ip, not the next usable ip. First i tried with an added network by myself. But same result with the demo ipv6 that is present after install.

ipv6 network: fd13:6d20:29dc:cf27::/64

curl --header 'token:token' 'http://20.0.0.247/api/appid/addresses/first_free/1'
{"code":200,"success":true,"data":"fd13:6d20:29dc:cf27::","time":0.003}#

It works well with ipv4. ipv4 network: 10.0.1.0/24

curl --header 'token:token' 'http://20.0.0.247/api/arkvpshtz/addresses/first_free/3'                    
{"code":200,"success":true,"data":"10.10.1.1","time":0.003}#

EDIT: It start to work when post is used first

curl --header 'token:token' 'http://20.0.0.247/api/appid/addresses/first_free/1'
{"code":200,"success":true,"data":"fd13:6d20:29dc:cf27::","time":0.003}#
curl --header 'token:token' 'http://20.0.0.247/api/appid/addresses/first_free/1'
{"code":200,"success":true,"data":"fd13:6d20:29dc:cf27::","time":0.003}#

curl -XPOST --header 'token:token' 'http://20.0.0.247/api/appid/addresses/first_free/1'
{"code":201,"success":true,"message":"Address created","id":"18","data":"fd13:6d20:29dc:cf27::1","time":0.024}#

curl --header 'token:token' 'http://20.0.0.247/api/appid/addresses/first_free/1'
{"code":200,"success":true,"data":"fd13:6d20:29dc:cf27::2","time":0.003}#

During the first call (2 times) the network ip i returned. The second is a post call who returns the first free ip of the subnet. The last one is a get call who working now by returning the first free ip.

0
© 2022 pullanswer.com - All rights reserved.