netplan cannot find network interface
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Netplan |
New
|
Undecided
|
Unassigned |
Bug Description
OS info: `Linux version 4.15.0-45-generic (buildd@
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@
2: enp3s0: <BROADCAST,
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@
# 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@
** (generate:10390): DEBUG: 14:36:43.268: Processing input file /etc/netplan/
** (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@
0
```
Notes:
I looked at the troubleshooting page https:/
Thanks
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.).