Netplan support

Good day,

Because of the dynamic nature of our network devices and cabling, We currently have this as our netplan config:

network:
    version: 2
    ethernets:
        switchports:
            match: {name: "enp*"}
            dhcp4: no
            optional: true
    bridges:
        br0:
            dhcp4: yes
            addresses:
                - 192.168.14.1/24  # Fixed IP for sensor
                - 192.168.1.8/24  # Fixed IP for other sensor
            interfaces: [switchports]

We’re in the process of migrating from ubuntu-server to balena. How could we apply such a config?

Hello @Timple could you please tell us more about your dynamic nature of your network?

Sure thing,

Unfortunately there are slight differences in our computers causing our network interfaces to switch names/order.

Therefor we expose the same capabilities (dhcp, fixed ip) to all interfaces equal.

Hello @Timple sorry for the delay.

balenaOS currently uses NetworkManager and does not support configuration via Netplan.

Do you think you can move to NetworkManager or make Netplan compatible?

Netplan is basically just a configuration for NetworkManager.

So that means perhaps you can support it? It’s really easy as the complete configuration is a single yaml.

And it probably also means that somehow, I should be able to reproduce this with NetworkManager. But that probably involves some bash scripting to find the interfaces :frowning:

Hi, I am not an expert on this but it seems to me that Netplan is Canonical’s wrapper for NetworkManager so things can be easily set via an .yaml file. If I am reading correctly your yaml file you find all physical interfaces with the name enp* and match them to switchports, then you connect the bridge to switchports. This should be doable with NetworkManager alone. This post is a very good example of using Netplan and NetworkManager for achieving the same thing. Sections 1.1-1.5 look particularly relevant to your use case. Here is a similar example.

In general, NetworkManager is more universal and would not limit you to using Ubuntu, balena or any other platform, hence it might be worthwhile having a look at it. For example, here is a very detailed manual for NetworkManager, it also includes a cheatsheet with the commands and what they do. Section 10 might be particularly useful for what you want to do.

Let us know how it goes and whether we can help in the meantime.

1 Like