Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

fighting with netplan/networkd/networkmanager

Featured Replies

BPI-R4, but that is probably the least of my problems.

setting up netplan, like the docs say I have to. using networkd, or trying...

renaming the eth1 interface to ethLAN, keeping lan1 as-is.

networkctl always says that eth1 or ethLAN is unmanaged.

Note that I'm using the ttyS0 serial console.

root@ratatosk:~# networkctl list
IDX LINK TYPE     OPERATIONAL SETUP     
  1 lo   loopback carrier     unmanaged
  2 eth0 ether    degraded    unmanaged
  3 eth1 ether    off         unmanaged
  4 eth2 ether    off         unmanaged
  5 wan  dsa      off         unmanaged
  6 lan1 dsa      routable    configured
  7 lan2 dsa      off         unmanaged
  8 lan3 dsa      off         unmanaged
root@ratatosk:~# netplan apply
[  141.017704] mtk_soc_eth 15100000.ethernet ethLAN: renamed from eth1
[  141.068835] mtk_soc_eth 15100000.ethernet ethEXT1: renamed from eth2
root@ratatosk:~# networkctl list
IDX LINK    TYPE     OPERATIONAL SETUP     
  1 lo      loopback carrier     unmanaged
  2 eth0    ether    degraded    unmanaged
  3 ethLAN  ether    off         unmanaged
  4 ethEXT1 ether    off         unmanaged
  5 wan     dsa      off         unmanaged
  6 lan1    dsa      routable    configured
  7 lan2    dsa      off         unmanaged
  8 lan3    dsa      off         unmanaged

 

Here's my config. Note that it does in fact rename the interfaces... albeit not at boot 😑

root@ratatosk:~# cat /etc/netplan/20-ethLAN.yaml 
network:
  version: 2
  renderer: networkd
  ethernets:
    ethLAN:
      match:
        macaddress: '6a:c9:72:53:13:d5'
      #set-name: ethLAN #tried with and without this
      addresses: [ "192.168.88.253/23" ]
      emit-lldp: true
      dhcp4: false
      dhcp6: false
      #ignore-carrier: true
      nameservers:
        addresses:
        - 192.168.82.55
        search:
        - tabris.net
      routes:
        #- to: 192.168.88.0/23
        #  metric: 10
        #  from: 192.168.88.253
        #  scope: link
        #  type: local
         - to: "default"
           via: "192.168.88.254"
root@ratatosk:~# cat /etc/netplan/11-lan1.yaml   
network:
  version: 2
  renderer: networkd
  ethernets:
    lan1:
      match:
        name: "lan1"
      addresses:
      - "192.168.88.250/23"
      nameservers:
        addresses:
        - 192.168.82.55
        search:
        - tabris.net
#      routes:
#      - to: "default"
#        via: "192.168.88.254"

 

note that lan1 works! ethLAN, whether named eth1 or ethLAN... does not.

I tried using renderer: NetworkManager

It then tries to restart networkd & stop NetworkManager.

but it can eventually work... but I have to sacrifice a rubber chicken [stupid manual steps like manually setting the interfaces up with ip link] each time, and they're starting to pile up.

it will *not* work at boot no matter what I do.

 

Solved by tabrisnet

14 minutes ago, tabrisnet said:

renaming the eth1 interface to ethLAN, keeping lan1 as-is.


Did you try renaming by using udev rule?

Example:
sudo nano /etc/udev/rules.d/76-rename-wifi-by-mac.rules

SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="b8:2d:28:5a:55:92", NAME="wlxb82d285a5592"

 

and then proceed with whatever. Both systemd-networkd and network manager should work.

  • Author

rules in /etc/udev/rules.d did *nothing*. tried with 00 prefix and 99 prefix. udevadm test-builtin net_setup_link didn't mention the filepath either.

But I could make it do stuff with /etc/systemd/network/foo.link, which is what's current[ly not deleted yet from previous attempts]. Which makes it even weirder that it still won't rename at boot.

 

Note that the problem is a lot less the renaming and more that networkd refuses to manage the interfaces, even if I give up on renaming,

  • Author

The eth0/lan1 MAC does change...

the eth1/eth2 MACs do not change. I've checked over multiple reboot cycles.

3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 6a:c9:72:53:13:d5 brd ff:ff:ff:ff:ff:ff
4: eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 32:b0:1b:6f:4e:e9 brd ff:ff:ff:ff:ff:ff
root@ratatosk:~# uptime
 20:05:19 up 5 min,  1 user,  load average: 0.13, 0.39, 0.21

just rebooted, the MACs are stable 🐴

I could try reconfiguring the netplan config to use the name [like with lan1] instead of MAC... but that will of course mean I can't rename.

  • Author

Ok, so using the match name *does* work, still makes no sense.

root@ratatosk:~# head /etc/netplan/20-ethLAN.yaml 
network:
  version: 2
  renderer: networkd
  ethernets:
    eth1:
      match:
        #macaddress: '6a:c9:72:53:13:d5'
        name: eth1
      #set-name: ethLAN
      addresses: [ "192.168.88.253/23" ]
root@ratatosk:~# networkctl list
IDX LINK TYPE     OPERATIONAL SETUP     
  1 lo   loopback carrier     unmanaged
  2 eth0 ether    degraded    unmanaged
  3 eth1 ether    routable    configured
  4 eth2 ether    off         unmanaged
  5 wan  dsa      off         unmanaged
  6 lan1 dsa      routable    configured
  7 lan2 dsa      off         unmanaged
  8 lan3 dsa      off         unmanaged

8 links listed.

 

  • Author

making a copy of the file from /run/, changing the YAML to use MAC, then diff

root@ratatosk:~# netplan generate
root@ratatosk:~# diff -purN /run/systemd/network/10-netplan-eth1.network  /root/netplan-eth1-namematch.network
--- /run/systemd/network/10-netplan-eth1.network        2025-08-19 20:10:54.900000038 +0000
+++ /root/netplan-eth1-namematch.network        2025-08-19 20:10:36.980000037 +0000
@@ -1,5 +1,5 @@
 [Match]
-PermanentMACAddress=6a:c9:72:53:13:d5
+Name=eth1
 
 [Network]
 EmitLLDP=true

feels like a systemD bug ☹️

  • Author

https://forum.banana-pi.org/t/bpi-r4-eeprom/17836/13

 

suggests we should figure out how to give the info to uboot? or it already does generate it for us in one case?

I can say I find eth0's local-mac-address in the running device tree, but the other two mac@ entries lack it.

root@ratatosk:/boot# dtc /proc/device-tree 2>/dev/null |grep -PA 10 'mac@[0-9] ' 
                        mac@2 {
                                phy-mode = "usxgmii";
                                compatible = "mediatek,eth-mac";
                                status = "okay";
                                pcs-handle = <0x3a 0x3b>;
                                managed = "in-band-status";
                                phys = <0x3c>;
                                reg = <0x02>;
                                openwrt,netdev-name = "sfp-wan";
                                sfp = <0x3d>;
                        };
--
                        mac@0 {
                                phy-mode = "internal";
                                local-mac-address = [22 16 68 60 40 c2];
                                mac-address = [22 16 68 60 40 c2];
                                compatible = "mediatek,eth-mac";
                                status = "okay";
                                reg = <0x00>;
                                phandle = <0x2c>;

                                fixed-link {
                                        full-duplex;
--
                        mac@1 {
                                phy-mode = "usxgmii";
                                compatible = "mediatek,eth-mac";
                                status = "okay";
                                pcs-handle = <0x36 0x37>;
                                managed = "in-band-status";
                                phys = <0x38>;
                                reg = <0x01>;
                                openwrt,netdev-name = "sfp-lan";
                                sfp = <0x39>;
                        };

 

  • Author
  • Solution

This solution feels janky [specifically, netplan-runner.service shouldn't be needed]

But... it works.

 

netplan-macaddress-watcher.path

[Path]
PathChanged=/run/systemd/network/
Unit=netplan-macaddress-watcher.service

[Unit]
Before=systemd-networkd.service

#[Install]
#WantedBy=systemd-networkd.service

netplan-macaddress-watcher.service

[Unit]
Description=Rewrites /run/systemd/network PermanentMACAddress to MACAddress
Before=systemd-networkd.service network-pre.target

[Service]
Type=oneshot
User=root
ExecStart=/bin/bash /usr/local/bin/netplan-macaddress-mangler.sh

netplan-runner.service - it runs netplan as late as possible...

[Unit]
Description=Runs netplan right after boot
After=multi-user.target

[Service]
Type=oneshot
User=root
ExecStart=/usr/sbin/netplan apply

[Install]
WantedBy=multi-user.target

 

netplan-macaddress-mangler.sh - This will need to be renamed if published/packaged.

#!/bin/bash -x

# can we use $TRIGGER_PATH ? https://man.archlinux.org/man/systemd.exec.5.en
# no, we can't, it only tells us the directory, not which file was changed.

#FIXME: can we skip this for initial boot?
sleep 5; # coalesce the calls

/usr/bin/sed -i -e 's/^PermanentMACAddress/MACAddress/' /run/systemd/network/*netplan*.{link,network}

#echo -n "networkd is: "
if systemctl is-active systemd-networkd >/dev/null; then
        networkctl reload
fi

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.