netplan cannot find network interface

Bug #1818139 reported by Devon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Netplan
New
Undecided
Unassigned

Bug Description

OS info: `Linux version 4.15.0-45-generic (buildd@lgw01-amd64-031) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #48-Ubuntu SMP Tue Jan 29 16:28:13 UTC 2019`

netplan verison: `Version: 1.10.1-5build1`

Description:

I was trying to change my dns nameservers, so I updated the default netplan file on my ubuntu system. But netplan couldn't seem find my network interface.

Repro steps:

1. Find network interface:
```
devonh@devonh-desktop ~> ip a | ag enp3s0 14:54:25
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    inet 192.168.1.194/24 brd 192.168.1.255 scope global dynamic noprefixroute enp3s0
```

2. Update the default netplan on ubuntu18.04
```
devonh@devonh-desktop ~> cat /etc/netplan/01-network-manager-all.yaml 14:57:58
# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager
  ethernets:
    enp3s0:
      nameservers:
        addresses: [1.1.1.1]

```

3. sudo netplan --debug apply

Expected behaviour

3. enp3s0 should now be using the new nameserver

Actual behaviour

3. netplan can't find the network interface and decides to fail quietly.

```
devonh@devonh-desktop ~> sudo netplan --debug apply 14:36:40
** (generate:10390): DEBUG: 14:36:43.268: Processing input file /etc/netplan/01-network-manager-all.yaml..
** (generate:10390): DEBUG: 14:36:43.268: starting new processing pass
** (generate:10390): DEBUG: 14:36:43.268: enp3s0: setting default backend to 2
** (generate:10390): DEBUG: 14:36:43.268: Generating output files..
** (generate:10390): DEBUG: 14:36:43.268: networkd: definition enp3s0 is not for us (backend 2)
DEBUG:no netplan generated networkd configuration exists
DEBUG:netplan generated NM configuration exists, restarting NM
DEBUG:enp3s0 not found in {}
DEBUG:Merged config:
network:
  bonds: {}
  bridges: {}
  ethernets:
    enp3s0:
      nameservers:
        addresses:
        - 1.1.1.1
  vlans: {}
  wifis: {}

DEBUG:Skipping non-physical interface: lo
DEBUG:device enp3s0 operstate is up, not changing
DEBUG:Skipping non-physical interface: docker0
DEBUG:Skipping non-physical interface: docker_gwbridge
DEBUG:Skipping non-physical interface: vethb8d58be
DEBUG:Skipping non-physical interface: br-ca9430df9995
DEBUG:{}
DEBUG:netplan triggering .link rules for lo
DEBUG:netplan triggering .link rules for enp3s0
DEBUG:netplan triggering .link rules for docker0
DEBUG:netplan triggering .link rules for docker_gwbridge
DEBUG:netplan triggering .link rules for vethb8d58be
DEBUG:netplan triggering .link rules for br-ca9430df9995

devonh@devonh-desktop ~> echo $status 14:36:43
0
```

Notes:

I looked at the troubleshooting page https://netplan.io/troubleshooting#debugging-issues-with-the-networkmanager-backend but my system doesn't have the following file `/run/NetworkManager/system-configuration`. I don't know if NM is supposed to create it automatically or not...

Thanks

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Netplan does not work that way. To configure custom DNS for an interface, you should include all the other features for that device as well.

In other words, this requires also configuring dhcp4: yes, or otherwise setting a static IP address. Only 'nameservers' is not sufficient. If you want to change just the nameservers in use, you can change those directly in the parameters for the interface as well, using the NetwrokManager configuration dialogs.

The message "DEBUG:enp3s0 not found in {}" is not an indication of any bug; it is only debug information for netplan developers to understand how the configuration is parsed, and how it gets to some of the later behavior (such as renaming interfaces, etc.).

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.