SDN PHPIPAM Configuration

sudomaster.ljs

New Member
Oct 29, 2022
15
0
1
Hello everyone,

Two things,

1. An error occurs while creating a subnet in Proxmox using a subnet that doesn't exist in phpipam. Need to create subnet in phpipam prior to creating subnet in Proxmox. Is that how it's designed?

2. I created two zones with different PHPIPAMs. Both PHPIPAMs are set with separate section IDs but refer to the same PHPIPAM instance. However, Proxmox permits the subnet creation even if it doesn't exist in the configured section.

Zone1 IPAM Configuration
URL: https://ipam.xxxxx.xxx/api/labuser
Section: 7
Subnets in section 7: 192.168.200.0/24, 10.10.20.0/24

Zone2 IPAM Configuration
URL: https://ipam.xxxxx.xxx/api/labuser
Section: 8
Subnets in section 7: 192.168.210.0/24, 10.10.30.0/24

With the above IPAM setup, Proxmox allows to add subnet 10.10.30.0/24 in Zone1. Can't sections be used for tenant subnet separation?
 
1) The subnet creation is implemented in proxmox phpipam plugin, it should create it. Do you have any error detail ? phpipam version ?

2) IT's totally valid to use same subnet on differents zones. (think of differents customers zone, each customer can use same private subnet, in different zone (different vlan, different routed network, different vlan). The machines using same subnets in differents zonse, are not able to communicate.

I don't remember if phpipam is able to support this with 1 instance ? maybe creating a vrf in phpipam ?



(Note that currently, Ipam implementation only registered subnet and gateway ip, but the vm/ct doesnt not currently get ip from ipam, I hope to finish this for next year).
 
Thank you for the response @spirit

1) It throws the error "create sdn subnet object failed: Invalid response from server: 404 Not Found (500)" from both UI and API. Adding subnet in phpipam manually solves this issue. Then Proxmox allows to create the subnet.

2. Makes sense, there could be different customers/zones using the same subnet. In such case, how the IP allocation from phpipam will be handled? Example, zone1, zone2 and zone3 use the subnet 192.168.50.0/24 but there's only one phpipam instance and there's only one definition for subnet 192.168.50.0/24 in phpipam. Phpipam allows to add same subnet in different sections if strict mode is set to No while creating the section. I was assuming section is used for logical subnet separation in phpipam :)
 
Thank you for the response @spirit

1) It throws the error "create sdn subnet object failed: Invalid response from server: 404 Not Found (500)" from both UI and API. Adding subnet in phpipam manually solves this issue. Then Proxmox allows to create the subnet.

2. Makes sense, there could be different customers/zones using the same subnet. In such case, how the IP allocation from phpipam will be handled? Example, zone1, zone2 and zone3 use the subnet 192.168.50.0/24 but there's only one phpipam instance and there's only one definition for subnet 192.168.50.0/24 in phpipam. Phpipam allows to add same subnet in different sections if strict mode is set to No while creating the section. I was assuming section is used for logical subnet separation in phpipam :)
I'll redo test with phpipam soon.
Subnet creation was working last year (1.4 I think). I'll verify that.

for 2) I was assuming that section was a logical separation too. I'll need to recheck that.

Thanks for the report !
 
I tested the above mentioned scenarios with PHPIPAM 1.4 today, here's the test result.

- Subnet creation works with the version 1.4. When I created a subnet from Proxmox, it got created in PHPIPAM also.

- But it failed to create the same subnet in different sections. I created zoneA and zoneB, and configured those zones with section 3 and section 4 respectively. When I created subnet 192.168.35.0/24 in zoneA, the same got created in section 3 of IPAM. I received a success message when I created the same subnet (192.168.35.0/24) in zoneB using the Proxmox UI, but nothing happened on the IPAM side. No subnet added to the section 4. But adding a new subnet (192.168.40.0/24) to zoneB worked well.

It doesn't appear to be an IPAM issue, I was able to create same subnet in different sections using these API calls...

curl --location --request POST 'https://ipam14.xxx.net.in/api/proxmox/subnets/' \
--header 'token: XxxxxxxxxX' \
--header 'Content-Type: application/json' \
--header 'Cookie: phpipam=4fm6mxxxxxxxx2cch904' \
--data-raw '{
"sectionId": "3",
"subnet": "192.168.35.0",
"mask": 24
}'

curl --location --request POST 'https://ipam14.xxx.net.in/api/proxmox/subnets/' \
--header 'token: XxxxxxxxxxX' \
--header 'Content-Type: application/json' \
--header 'Cookie: phpipam=4fm6mnxxxxxxxxxg2cch904' \
--data-raw '{
"sectionId": "4",
"subnet": "192.168.35.0",
"mask": 24
}'
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!