Score:1

How can I bring down the interface in the netplan configuration?

il flag

I have an Ubuntu server 18.04 and simple netplan configuration (see below):

---
network:
  ethernets:
    ens1:
      dhcp4: false
      addresses:
      - "192.168.99.1/24"
    ens2:
      dhcp4: false
      addresses:
      - "172.20.0.82/23"
      gateway4: "172.20.0.1"
      nameservers:
        addresses:
        - "172.20.0.62"
  renderer: "networkd"
  version: 2

If I run the command: "ip link set dev ens1 down" so the corresponding interface has status "down". If then I run the command "netplan apply" so this interface brings up. How can I change netplan configuration (without committing and lines deleting) in order to have bring down and specified in netplan configuration interfaces not brought up?

user535733 avatar
cn flag
This seems like an [XY Question](https://en.wikipedia.org/wiki/XY_problem). It's not clear what problem you are trying to solve, but mucking about with netplan configs is almost certainly the wrong way to solve that problem.
Score:1
us flag

There is presently no support for defining interface configuration in netplan without netplan apply also bringing those interfaces up. This is a longstanding feature request which required systemd work before it could be implemented. The work is tracked at https://bugs.launchpad.net/ubuntu/+source/netplan.io/+bug/1664844.

Note that the tasks for Ubuntu bionic have been marked "wontfix"; so this will only be available in netplan in Ubuntu 20.04 and later.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.