neutron doesn't check the validity of gateway_ip as a subnet had been created
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Opinion
|
Medium
|
Unassigned |
Bug Description
neutron doesn't check the validity of gateway_ip as a subnet had been created.
Then we attach interface into a router for this subnet, the neutron-server will report a error, like: "IP address 10.10.13.254 is not a valid IP for the specified subnet."
How to reproduce:
1. create a subnet, specify the gateway_ip which isn't in the cidr range.
# neutron subnet-create --name xxxx-subnet12 --gateway 10.10.13.254 xxx-net1 10.10.13.0/25
2. create a router:
# neutron router-create xxx-router1
3. attach interface into a router for this subnet.
# neutron router-
result:
expected: success
real: unsuccessful, "IP address 10.10.13.254 is not a valid IP for the specified subnet."
Improve:
So, I think we should check the validity of gateway_ip for subnet when create a subnet.
tests:
[root@xxxx]# neutron subnet-create --name xxx-subnet12 --gateway 10.10.13.254 xxx-pool-net1 10.10.13.0/25
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
Created a new subnet:
+------
| Field | Value |
+------
| allocation_pools | {"start": "10.10.13.1", "end": "10.10.13.126"} |
| available_ip_number | 126 |
| available_ips | {"start": "10.10.13.1", "end": "10.10.13.126"} |
| cidr | 10.10.13.0/25 |
| created_at | 2019-07-
| description | |
| dns_nameservers | |
| enable_dhcp | True |
| gateway_ip | 10.10.13.254 |
| host_routes | |
| id | 16dc9a28-
| ip_version | 4 |
| ipv6_address_mode | |
| ipv6_ra_mode | |
| name | xxx-subnet12 |
| network_id | 2fa614ec-
| project_id | f0208ec2708e436
| revision_number | 0 |
| service_types | |
| subnetpool_id | |
| tags | |
| tenant_id | f0208ec2708e436
| updated_at | 2019-07-
+------
[root@xxx]# neutron router-
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
IP address 10.10.13.254 is not a valid IP for the specified subnet.
Neutron server returns request_ids: ['req-c58bab6f-
Changed in neutron: | |
assignee: | nobody → Li Zhouzhou (lizhouzhou) |
description: | updated |
Changed in neutron: | |
importance: | Undecided → Medium |
status: | In Progress → Opinion |
Fix proposed to branch: master /review. opendev. org/669030
Review: https:/