I newly installed Ubuntu 22.04 and configured netplan like this:
network:
version: 2
ethernets:
ens18:
addresses:
- 10.10.0.101/24
- 2009:470:1099:10::101/64
dhcp4: false
dhcp6: false
accept-ra: false
gateway4: 10.10.0.1
gateway6: 2009:470:1099:10::1
nameservers:
addresses:
- 8.8.8.8
- 2001:4860:4860::8888
After boot I get this warning
** (generate:1099): WARNING **: 15:10:35.646: `gateway4` has been deprecated, use default routes instead.
See the 'Default routes' section of the documentation for more details.
** (generate:1099): WARNING **: 15:10:35.646: `gateway4` has been deprecated, use default routes instead.
See the 'Default routes' section of the documentation for more details.
How to get rid of this warning?
Please see:
Please amend your netplan file to use the current method; for example:
Follow with:
I found with 2 NICs using the routes: command throws errors, even with the metric: command used for each route.
Using gateway4: & gateway6: for each interface works. It is not the recommended syntax as chili555 says though.
See the following for an excellent breakdown of current syntax:
Netplan Configuration Examples