← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1527098] [NEW] can update the gateway of subnet to a used ip

 

Public bug reported:

[Summary]
can update the gateway of subnet to a used ip 

[Topo]
devstack all-in-one node

[Description and expect result]
can not update the gateway of subnet to a used ip , should reject the update and give error info.

[Reproduceable or not]
reproduceable 

[Recreate Steps]
1) create a network/subnet:
root@45-59:/opt/stack/devstack# neutron subnet-create net-12 12.0.0.0/24 --name sub-12
Created a new subnet:
+-------------------+--------------------------------------------+
| Field             | Value                                      |
+-------------------+--------------------------------------------+
| allocation_pools  | {"start": "12.0.0.2", "end": "12.0.0.254"} |
| cidr              | 12.0.0.0/24                                |
| dns_nameservers   |                                            |
| enable_dhcp       | True                                       |
| gateway_ip        | 12.0.0.1                                   |
| host_routes       |                                            |
| id                | aec8b045-8c8b-4e13-b0ae-0725ccc9446a       |
| ip_version        | 4                                          |
| ipv6_address_mode |                                            |
| ipv6_ra_mode      |                                            |
| name              | sub-12                                     |
| network_id        | ead8928b-eab8-405c-af1d-d43d2bee69c4       |
| subnetpool_id     |                                            |
| tenant_id         | 6c15aacc1cfe4a9fac35a0c7f8c3e912           |
+-------------------+--------------------------------------------+

2) update the pool of the subnet:
root@45-59:/opt/stack/devstack# neutron subnet-update --allocation-pool start=12.0.0.100,end=12.0.0.200 sub-12
Updated subnet: sub-12
root@45-59:/opt/stack/devstack# 
root@45-59:/opt/stack/devstack# neutron subnet-show sub-12
+-------------------+----------------------------------------------+
| Field             | Value                                        |
+-------------------+----------------------------------------------+
| allocation_pools  | {"start": "12.0.0.100", "end": "12.0.0.200"} |
| cidr              | 12.0.0.0/24                                  |
| dns_nameservers   |                                              |
| enable_dhcp       | True                                         |
| gateway_ip        | 12.0.0.1                                     |
| host_routes       |                                              |
| id                | aec8b045-8c8b-4e13-b0ae-0725ccc9446a         |
| ip_version        | 4                                            |
| ipv6_address_mode |                                              |
| ipv6_ra_mode      |                                              |
| name              | sub-12                                       |
| network_id        | ead8928b-eab8-405c-af1d-d43d2bee69c4         |
| subnetpool_id     |                                              |
| tenant_id         | 6c15aacc1cfe4a9fac35a0c7f8c3e912             |
+-------------------+----------------------------------------------+

3) we see the ip address "12.0.0.2" is used by dhcp port: 
root@45-59:/opt/stack/devstack# neutron port-list | grep 12.0.0
| e125259d-a06b-434d-8440-b0847b6305b5 |      | fa:16:3e:cd:a3:0b | {"subnet_id": "aec8b045-8c8b-4e13-b0ae-0725ccc9446a", "ip_address": "12.0.0.2"}                             |
root@45-59:/opt/stack/devstack# 

4)update the gateway to the used ip, succeeded, no error:   >>>ISSUE
root@45-59:/opt/stack/devstack# neutron subnet-update --gateway 12.0.0.2 sub-12
Updated subnet: sub-12
root@45-59:/opt/stack/devstack# 

5) update the gateway to another available ip, failed:  
root@45-59:/opt/stack/devstack# neutron subnet-update --gateway 12.0.0.3 sub-12
Current gateway ip 12.0.0.2 already in use by port e125259d-a06b-434d-8440-b0847b6305b5. Unable to update.
root@45-59:/opt/stack/devstack# 
root@45-59:/opt/stack/devstack# 
root@45-59:/opt/stack/devstack# neutron subnet-show sub-12
+-------------------+----------------------------------------------+
| Field             | Value                                        |
+-------------------+----------------------------------------------+
| allocation_pools  | {"start": "12.0.0.100", "end": "12.0.0.200"} |
| cidr              | 12.0.0.0/24                                  |
| dns_nameservers   |                                              |
| enable_dhcp       | True                                         |
| gateway_ip        | 12.0.0.2                                     |
| host_routes       |                                              |
| id                | aec8b045-8c8b-4e13-b0ae-0725ccc9446a         |
| ip_version        | 4                                            |
| ipv6_address_mode |                                              |
| ipv6_ra_mode      |                                              |
| name              | sub-12                                       |
| network_id        | ead8928b-eab8-405c-af1d-d43d2bee69c4         |
| subnetpool_id     |                                              |
| tenant_id         | 6c15aacc1cfe4a9fac35a0c7f8c3e912             |
+-------------------+----------------------------------------------+
root@45-59:/opt/stack/devstack# 
 

[Configration]
reproduceable bug, no need

[logs]
reproduceable bug, no need

[Root cause anlyze or debug inf]
reproduceable bug

[Attachment]
None

** Affects: neutron
     Importance: Undecided
     Assignee: Bo Chi (bochi-michael)
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1527098

Title:
  can update the gateway of subnet to a used ip

Status in neutron:
  New

Bug description:
  [Summary]
  can update the gateway of subnet to a used ip 

  [Topo]
  devstack all-in-one node

  [Description and expect result]
  can not update the gateway of subnet to a used ip , should reject the update and give error info.

  [Reproduceable or not]
  reproduceable 

  [Recreate Steps]
  1) create a network/subnet:
  root@45-59:/opt/stack/devstack# neutron subnet-create net-12 12.0.0.0/24 --name sub-12
  Created a new subnet:
  +-------------------+--------------------------------------------+
  | Field             | Value                                      |
  +-------------------+--------------------------------------------+
  | allocation_pools  | {"start": "12.0.0.2", "end": "12.0.0.254"} |
  | cidr              | 12.0.0.0/24                                |
  | dns_nameservers   |                                            |
  | enable_dhcp       | True                                       |
  | gateway_ip        | 12.0.0.1                                   |
  | host_routes       |                                            |
  | id                | aec8b045-8c8b-4e13-b0ae-0725ccc9446a       |
  | ip_version        | 4                                          |
  | ipv6_address_mode |                                            |
  | ipv6_ra_mode      |                                            |
  | name              | sub-12                                     |
  | network_id        | ead8928b-eab8-405c-af1d-d43d2bee69c4       |
  | subnetpool_id     |                                            |
  | tenant_id         | 6c15aacc1cfe4a9fac35a0c7f8c3e912           |
  +-------------------+--------------------------------------------+

  2) update the pool of the subnet:
  root@45-59:/opt/stack/devstack# neutron subnet-update --allocation-pool start=12.0.0.100,end=12.0.0.200 sub-12
  Updated subnet: sub-12
  root@45-59:/opt/stack/devstack# 
  root@45-59:/opt/stack/devstack# neutron subnet-show sub-12
  +-------------------+----------------------------------------------+
  | Field             | Value                                        |
  +-------------------+----------------------------------------------+
  | allocation_pools  | {"start": "12.0.0.100", "end": "12.0.0.200"} |
  | cidr              | 12.0.0.0/24                                  |
  | dns_nameservers   |                                              |
  | enable_dhcp       | True                                         |
  | gateway_ip        | 12.0.0.1                                     |
  | host_routes       |                                              |
  | id                | aec8b045-8c8b-4e13-b0ae-0725ccc9446a         |
  | ip_version        | 4                                            |
  | ipv6_address_mode |                                              |
  | ipv6_ra_mode      |                                              |
  | name              | sub-12                                       |
  | network_id        | ead8928b-eab8-405c-af1d-d43d2bee69c4         |
  | subnetpool_id     |                                              |
  | tenant_id         | 6c15aacc1cfe4a9fac35a0c7f8c3e912             |
  +-------------------+----------------------------------------------+

  3) we see the ip address "12.0.0.2" is used by dhcp port: 
  root@45-59:/opt/stack/devstack# neutron port-list | grep 12.0.0
  | e125259d-a06b-434d-8440-b0847b6305b5 |      | fa:16:3e:cd:a3:0b | {"subnet_id": "aec8b045-8c8b-4e13-b0ae-0725ccc9446a", "ip_address": "12.0.0.2"}                             |
  root@45-59:/opt/stack/devstack# 

  4)update the gateway to the used ip, succeeded, no error:   >>>ISSUE
  root@45-59:/opt/stack/devstack# neutron subnet-update --gateway 12.0.0.2 sub-12
  Updated subnet: sub-12
  root@45-59:/opt/stack/devstack# 

  5) update the gateway to another available ip, failed:  
  root@45-59:/opt/stack/devstack# neutron subnet-update --gateway 12.0.0.3 sub-12
  Current gateway ip 12.0.0.2 already in use by port e125259d-a06b-434d-8440-b0847b6305b5. Unable to update.
  root@45-59:/opt/stack/devstack# 
  root@45-59:/opt/stack/devstack# 
  root@45-59:/opt/stack/devstack# neutron subnet-show sub-12
  +-------------------+----------------------------------------------+
  | Field             | Value                                        |
  +-------------------+----------------------------------------------+
  | allocation_pools  | {"start": "12.0.0.100", "end": "12.0.0.200"} |
  | cidr              | 12.0.0.0/24                                  |
  | dns_nameservers   |                                              |
  | enable_dhcp       | True                                         |
  | gateway_ip        | 12.0.0.2                                     |
  | host_routes       |                                              |
  | id                | aec8b045-8c8b-4e13-b0ae-0725ccc9446a         |
  | ip_version        | 4                                            |
  | ipv6_address_mode |                                              |
  | ipv6_ra_mode      |                                              |
  | name              | sub-12                                       |
  | network_id        | ead8928b-eab8-405c-af1d-d43d2bee69c4         |
  | subnetpool_id     |                                              |
  | tenant_id         | 6c15aacc1cfe4a9fac35a0c7f8c3e912             |
  +-------------------+----------------------------------------------+
  root@45-59:/opt/stack/devstack# 
   

  [Configration]
  reproduceable bug, no need

  [logs]
  reproduceable bug, no need

  [Root cause anlyze or debug inf]
  reproduceable bug

  [Attachment]
  None

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1527098/+subscriptions


Follow ups