1

edit: I found it may be more efficient to reinstall the OS. I may encounter this again so I'll either create a new issue or find a way to continue this one. Also note below I created a bug report on netplan https://bugs.launchpad.net/netplan/+bug/1953054

edit: This is interesting https://onet.vn/install-netplan-on-ubuntu.html

By default, Netplan is disabled on Ubuntu 16.04 LTS. You have to enable it manually. To enable Netplan, you have to create a file netplan in the /etc/default/ directory and add ENABLED=1 to it.


I have Ubuntu 18.04.6 LTS. For consistency with other servers I want to use netplan.io /etc/netplan/01-netcfg.yml I've followed several postings which offer similar instructions in disabling NetworkManager and configuring / enabling netplan. This is one of them, yet it does not offer the results I'm looking for: How to enable netplan on ubuntu server upgraded from 16.04 to 18.04

In sum, I want to completely disable NetworkManager. I want /etc/netplan to be the only means of configuring static addressing on this server.

I've disabled / enabled the appropriate services:

# systemctl list-unit-files | grep -i network
dbus-org.freedesktop.network1.service                            enabled
network-manager.service                                          masked
networkd-dispatcher.service                                      enabled
NetworkManager-dispatcher.service                                enabled
NetworkManager-wait-online.service                               enabled
NetworkManager.service                                           masked
systemd-networkd-wait-online.service                             enabled
systemd-networkd.service                                         enabled

And I've written a netplan configuration:

network:
  version: 2
  renderer: networkd
  ethernets:
    enp3s0:
      dhcp4: no
      addresses: [192.168.1.30/24]
      gateway4: 192.168.1.1

However I continue to get an address from DHCP, not the netplan config:

2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:13:77:bd:fb:7c brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.100/24 brd 192.168.1.255 scope global dynamic noprefixroute enp3s0
       valid_lft 1750sec preferred_lft 1750sec
    inet6 fe80::6815:1b1b:6a5a:4049/64 scope link noprefixroute
       valid_lft forever preferred_lft forever

I've looked over https://netplan.io/troubleshooting/#debugging-issues-with-the-networkd-backend and I do not see files in /run/systemd/network In fact:

# ls /run/systemd/network
ls: cannot access '/run/systemd/network': No such file or directory

Also, in troubleshooting I've created a totally bogus /etc/netplan/01-netcfg.yml and it's still accepted:

FOO:
        BAR:
                FOO

# netplan try -d
Do you want to keep these settings?

Press ENTER before the timeout to accept the new configuration

Changes will revert in 120 seconds Configuration accepted.

netplan apply -d

What the heck is going on here?

me2017
  • 21

0 Answers0