Netplan default routes does not accept 0/0 notation

Bug #1997157 reported by Jason Leschnik
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Netplan
Triaged
Low
Unassigned

Bug Description

The documentation `man netplan` indicates that {default, 0/0, 0.0.0.0/0} are all equivalent tokens for the default route.

Documentation
=============
`man netplan`
<snip>
                routes:
                - to: default # could be 0/0 or 0.0.0.0/0 optionally
                  via: 10.0.0.1
</snip>

Configuration
=============
network:
  version: 2
  renderer: networkd
  ethernets:
    enp0s31f6:
      dhcp4: no
      addresses:
        - 192.168.1.11/26
      routes:
        - to: 0/0 <<<<<<<<<<<< (Ok when 0.0.0.0/0 or default)
          via: 192.168.1.1
          on-link: true
      nameservers:
        addresses: [1.1.1.3, 1.0.0.3]

Error
=====
When using `0/0` notation in netplan configuration, the follow error occurs.

<snip>
jason@HIDDEN:~$ sudo netplan apply
/etc/netplan/00-installer-config.yaml:10:15: Error in network definition: invalid IP family '-1'
        - to: 0/0
              ^
</snip>

Version
=======
jason@HIDDEN:~$ dpkg --list | egrep netplan
ii libnetplan0:amd64 0.105-0ubuntu2~22.04.1 amd64 YAML network configuration abstraction runtime library
ii netplan.io 0.105-0ubuntu2~22.04.1 amd64 YAML network configuration abstraction for various backends

Seen on a fresh install of 22.04.1 LTS Server

<snip>
jason@HIDDEN:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy

jason@HIDDEN:~$ uname -a
Linux HIDDEN 5.15.0-53-generic #59-Ubuntu SMP Mon Oct 17 18:53:30 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
</snip>

Revision history for this message
Jason Leschnik (jleschnik) wrote (last edit ):

Seen on a fresh install of 22.04.1 LTS Server, Issue also seen in latest 22.10 (kinetic) Server AMD64

<snip>
jason@HIDDEN:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy

jason@HIDDEN:~$ uname -a
Linux HIDDEN 5.15.0-53-generic #59-Ubuntu SMP Mon Oct 17 18:53:30 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
</snip>

description: updated
summary: - Netplan default routes doesn't accept 0/0 notation
+ Netplan default routes does not accept 0/0 notation
Revision history for this message
Lukas Märdian (slyon) wrote :

Alright, let's fix the documentation right now and keep the bug open to eventually accept the 0/0 notation as well.

Changed in netplan:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Lukas Märdian (slyon) 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.