gateway4 and gateway6 have been deprecated in netplan

Bug #1992512 reported by Andrew Kutz
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
Alberto Contreras

Bug Description

Per the netplan reference documentation (, 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:



* the Cloud-Init network_state module still uses both fields --
* the Cloud-Init netplan module still references both fields --
* both fields are still part of the network unit tests --

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?


Revision history for this message
James Falcon (falcojr) wrote :

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.

Changed in cloud-init:
status: New → Triaged
importance: Undecided → High
Changed in cloud-init:
assignee: nobody → Alberto Contreras (aciba)
status: Triaged → In Progress
Revision history for this message
Alberto Contreras (aciba) wrote :
Changed in cloud-init:
status: In Progress → Fix Committed
Revision history for this message
shixuantong (sxt1001) wrote :

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

Revision history for this message
James Falcon (falcojr) wrote :

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

Revision history for this message
shixuantong (sxt1001) wrote :

ok. Thanks. I get it.

Revision history for this message
Alberto Contreras (aciba) wrote : Fixed in cloud-init version 23.1.

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.

Changed in cloud-init:
status: Fix Committed → Fix Released
Revision history for this message
James Falcon (falcojr) wrote :
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.