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

gateway4 and gateway6 have been deprecated in netplan #4031

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

gateway4 and gateway6 have been deprecated in netplan #4031

ubuntu-server-builder opened this issue May 12, 2023 · 6 comments
Labels
launchpad Migrated from Launchpad priority Fix soon

Comments

@ubuntu-server-builder
Copy link
Collaborator

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

Launchpad details
affected_projects = []
assignee = aciba
assignee_name = Alberto Contreras
date_closed = 2023-02-22T16:52:23.434349+00:00
date_created = 2022-10-11T20:24:46.345984+00:00
date_fix_committed = 2022-11-18T09:09:16.690379+00:00
date_fix_released = 2023-02-22T16:52:23.434349+00:00
id = 1992512
importance = high
is_complete = True
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1992512
milestone = None
owner = akutz
owner_name = Andrew Kutz
private = False
status = fix_released
submitter = akutz
submitter_name = Andrew Kutz
tags = []
duplicates = []

Launchpad user Andrew Kutz(akutz) wrote on 2022-10-11T20:24:46.345984+00:00

Per the netplan reference documentation (https://netplan.io/reference), the scalar fields "gateway4" and "gateway6" have been deprecated:

Deprecated, see Default routes. Set default gateway for IPv4/6, for manual address configuration. This requires setting addresses too. Gateway IPs must be in a form recognized by inet_pton(3). There should only be a single gateway per IP address family set in your global config, to make it unambiguous. If you need multiple default routes, please define them via routing-policy.

However, I checked, and nothing in the Cloud-Init bug tracker or GitHub repository indicates there are plans for Cloud-Init to address this change:

Additionally:

  • the Cloud-Init network_state module still uses both fields --
    "gateway4",
    "gateway6",
  • the Cloud-Init netplan module still references both fields --
    if ":" in gateway:
    entry.update({"gateway6": gateway})
    else:
    entry.update({"gateway4": gateway})
  • both fields are still part of the network unit tests --
    NETPLAN_DHCP_FALSE = """
    version: 2
    ethernets:
    ens3:
    match:
    macaddress: 52:54:00:ab:cd:ef
    dhcp4: false
    dhcp6: false
    addresses:
    - 192.168.42.100/24
    - 2001:db8::100/32
    gateway4: 192.168.42.1
    gateway6: 2001:db8::1
    nameservers:
    search: [example.com]
    addresses: [192.168.42.53, 1.1.1.1]
    """

I am curious to find out:

  • What is Cloud-Init's plan to handle the gateway4 and gateway6 fields?
  • Will Cloud-Init deprecate them from their network v2 config to be aligned with netplan?
  • Will Cloud-Init continue to support them and seamless produce the recommended default routes per netplan's documentation?
  • What is the timeline for any such change or changes?

Thanks!

@ubuntu-server-builder ubuntu-server-builder added launchpad Migrated from Launchpad priority Fix soon labels May 12, 2023
@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user James Falcon(falcojr) wrote on 2022-10-12T21:46:21.010523+00:00

Yeah, this is something I have noticed alread. I created a ticket internally to get it fixed "soon", but you're right in that there's nothing in Launchpad yet.

To your questions, this is my current thinking, but could change if needed:

For v1, the config won't change. We'll render the appropriate routes instead. For v2 not Ubuntu, we'll deprecate but still support it while probably throwing a warning for the old version. It's a little trickier for Ubuntu since we passthrough netplan config. On Ubuntu, I don't see us supporting the deprecated keys any longer than Netplan does. As far as timeline, we should have a fix ready by 23.1.

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Alberto Contreras(aciba) wrote on 2022-11-18T09:09:07.365214+00:00

Fix committed here: #1794

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user shixuantong(sxt1001) wrote on 2022-12-10T06:47:41.581030+00:00

The problem seems to have been resolved enough to close it. There are a lot of open bugs.

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user James Falcon(falcojr) wrote on 2022-12-12T13:29:28.837024+00:00

This has not yet been released upstream, so it will stay the current status until 23.1 is released.

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user shixuantong(sxt1001) wrote on 2022-12-15T09:29:50.799987+00:00

ok. Thanks. I get it.

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Alberto Contreras(aciba) wrote on 2023-02-22T16:52:24.099276+00:00

This bug is believed to be fixed in cloud-init in version 23.1. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
launchpad Migrated from Launchpad priority Fix soon
Projects
None yet
Development

No branches or pull requests

1 participant