Redundant ipv6 address(SLAAC/DHCPv6 stateless) created for port

Bug #1844097 reported by Serena Li
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Invalid
Undecided
Unassigned

Bug Description

When one network has one ipv4 subnet and one ipv6 subnet(SLAAC/DHCPv6 stateless), if wanting to create a port only includes ipv4 address, there will be redundant ipv6 address(SLAAC/DHCPv6 stateless) created for this port.
PS: if the ipv6 subnet is Default(No options specified) or DHCPv6 stateful this issue does not ever occur.

Scenario:
1) create a network and two subnets: one ipv4 subnet and one ipv6 subnet(SLAAC/DHCPv6 stateless)
~$ openstack network create net-01
~$ openstack subnet create ipv4-subnet --network net-01 --subnet-range 192.0.2.0/24
+-------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| allocation_pools | 192.0.2.2-192.0.2.254 |
| cidr | 192.0.2.0/24 |
| created_at | 2019-09-16T07:08:45Z |
| description | |
| dns_nameservers | |
| enable_dhcp | True |
| gateway_ip | 192.0.2.1 |
| host_routes | |
| id | cff452fd-f982-43fd-be1a-201225d30c51 |
| ip_version | 4 |
| ipv6_address_mode | None |
| ipv6_ra_mode | None |
| location | Munch({'project': Munch({'domain_id': None, 'id': u'37a1fc155ecf4fccbedf924e5906510a', 'name': 'a1672_CLCM', 'domain_name': 'Default'}), 'cloud': '', 'region_name': 'regionOne', 'zone': None}) |
| name | ipv4-subnet |
| network_id | ae5a6f43-6485-4218-a7d0-0047882e2811 |
| prefix_length | None |
| project_id | 37a1fc155ecf4fccbedf924e5906510a |
| revision_number | 0 |
| segment_id | None |
| service_types | |
| subnetpool_id | None |
| tags | |
| updated_at | 2019-09-16T07:08:45Z |
+-------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
~$ openstack subnet create ipv6-subnet --network net-01 --ip-version=6 --ipv6-ra-mode=slaac --ipv6-address-mode=slaac --subnet-range 2004::/64
+-------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| allocation_pools | 2004::2-2004::ffff:ffff:ffff:ffff |
| cidr | 2004::/64 |
| created_at | 2019-09-16T07:12:19Z |
| description | |
| dns_nameservers | |
| enable_dhcp | True |
| gateway_ip | 2004::1 |
| host_routes | |
| id | b56e5697-75b1-451f-95c4-bc1562d94ac4 |
| ip_version | 6 |
| ipv6_address_mode | slaac |
| ipv6_ra_mode | slaac |
| location | Munch({'project': Munch({'domain_id': None, 'id': u'37a1fc155ecf4fccbedf924e5906510a', 'name': 'a1672_CLCM', 'domain_name': 'Default'}), 'cloud': '', 'region_name': 'regionOne', 'zone': None}) |
| name | ipv6-subnet |
| network_id | ae5a6f43-6485-4218-a7d0-0047882e2811 |
| prefix_length | None |
| project_id | 37a1fc155ecf4fccbedf924e5906510a |
| revision_number | 0 |
| segment_id | None |
| service_types | |
| subnetpool_id | None |
| tags | |
| updated_at | 2019-09-16T07:12:19Z |
+-------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

2) Now let's create a port in this network: only one desired subnet(ipv4-subnet) for this port
~$ openstack port create --network net-01 --fixed-ip subnet=ipv4-subnet port-only-ipv4
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| admin_state_up | UP |
| allowed_address_pairs | |
| binding_host_id | None |
| binding_profile | None |
| binding_vif_details | None |
| binding_vif_type | None |
| binding_vnic_type | normal |
| created_at | 2019-09-16T07:13:49Z |
| data_plane_status | None |
| description | |
| device_id | |
| device_owner | |
| dns_assignment | None |
| dns_domain | None |
| dns_name | None |
| extra_dhcp_opts | |
| fixed_ips | ip_address='192.0.2.7', subnet_id='cff452fd-f982-43fd-be1a-201225d30c51' |
| | ip_address='2004::f816:3eff:fe4a:3278', subnet_id='b56e5697-75b1-451f-95c4-bc1562d94ac4' |
| id | 00b2ade7-dcb8-489b-b92b-82b1208aac5f |
| location | Munch({'project': Munch({'domain_id': None, 'id': u'37a1fc155ecf4fccbedf924e5906510a', 'name': 'a1672_CLCM', 'domain_name': 'Default'}), 'cloud': '', 'region_name': 'regionOne', 'zone': None}) |
| mac_address | fa:16:3e:4a:32:78 |
| name | port-only-ipv4 |
| network_id | ae5a6f43-6485-4218-a7d0-0047882e2811 |
| port_security_enabled | True |
| project_id | 37a1fc155ecf4fccbedf924e5906510a |
| propagate_uplink_status | None |
| qos_policy_id | None |
| resource_request | None |
| revision_number | 7 |
| security_group_ids | 40d4ed5f-441f-40e1-8f99-089164271c03 |
| status | DOWN |
| tags | |
| trunk_details | None |
| updated_at | 2019-09-16T07:13:50Z |
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

As we see we get redundant ipv6 address(SLAAC IP) for this port.
Expected is to get ipv4 address only for this port.

Tags: ipv6
tags: added: ipv6
Revision history for this message
Rodolfo Alonso (rodolfo-alonso-hernandez) wrote :

Hello Serena:

When you create a port, attached to a network, you'll receive IP addresses in all the subnets of the network. In your case, you are specifying the IPv4 address, but the IPv6 will be assigned automatically by the IPAM allocation service. If you don't want an IP, remove the subnet from this network.

According to OpenStack docs: [1]
"A subnet is a block of IP addresses and associated configuration state. Subnets are used to allocate IP addresses when new ports are created on a network."

IMO, this bug is invalid.

Regards.

[1]https://docs.openstack.org/python-openstackclient/stein/cli/command-objects/subnet.html

Revision history for this message
Serena Li (lserena) wrote :
Download full text (14.6 KiB)

Hi,

It is very strange that it is only happened if ipv6 subnet is SLAAC or DHCPv6 stateless.
It works well if the ipv6 subnet is dhcpv6-stateful---create port only specifying the IPv4 address, could get ipv4 address only for this port as we expected.

e.g. network includes ipv6 subnet(dhcpv6-stateful):
1) create a network and two subnets: one ipv4 subnet and one ipv6 subnet(SLAAC/DHCPv6 stateless)
~$ openstack network create net-02
~$ openstack subnet create ipv4-subnet --network net-02 --subnet-range 192.0.3.0/24
~$ openstack subnet create ipv6-subnet --network net-02 --ip-version=6 --ipv6-ra-mode=dhcpv6-stateful --ipv6-address-mode=dhcpv6-stateful --subnet-range 2005::/64
+-------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| allocation_pools | 2005::2-2005::ffff:ffff:ffff:ffff |
| cidr | 2005::/64 |
| created_at | 2019-09-19T03:14:15Z |
| description | |
| dns_nameservers | |
| enable_dhcp | True |
| gateway_ip | 2005::1 |
| host_routes | |
| id | 38b6fea7-b29b-47e7-8f2a-c4a8a01d1143 ...

Revision history for this message
Serena Li (lserena) wrote :

written correction in 1) change (SLAAC/DHCPv6 stateless) to (dhcpv6-stateful)
e.g. network includes ipv6 subnet(dhcpv6-stateful):
1) create a network and two subnets: one ipv4 subnet and one ipv6 subnet(dhcpv6-stateful)
~$ openstack network create net-02
~$ openstack subnet create ipv4-subnet --network net-02 --subnet-range 192.0.3.0/24
~$ openstack subnet create ipv6-subnet --network net-02 --ip-version=6 --ipv6-ra-mode=dhcpv6-stateful --ipv6-address-mode=dhcpv6-stateful --subnet-range 2005::/64

Revision history for this message
YAMAMOTO Takashi (yamamoto) wrote :

it's the intended behavior since: https://review.opendev.org/#/c/113339/
maybe someone familiar with the code can explain the rationale. (not me)

Changed in neutron:
status: New → Incomplete
Revision history for this message
Brian Haley (brian-haley) wrote :

This is because with SLAAC and DHCPV6_STATELESS, the instance will auto-configure it's global IPv6 address based on the NIC MAC address, which is known to neutron. In DHCP_STATEFUL it won't do this since the address will be assigned by the DHCP server.

I believe this is working as intended.

Revision history for this message
YAMAMOTO Takashi (yamamoto) wrote :

it's the intended behavior and the reason is explained. (thank you Rodolfo and Brian)

Changed in neutron:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.