[Bug 2000324] Re: Netplan says "interface is not defined" when bridge uses "routes" instead of "gateway4"

Lukas Märdian 2000324 at bugs.launchpad.net
Mon Jan 9 15:04:38 UTC 2023


You could also be using "default" instead of "0.0.0.0/0".

Thanks for confirming this fixes the problem for you!

** Changed in: netplan.io (Ubuntu)
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to netplan.io in Ubuntu.
Matching subscriptions: foundations-bugs
https://bugs.launchpad.net/bugs/2000324

Title:
  Netplan says "interface is not defined" when bridge uses "routes"
  instead of "gateway4"

Status in netplan.io package in Ubuntu:
  Invalid

Bug description:
  In netplan, gateway4 and gateway6 have been deprecated, and you're
  supposed to use "routes" instead.  But this fails with a bridge
  interface.

  ===== Working configuration =====

  network:
      bridges:
          br0:
              accept-ra: false
              addresses:
              - 100.64.0.250/22
              interfaces:
              - ens3
              nameservers:
                  addresses:
                  - 100.64.0.1
              parameters:
                  forward-delay: 0
                  stp: false
              gateway4: 100.64.0.1
      ethernets:
          ens3: {}
      version: 2

  ===== Broken configuration =====

  network:
      bridges:
          br0:
              accept-ra: false
              addresses:
              - 100.64.0.250/22
              interfaces:
              - ens3
              nameservers:
                  addresses:
                  - 100.64.0.1
              parameters:
                  forward-delay: 0
                  stp: false
              routes:
              -   to: 0/0
                  via: 100.64.0.1
      ethernets:
          ens3: {}
      version: 2

  The only difference is "gateway4" changed to "routes". With the second
  configuration, Netplan gives the following error:

  root at noc:/etc/netplan# netplan generate
  /etc/netplan/50-cloud-init.yaml:8:15: Error in network definition: br0: interface 'ens3' is not defined
              - ens3
                ^
  root at noc:/etc/netplan# 

  As a result, the interface is not configured.

  WORKAROUND: retain the deprecated gateway4: setting, as well as any
  additional routes you require.  For example, the following is accepted
  (albeit with noisy deprecation warning):

              gateway4: 100.64.0.1
              routes:
              -   to: 128.0.0.0/1
                  via: 100.64.0.1

  ProblemType: Bug
  DistroRelease: Ubuntu 22.04
  Package: netplan.io 0.105-0ubuntu2~22.04.1
  ProcVersionSignature: Ubuntu 5.15.0-56.62-generic 5.15.64
  Uname: Linux 5.15.0-56-generic x86_64
  ApportVersion: 2.20.11-0ubuntu82.3
  Architecture: amd64
  CasperMD5CheckResult: unknown
  Date: Thu Dec 22 15:50:59 2022
  ProcEnviron:
   TERM=vt220
   PATH=(custom, no user)
   LANG=C.UTF-8
   SHELL=/bin/bash
  SourcePackage: netplan.io
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/netplan.io/+bug/2000324/+subscriptions




More information about the foundations-bugs mailing list