Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPv6-enabled EC2 subnets always have dhcp enabled #3980

Closed
ubuntu-server-builder opened this issue May 12, 2023 · 2 comments
Closed

IPv6-enabled EC2 subnets always have dhcp enabled #3980

ubuntu-server-builder opened this issue May 12, 2023 · 2 comments
Labels
bug Something isn't working correctly launchpad Migrated from Launchpad priority Fix soon

Comments

@ubuntu-server-builder
Copy link
Collaborator

This bug was originally filed in Launchpad as LP: #1976526

Launchpad details
affected_projects = ['cloud-init (Fedora)']
assignee = None
assignee_name = None
date_closed = None
date_created = 2022-06-01T15:26:26.024707+00:00
date_fix_committed = None
date_fix_released = None
id = 1976526
importance = high
is_complete = False
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1976526
milestone = None
owner = rackerhacker
owner_name = Major Hayden
private = False
status = triaged
submitter = rackerhacker
submitter_name = Major Hayden
tags = []
duplicates = []

Launchpad user Major Hayden(rackerhacker) wrote on 2022-06-01T15:26:26.024707+00:00

A Fedora user opened an issue[0] about an issue with cloud-init on EC2. When they launch an instance on a IPv6-enabled subnet, cloud-init sets the ipv6.method to dhcp in NetworkManager.

However, AWS uses router advertisements to let instances know about the nearest router. Using the ipv6.method: dhcp setting prevents router advertisements from working. The instance ends up with an IPv6 address assigned, but it cannot route traffic.

A workaround is to run NetworkManager commands to fix the issue:

nmcli con edit CONNECTION_UUID
nmcli> set ipv6.method auto 
nmcli> save
nmcli> activate

The instance immediately routes IPv6 traffic after making that change. The dhcp setting appears to be applied automatically for EC2 subnets with IPv6 addresses assigned[1].

I would expect ipv6.method to be auto in these situations.

Thank you!

[0] https://pagure.io/cloud-sig/issue/382
[1]

nic_metadata = macs_metadata.get(mac)
if nic_metadata.get("ipv6s"): # Any IPv6 addresses configured
dev_config["dhcp6"] = True

@ubuntu-server-builder ubuntu-server-builder added bug Something isn't working correctly launchpad Migrated from Launchpad priority Fix soon labels May 12, 2023
@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user mhayden(mhayden-redhat-bugs) wrote on 2022-06-01T15:28:42+00:00

A Fedora user opened an issue[0] about an issue with cloud-init on EC2. When they launch an instance on a IPv6-enabled subnet, cloud-init sets the ipv6.method to dhcp in NetworkManager.

However, AWS uses router advertisements to let instances know about the nearest router. Using the ipv6.method: dhcp setting prevents router advertisements from working. The instance ends up with an IPv6 address assigned, but it cannot route traffic.

A workaround is to run NetworkManager commands to fix the issue:

nmcli con edit CONNECTION_UUID
nmcli> set ipv6.method auto
nmcli> save
nmcli> activate

The instance immediately routes IPv6 traffic after making that change. The dhcp setting appears to be applied automatically for EC2 subnets with IPv6 addresses assigned[1].

I would expect ipv6.method to be auto in these situations.

Thank you!

[0] https://pagure.io/cloud-sig/issue/382
[1]

nic_metadata = macs_metadata.get(mac)
if nic_metadata.get("ipv6s"): # Any IPv6 addresses configured
dev_config["dhcp6"] = True

major added a commit to major/cloud-init that referenced this issue Mar 26, 2024
When cloud-init finds any ipv6 information in the instance metadata, it
automatically enables dhcp6 for the network interface. However, this
brings up the instance with a broken IPv6 configuration because SLAAC
should be used for almost all situations on EC2.

Red Hat BZ: https://bugzilla.redhat.com/show_bug.cgi?id=2092459
Fedora Pagure: https://pagure.io/cloud-sig/issue/382
Upstream: https://bugs.launchpad.net/cloud-init/+bug/1976526

Fixes: canonical#3980

Signed-off-by: Major Hayden <major@redhat.com>
major added a commit to major/cloud-init that referenced this issue Mar 26, 2024
When cloud-init finds any ipv6 information in the instance metadata, it
automatically enables dhcp6 for the network interface. However, this
brings up the instance with a broken IPv6 configuration because SLAAC
should be used for almost all situations on EC2.

Red Hat BZ: https://bugzilla.redhat.com/show_bug.cgi?id=2092459
Fedora Pagure: https://pagure.io/cloud-sig/issue/382
Upstream: https://bugs.launchpad.net/cloud-init/+bug/1976526

Fixes: canonical#3980

Signed-off-by: Major Hayden <major@redhat.com>
@holmanb holmanb closed this as completed in f0fb841 Apr 1, 2024
aciba90 added a commit to aciba90/cloud-init that referenced this issue Apr 2, 2024
After [0, 1], dhcp6 is going to be always false after upgrading
cloud-init. Correct this in the integration test.

Refs:
[0] canonical#3980
[1] https://bugs.launchpad.net/cloud-init/+bug/1976526
@aciba90
Copy link
Contributor

aciba90 commented Apr 2, 2024

On systems without NetworkManager (directly used, or as a Netplan backend), the switch to dhcp6=false may be considered a change of behavior.

As shown in #5131, Ubuntu systems upgrading cloud-init to 24.1.x in bionic, focal, jammy and mantic.

Do we want to patch this fix out for b, f, j and m? @holmanb.

holmanb pushed a commit that referenced this issue Apr 2, 2024
After [0, 1], dhcp6 is going to be always false after upgrading
cloud-init. Correct this in the integration test.

Refs:
[0] #3980
[1] https://bugs.launchpad.net/cloud-init/+bug/1976526
holmanb pushed a commit that referenced this issue Apr 3, 2024
When cloud-init finds any ipv6 information in the instance metadata, it
automatically enables dhcp6 for the network interface. However, this
brings up the instance with a broken IPv6 configuration because SLAAC
should be used for almost all situations on EC2.

Red Hat BZ: https://bugzilla.redhat.com/show_bug.cgi?id=2092459
Fedora Pagure: https://pagure.io/cloud-sig/issue/382
Upstream: https://bugs.launchpad.net/cloud-init/+bug/1976526

Fixes GH-3980

Signed-off-by: Major Hayden <major@redhat.com>
holmanb pushed a commit that referenced this issue Apr 3, 2024
After [0, 1], dhcp6 is going to be always false after upgrading
cloud-init. Correct this in the integration test.

Refs:
[0] #3980
[1] https://bugs.launchpad.net/cloud-init/+bug/1976526
holmanb pushed a commit that referenced this issue Apr 3, 2024
When cloud-init finds any ipv6 information in the instance metadata, it
automatically enables dhcp6 for the network interface. However, this
brings up the instance with a broken IPv6 configuration because SLAAC
should be used for almost all situations on EC2.

Red Hat BZ: https://bugzilla.redhat.com/show_bug.cgi?id=2092459
Fedora Pagure: https://pagure.io/cloud-sig/issue/382
Upstream: https://bugs.launchpad.net/cloud-init/+bug/1976526

Fixes GH-3980

Signed-off-by: Major Hayden <major@redhat.com>
holmanb pushed a commit that referenced this issue Apr 3, 2024
After [0, 1], dhcp6 is going to be always false after upgrading
cloud-init. Correct this in the integration test.

Refs:
[0] #3980
[1] https://bugs.launchpad.net/cloud-init/+bug/1976526
holmanb pushed a commit that referenced this issue Apr 3, 2024
When cloud-init finds any ipv6 information in the instance metadata, it
automatically enables dhcp6 for the network interface. However, this
brings up the instance with a broken IPv6 configuration because SLAAC
should be used for almost all situations on EC2.

Red Hat BZ: https://bugzilla.redhat.com/show_bug.cgi?id=2092459
Fedora Pagure: https://pagure.io/cloud-sig/issue/382
Upstream: https://bugs.launchpad.net/cloud-init/+bug/1976526

Fixes GH-3980

Signed-off-by: Major Hayden <major@redhat.com>
holmanb pushed a commit that referenced this issue Apr 3, 2024
After [0, 1], dhcp6 is going to be always false after upgrading
cloud-init. Correct this in the integration test.

Refs:
[0] #3980
[1] https://bugs.launchpad.net/cloud-init/+bug/1976526
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly launchpad Migrated from Launchpad priority Fix soon
Projects
None yet
Development

No branches or pull requests

2 participants