Please note this may affect wider patterns which were previously accepted.
For example with netaddr < 1.0.0, "10/8" is a valid representation of subnet and is translated to 10.0.0.0/8 .
Type "help", "copyright", "credits" or "license" for more information. >>> import netaddr >>> netaddr.IPNetwork('10/8') IPNetwork('10.0.0.0/8')
However with netaddr >= 1.0.0, which uses INET_PTON, this is no longer accepted
>>> import netaddr >>> netaddr.IPNetwork('10/8') Traceback (most recent call last): File "/home/tkajinam/venv/lib/python3.11/site-packages/netaddr/strategy/ipv4.py", line 124, in str_to_int return _struct.unpack('>I', _inet_pton(AF_INET, addr))[0] ^^^^^^^^^^^^^^^^^^^^^^^^^ OSError: illegal IP address string passed to inet_pton
Currently with netaddr < 1.0.0, neutron supports that INET_ATON compliant format.
``` [root@localhost ~]# openstack subnet create --debug --network testnetwork --subnet-range 10/8 testsubnet ... REQ: curl -g -i -X POST http://127.0.0.1:9696/v2.0/subnets -H "Content-Type: application/json" -H "User-Agent: openstacksdk/2.1.0 keystoneauth1/5.5.0 python-requests/2.25.1 CPython/3.9.18" -H "X-Auth-Token: {SHA256}f5f8310eff9da291b1ed3a851365033bc771153d5f148ecd59b969d2d32ce32a" -d '{"subnet": {"name": "testsubnet", "network_id": "156e8829-3b7c-45b1-8678-c35d625e0af4", "ip_version": 4, "cidr": "10/8"}}' http://127.0.0.1:9696 "POST /v2.0/subnets HTTP/1.1" 201 608 RESP: [201] Connection: keep-alive Content-Length: 608 Content-Type: application/json Date: Tue, 20 Feb 2024 15:10:06 GMT X-Openstack-Request-Id: req-455d7d7b-8de3-45ab-b75c-a6b9f505838d RESP BODY: {"subnet":{"id":"3ba2fa27-5931-4acc-bba5-3383232cd112","name":"testsubnet","tenant_id":"2e1290f8bdc44d35bce981db68fb54a2","network_id":"156e8829-3b7c-45b1-8678-c35d625e0af4","ip_version":4,"subnetpool_id":null,"enable_dhcp":true,"ipv6_ra_mode":null,"ipv6_address_mode":null,"gateway_ip":"10.0.0.1","cidr":"10.0.0.0/8","allocation_pools":[{"start":"10.0.0.2","end":"10.255.255.254"}],"host_routes":[],"dns_nameservers":[],"description":"","service_types":[],"tags":[],"created_at":"2024-02-20T15:10:05Z","updated_at":"2024-02-20T15:10:05Z","revision_number":0,"project_id":"2e1290f8bdc44d35bce981db68fb54a2"}} POST call to network for http://127.0.0.1:9696/v2.0/subnets used request id req-455d7d7b-8de3-45ab-b75c-a6b9f505838d +----------------------+--------------------------------------+ | Field | Value | +----------------------+--------------------------------------+ | allocation_pools | 10.0.0.2-10.255.255.254 | | cidr | 10.0.0.0/8 | | created_at | 2024-02-20T15:10:05Z | | description | | | dns_nameservers | | | dns_publish_fixed_ip | None | | enable_dhcp | True | | gateway_ip | 10.0.0.1 | | host_routes | | | id | 3ba2fa27-5931-4acc-bba5-3383232cd112 | | ip_version | 4 | | ipv6_address_mode | None | | ipv6_ra_mode | None | | name | testsubnet | | network_id | 156e8829-3b7c-45b1-8678-c35d625e0af4 | | project_id | 2e1290f8bdc44d35bce981db68fb54a2 | | revision_number | 0 | | segment_id | None | | service_types | | | subnetpool_id | None | | tags | | | updated_at | 2024-02-20T15:10:05Z | +----------------------+--------------------------------------+ ```
But this is no longer accepted with netaddr 1.0.0 .
Please note this may affect wider patterns which were previously accepted.
For example with netaddr < 1.0.0, "10/8" is a valid representation of subnet and is translated to 10.0.0.0/8 .
Type "help", "copyright", "credits" or "license" for more information. IPNetwork( '10/8') '10.0.0. 0/8')
>>> import netaddr
>>> netaddr.
IPNetwork(
However with netaddr >= 1.0.0, which uses INET_PTON, this is no longer accepted
>>> import netaddr IPNetwork( '10/8') tkajinam/ venv/lib/ python3. 11/site- packages/ netaddr/ strategy/ ipv4.py" , line 124, in str_to_int unpack( '>I', _inet_pton(AF_INET, addr))[0]
^^^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^
>>> netaddr.
Traceback (most recent call last):
File "/home/
return _struct.
OSError: illegal IP address string passed to inet_pton
Currently with netaddr < 1.0.0, neutron supports that INET_ATON compliant format.
``` 127.0.0. 1:9696/ v2.0/subnets -H "Content-Type: application/json" -H "User-Agent: openstacksdk/2.1.0 keystoneauth1/5.5.0 python- requests/ 2.25.1 CPython/3.9.18" -H "X-Auth-Token: {SHA256} f5f8310eff9da29 1b1ed3a85136503 3bc771153d5f148 ecd59b969d2d32c e32a" -d '{"subnet": {"name": "testsubnet", "network_id": "156e8829- 3b7c-45b1- 8678-c35d625e0a f4", "ip_version": 4, "cidr": "10/8"}}' 127.0.0. 1:9696 "POST /v2.0/subnets HTTP/1.1" 201 608 Request- Id: req-455d7d7b- 8de3-45ab- b75c-a6b9f50583 8d :{"id": "3ba2fa27- 5931-4acc- bba5-3383232cd1 12","name" :"testsubnet" ,"tenant_ id":"2e1290f8bd c44d35bce981db6 8fb54a2" ,"network_ id":"156e8829- 3b7c-45b1- 8678-c35d625e0a f4","ip_ version" :4,"subnetpool_ id":null, "enable_ dhcp":true, "ipv6_ra_ mode":null, "ipv6_address_ mode":null, "gateway_ ip":"10. 0.0.1", "cidr": "10.0.0. 0/8","allocatio n_pools" :[{"start" :"10.0. 0.2","end" :"10.255. 255.254" }],"host_ routes" :[],"dns_ nameservers" :[],"descriptio n":""," service_ types": [],"tags" :[],"created_ at":"2024- 02-20T15: 10:05Z" ,"updated_ at":"2024- 02-20T15: 10:05Z" ,"revision_ number" :0,"project_ id":"2e1290f8bd c44d35bce981db6 8fb54a2" }} 127.0.0. 1:9696/ v2.0/subnets used request id req-455d7d7b- 8de3-45ab- b75c-a6b9f50583 8d ------- ------- --+---- ------- ------- ------- ------- ------+ ------- ------- --+---- ------- ------- ------- ------- ------+ 2-10.255. 255.254 | 20T15:10: 05Z | fixed_ip | None | 5931-4acc- bba5-3383232cd1 12 | 3b7c-45b1- 8678-c35d625e0a f4 | 5bce981db68fb54 a2 | 20T15:10: 05Z | ------- ------- --+---- ------- ------- ------- ------- ------+
[root@localhost ~]# openstack subnet create --debug --network testnetwork --subnet-range 10/8 testsubnet
...
REQ: curl -g -i -X POST http://
http://
RESP: [201] Connection: keep-alive Content-Length: 608 Content-Type: application/json Date: Tue, 20 Feb 2024 15:10:06 GMT X-Openstack-
RESP BODY: {"subnet"
POST call to network for http://
+------
| Field | Value |
+------
| allocation_pools | 10.0.0.
| cidr | 10.0.0.0/8 |
| created_at | 2024-02-
| description | |
| dns_nameservers | |
| dns_publish_
| enable_dhcp | True |
| gateway_ip | 10.0.0.1 |
| host_routes | |
| id | 3ba2fa27-
| ip_version | 4 |
| ipv6_address_mode | None |
| ipv6_ra_mode | None |
| name | testsubnet |
| network_id | 156e8829-
| project_id | 2e1290f8bdc44d3
| revision_number | 0 |
| segment_id | None |
| service_types | |
| subnetpool_id | None |
| tags | |
| updated_at | 2024-02-
+------
```
But this is no longer accepted with netaddr 1.0.0 .