Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 6824

Networking and servers • Need to change the name of ethernet interface then make a bridge

$
0
0
So I have two USB ethernet devices connected to RPI CM5, SMSC 9500 and SMSC9512.
They are assigned the name eth1 and eth2 from the kernel, but I want to change this to usb1 and usb2, while I want to make a bridge with the name of eth1.

I have put this udev rule to change the names

Code:

ACTION=="add", SUBSYSTEM=="net", ATTR{type}=="1", DEVPATH=="*/usb*", NAME="usb%n"
It is able to change the names, but the problem that keeps happening is that eth1 and eth2 are not getting configured automatically but only after we are fully boot and we run systemctl restart systemd-networkd then they get the configurations.

Code:

root@CM5:~# networkctlIDX LINK  TYPE     OPERATIONAL SETUP  1 lo    loopback carrier     unmanaged  2 eth0  ether    routable    configured  3 wlan0 wlan     no-carrier  configured  4 usb1  ether    off         configuring  5 usb2  ether    off         configuring  6 eth1  bridge   no-carrier  configured
When I restart the networkd, it gets configured:

Code:

root@CM5:~# systemctl restart systemd-networkd[ 2841.291149] eth1: port 1(usb2) entered blocking state[ 2841.296228] eth1: port 1(usb2) entered disabled state[ 2841.301291] smsc95xx 5-1.2:1.0 usb2: entered allmulticast moderoot@CM5:~# [ 2841.307210] smsc95xx 5-1.2:1.0 usb2: entered promiscuous mode[ 2841.314754] audit: type=1700 audit(1651170583.579:6): dev=usb2 prom=256 old_prom=0 auid=4294967295 uid=993 gid=990 ses=4294967295[ 2841.315226] eth1: port 2(usb1) entered blocking state[ 2841.326406] audit: type=1300 audit(1651170583.579:6): arch=c00000b7 syscall=206 success=yes exit=40 a0=3 a1=555573a53e70 a2=28 a3=0 items=0 ppid=1 pid=11749 auid=4294967295 uid=993 gid=990 euid=993 suid=993 fsuid=993 egid=990 sgid=990 fsgid=990 tty=(none) ses=4294967295 comm="systemd-network" exe="/lib/systemd/systemd-networkd" key=(null)[ 2841.331484] eth1: port 2(usb1) entered disabled state[ 2841.361408] audit: type=1327 audit(1651170583.579:6): proctitle="/lib/systemd/systemd-networkd"[ 2841.375159] smsc95xx 5-1.1:1.0 usb1: entered allmulticast mode[ 2841.381043] smsc95xx 5-1.1:1.0 usb1: entered promiscuous mode[ 2841.386806] audit: type=1700 audit(1651170583.603:7): dev=usb1 prom=256 old_prom=0 auid=4294967295 uid=993 gid=990 ses=4294967295[ 2841.398456] audit: type=1300 audit(1651170583.603:7): arch=c00000b7 syscall=206 success=yes exit=40 a0=3 a1=555573a54530 a2=28 a3=0 items=0 ppid=1 pid=11749 auid=4294967295 uid=993 gid=990 euid=993 suid=993 fsuid=993 egid=990 sgid=990 fsgid=990 tty=(none) ses=4294967295 comm="systemd-network" exe="/lib/systemd/systemd-networkd" key=(null)[ 2841.428425] audit: type=1327 audit(1651170583.603:7): proctitle="/lib/systemd/systemd-networkd"[ 2841.473476] smsc95xx 5-1.2:1.0 usb2: Link is Up - 100Mbps/Full - flow control off[ 2841.493618] smsc95xx 5-1.1:1.0 usb1: hardware isn't capable of remote wakeup[ 2841.500824] eth1: port 1(usb2) entered blocking state[ 2841.503739] smsc95xx 5-1.1:1.0 usb1: Link is Down[ 2841.505880] eth1: port 1(usb2) entered forwarding stateroot@CM5:~# networkctlIDX LINK  TYPE     OPERATIONAL      SETUP  1 lo    loopback carrier          unmanaged  2 eth0  ether    routable         configured  3 wlan0 wlan     no-carrier       configured  4 usb1  ether    no-carrier       configured  5 usb2  ether    enslaved         configured  6 eth1  bridge   degraded-carrier configured6 links listed.root@CM5:~#
These are my network configuration files:

eth1-bridge.network

Code:

[Match]Name=eth1[Network]Address=192.168.0.1/24Address=192.168.11.2/24Address=192.168.17.2/24DHCPServer=trueConfigureWithoutCarrier=true[DHCPServer]ServerAddress=192.168.11.2/24PoolOffset=128PoolSize=127

eth1-bridge.netdev

Code:

[NetDev]Name=eth1Kind=bridge

usb1

Code:

[Match]Name=usb1[Network]Bridge=eth1
usb2

Code:

[Match]Name=usb2[Network]Bridge=eth1
I cannot change the name of eth1 as it is already described in all our applications and it is a mess changing all those applications. I cannot do restart of systemd-networkd at start because then it breaks few of our applications which needs the eth1 to have pingable addresses.

Thank you in advance for your help and time.

Statistics: Posted by funkpunkt — Fri Mar 28, 2025 8:38 am — Replies 0 — Views 50



Viewing all articles
Browse latest Browse all 6824

Trending Articles