← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1856675] Re: IPv6 Prefix Delegation do not work

 

Reviewed:  https://review.opendev.org/699465
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=0b3cff33c1904b82146701b521749cff01f44e9a
Submitter: Zuul
Branch:    master

commit 0b3cff33c1904b82146701b521749cff01f44e9a
Author: Rodolfo Alonso Hernandez <ralonsoh@xxxxxxxxxx>
Date:   Tue Dec 17 16:50:36 2019 +0000

    Subnet gateway should be a valid IP
    
    When a subnet is created and allocated, the gateway IP is created
    based on the subnet CIDR. In case of IPv6 prefix delegation, this
    CIDR is a temporary one. In this case the gateway IP cannot be
    assigned yet and the value stored in the DB should be "None".
    
    IpamBackendMixin._gateway_ip_str must read properly the IP version
    stored in the "subnet" variable, under the key "ip_version"
    instead of "version".
    
    Closes-Bug: #1856726
    Closes-Bug: #1856675
    
    Change-Id: I9313c880cc458f08dc3a1b0ff13187b764ba7042


** Changed in: neutron
       Status: In Progress => Fix Released

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

Title:
  IPv6 Prefix Delegation do not work

Status in neutron:
  Fix Released

Bug description:
  Deployed by kolla-ansible in docker containers using source binaries
  kolla_base_distro: "ubuntu"
  kolla_install_type: "source"
  openstack_release: "train"

  
  IPv6 prefix delegation described at https://docs.openstack.org/neutron/train/admin/config-ipv6.html#prefix-delegation do not work.

  When enabling prefix delegation on a subnet I get errors in my neutron/neutron-dhcp-agent.log file about "pyroute2.netlink.exceptions.NetlinkError: (22, 'Invalid argument')".
  http://paste.openstack.org/show/787656/

  
  below is the workflow I have used when trying to get IPv6 prefix delegation to work.


  --------------------------------------
  #!/usr/bin/env bash

  set -o errexit
  set -o pipefail
  set -o nounset
  set -o xtrace

  # neutron.conf has this set
  #ipv6_pd_enabled = True

  # Clear any old environment that may conflict.
  for key in $( set | awk '{FS="="}  /^OS_/ {print $1}' ); do unset "${key}" ; done

  # Connect to
  export OS_AUTH_URL=https://openstack.example.com:5000
  export OS_AUTH_PLUGIN=password
  export OS_IDENTITY_API_VERSION=3
  export OS_INTERFACE=public
  export OS_REGION_NAME=RegionOne

  # Authentication
  export OS_USER_DOMAIN_NAME="Default"
  export OS_USERNAME=admin
  export OS_PASSWORD=xxxxxxxxxxxxxxxxxxx

  # Authorization - Resource to work on (scope)
  export OS_SYSTEM_SCOPE=all

  # Varibles used in this test
  domain='testDomain'
  project='testProject'
  network_external='public'
  network_internal='private'
  router='testRouter'
  vlan_number='1554'
  phys_network='physnet1'
  ipv4_public_range='185.xx.xx.0/24'
  ipv4_public_gateway='185.xx.xx.1'
  ipv6_public_range='2a02:xxx:xxx:xxx::/64'

  # Create domain and project
  openstack domain create "${domain}"
  openstack project create --domain "${domain}" "${project}"

  # Create external and internal networks
  openstack network create --project "${project}" --project-domain "${domain}" \
  --external \
  --provider-physical-network "${phys_network}" \
  --provider-network-type vlan \
  --provider-segment "${vlan_number}" \
  "${network_external}"

  openstack network create --project "${project}" --project-domain "${domain}" \
  --internal \
  "${network_internal}"

  # Create IPv4 and IPv6 subnets on external network
  openstack subnet create --project "${project}" --project-domain "${domain}" \
  --network "${network_external}" \
  --subnet-range "${ipv4_public_range}" \
  --gateway "${ipv4_public_gateway}" \
  --dns-nameserver 1.1.1.1 --dns-nameserver 1.0.0.1 \
  "${network_external}"-ipv4

  openstack subnet create --project "${project}" --project-domain "${domain}" \
  --network "${network_external}" \
  --subnet-range "${ipv6_public_range}" \
  --dns-nameserver 2606:4700:4700::1111 --dns-nameserver 2606:4700:4700::1001 \
  --ip-version=6 \
  --ipv6-address-mode=slaac --ipv6-ra-mode=slaac \
  "${network_external}"-ipv6

  # Create router and set gateway for external network
  openstack router create --project "${project}" --project-domain "${domain}" \
  "${router}"
  openstack router set --external-gateway "${network_external}" "${router}"

  # Create IPv4 subnet on internal network
  openstack subnet create --project "${project}" --project-domain "${domain}" \
  --network "${network_internal}" \
  --subnet-range 10.99.99.0/24 \
  --gateway 10.99.99.1 \
  --dns-nameserver 1.1.1.1 --dns-nameserver 1.0.0.1 \
  "${network_internal}"-ipv4

  # Create IPv6 subnet on internal network
  # with prefix delegation
  openstack subnet create --project "${project}" --project-domain "${domain}" \
  --network "${network_internal}" \
  --ip-version 6 \
  --ipv6-ra-mode slaac --ipv6-address-mode slaac \
  --use-prefix-delegation True \
  "${network_internal}"-ipv6

  
  # In my neutron/neutron-dhcp-agent.log I now have the error
  # pyroute2.netlink.exceptions.NetlinkError: (22, 'Invalid argument')
  # and a Traceback. http://paste.openstack.org/show/787656/

  
  # Add internal subnets to router
  openstack router add subnet "${router}" "${network_internal}"-ipv4
  openstack router add subnet "${router}" "${network_internal}"-ipv6

  # Show subnet
  openstack subnet show "${network_internal}"-ipv6 | grep cidr
  # Which is ::/64 and prefix delegation is not working

  
  # Cleanup
  openstack router remove subnet "${router}" "${network_internal}"-ipv4
  openstack router remove subnet "${router}" "${network_internal}"-ipv6
  openstack router remove subnet "${router}" "${network_external}"-ipv4
  openstack router remove subnet "${router}" "${network_external}"-ipv6
  openstack router delete "${router}"
  openstack subnet delete "${network_internal}"-ipv4
  openstack subnet delete "${network_internal}"-ipv6
  openstack subnet delete "${network_external}"-ipv4
  openstack subnet delete "${network_external}"-ipv6
  openstack network delete "${network_internal}"
  openstack network delete "${network_external}"
  openstack project delete --domain "${domain}" "${project}"
  openstack domain set --disable "${domain}"
  openstack domain delete "${domain}"

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


References