Score:0

Netplan configuration - renaming network interfaces

in flag

I'm no fan of netplan, a simple renaming operation that's taking hours can't be seen as progress...

I have a physical box, with physical NIC's that I need to bridge. On the test machine it's two interfaces only, on the real box, it's six interfaces that need to be renamed.

Having read various yaml configuration files and forum comments, I'm trying

# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager
  ethernets:
    ens1f0:
       dhcp4: no
       match:
          macaddress: "00:15:17:6c:e7:ca"
       set-name: "one"
    ens1f1:
       dhcp4: no
       match:
          macaddress: "00:15:17:6c:e7:cb"
       set-name: "two"
  bridges:
     br0:
       interfaces: ["one", "two"]
       parameters:
         stp: no

I've tried the macaddress with and without quotes, the set-name variable with and without quotes and the bridge interfaces with and without quotes, none of which work.

If I try 'netplan try', the output is: br0: reverting custom parameters for bridges and bonds is not supported Please carefully review the configuration and use 'netplan apply' directly.

'netplan apply' produces

root@bridge:/etc/netplan# netplan apply

/etc/netplan/01-network-manager-all.yaml:18:26: Error in network definition: br0: interface 'two' is not defined
       interfaces: [one, two]

                     ^

'netplan --debug apply' produces oot@bridge:/etc/netplan# netplan --debug apply

** (generate:4347): DEBUG: 09:38:53.011: Processing input file /etc/netplan/01-network-manager-all.yaml..
** (generate:4347): DEBUG: 09:38:53.012: starting new processing pass
** (generate:4347): DEBUG: 09:38:53.012: recording missing yaml_node_t one
** (generate:4347): DEBUG: 09:38:53.012: recording missing yaml_node_t two
(generate:4347): GLib-GIO-DEBUG: 09:38:53.020: _g_io_module_get_default: Found default implementation local (GLocalVfs) for ?gio-vfs?
/etc/netplan/01-network-manager-all.yaml:18:26: Error in network definition: br0: interface 'p04' is not defined
       interfaces: [one, two]

                     ^

I've checked the indentation, I've checked the file for tabs, I've tried various interface names, with and without quotes, nothing works. Any assistance would be greatly appreciated. If I can't get this going I'll need to ditch ubuntu and run an alternative distro which will be a real pain...

  version: 2
  renderer: NetworkManager
  ethernets:
    ens1f0:
       dhcp4: no
       match:
          macaddress: "00:15:17:6c:e7:ca"
       set-name: "one"
    ens1f1:
       dhcp4: no
       match:
          macaddress: "00:15:17:6c:e7:cb"
       set-name: "two"
  bridges:
     br0:
       interfaces: ["one", "two"]
       parameters:
         stp: no
Score:1
us flag

set-name is used to set the name of the interface at the kernel level. But the interfaces that you list in your yaml still have the original names of ens1f0 and ens1f1. The names of the interfaces in the bridge configuration need to match the names of the sections under ethernets.

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.