Redundant ipv6 address(SLAAC/DHCPv6 stateless) created for port
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(
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.
| cidr | 192.0.2.0/24 |
| created_at | 2019-09-
| description | |
| dns_nameservers | |
| enable_dhcp | True |
| gateway_ip | 192.0.2.1 |
| host_routes | |
| id | cff452fd-
| ip_version | 4 |
| ipv6_address_mode | None |
| ipv6_ra_mode | None |
| location | Munch({'project': Munch({'domain_id': None, 'id': u'37a1fc155ecf4
| name | ipv4-subnet |
| network_id | ae5a6f43-
| prefix_length | None |
| project_id | 37a1fc155ecf4fc
| revision_number | 0 |
| segment_id | None |
| service_types | |
| subnetpool_id | None |
| tags | |
| updated_at | 2019-09-
+------
~$ openstack subnet create ipv6-subnet --network net-01 --ip-version=6 --ipv6-
+------
| Field | Value |
+------
| allocation_pools | 2004::2-
| cidr | 2004::/64 |
| created_at | 2019-09-
| description | |
| dns_nameservers | |
| enable_dhcp | True |
| gateway_ip | 2004::1 |
| host_routes | |
| id | b56e5697-
| ip_version | 6 |
| ipv6_address_mode | slaac |
| ipv6_ra_mode | slaac |
| location | Munch({'project': Munch({'domain_id': None, 'id': u'37a1fc155ecf4
| name | ipv6-subnet |
| network_id | ae5a6f43-
| prefix_length | None |
| project_id | 37a1fc155ecf4fc
| revision_number | 0 |
| segment_id | None |
| service_types | |
| subnetpool_id | None |
| tags | |
| updated_at | 2019-09-
+------
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_
| binding_host_id | None |
| binding_profile | None |
| binding_vif_details | None |
| binding_vif_type | None |
| binding_vnic_type | normal |
| created_at | 2019-09-
| 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=
| | ip_address=
| id | 00b2ade7-
| location | Munch({'project': Munch({'domain_id': None, 'id': u'37a1fc155ecf4
| mac_address | fa:16:3e:4a:32:78 |
| name | port-only-ipv4 |
| network_id | ae5a6f43-
| port_security_
| project_id | 37a1fc155ecf4fc
| propagate_
| qos_policy_id | None |
| resource_request | None |
| revision_number | 7 |
| security_group_ids | 40d4ed5f-
| status | DOWN |
| tags | |
| trunk_details | None |
| updated_at | 2019-09-
+------
As we see we get redundant ipv6 address(SLAAC IP) for this port.
Expected is to get ipv4 address only for this port.
tags: | added: ipv6 |
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