Jump to content

rename network interface - udev and systemd link files dont work


Go to solution Solved by Gibbz,

Recommended Posts

Posted (edited)

I'm trying to get my udev rule working on armbian. But I cant make anything work at all.
I am wanting to rename the android usb tether to a standard name usb0.

Ive tried the following rules
 

/etc/udev/rules.d/99-usb-tether.rules

SUBSYSTEM=="net", ACTION=="add", ATTRS{interface}=="RNDIS Ethernet Data", NAME="usb%k"

SUBSYSTEM=="net", ACTION=="add", ATTRS{ID_USB_INTERFACES}=="*:e00103:*", NAME="usb%k"

SUBSYSTEM=="net", ACTION=="add", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4ee3", NAME="usb0"

 

none of them work, also tried rebooting
sudo udevadm control --reload-rules
sudo udevadm trigger

Ive ran the command:


udevadm test /dev/bus/usb/002/002


Trying to open "/etc/systemd/hwdb/hwdb.bin"...
Trying to open "/etc/udev/hwdb.bin"...
Trying to open "/usr/lib/systemd/hwdb/hwdb.bin"...
Trying to open "/usr/lib/udev/hwdb.bin"...
=== trie on-disk ===
tool version:          256
file size:        12592130 bytes
header size             80 bytes
strings            2650746 bytes
nodes              9941304 bytes
Loading kernel module index.
Loaded 'libkmod.so.2' via dlopen()
Failed to read $container of PID 1, ignoring: Permission denied
Found cgroup2 on /sys/fs/cgroup/, full unified hierarchy
Found container virtualization none.
Using default interface naming scheme 'v255'.
Parsed configuration file "/usr/lib/systemd/network/99-default.link"
Parsed configuration file "/usr/lib/systemd/network/80-vm-vt.link"
Parsed configuration file "/usr/lib/systemd/network/80-container-vz.link"
Parsed configuration file "/usr/lib/systemd/network/80-container-ve.link"
Parsed configuration file "/usr/lib/systemd/network/80-container-vb.link"
Parsed configuration file "/usr/lib/systemd/network/80-6rd-tunnel.link"
Parsed configuration file "/usr/lib/systemd/network/73-usb-net-by-mac.link"
Created link configuration context.
Reading rules file: /etc/udev/rules.d/10-wifi-disable-powermanagement.rules
Reading rules file: /usr/lib/udev/rules.d/50-firmware.rules
Reading rules file: /etc/udev/rules.d/50-mali.rules
Reading rules file: /etc/udev/rules.d/50-rk3399-vpu.rules
Reading rules file: /usr/lib/udev/rules.d/50-udev-default.rules
Reading rules file: /etc/udev/rules.d/50-usb-realtek-net.rules
Reading rules file: /usr/lib/udev/rules.d/55-dm.rules
Reading rules file: /usr/lib/udev/rules.d/60-autosuspend.rules
Reading rules file: /usr/lib/udev/rules.d/60-block.rules
Reading rules file: /usr/lib/udev/rules.d/60-cdrom_id.rules
Reading rules file: /usr/lib/udev/rules.d/60-dmi-id.rules
Reading rules file: /usr/lib/udev/rules.d/60-drm.rules
Reading rules file: /usr/lib/udev/rules.d/60-evdev.rules
Reading rules file: /usr/lib/udev/rules.d/60-fido-id.rules
Reading rules file: /usr/lib/udev/rules.d/60-infiniband.rules
Reading rules file: /usr/lib/udev/rules.d/60-input-id.rules
Reading rules file: /usr/lib/udev/rules.d/60-persistent-alsa.rules
Reading rules file: /usr/lib/udev/rules.d/60-persistent-input.rules
Reading rules file: /usr/lib/udev/rules.d/60-persistent-storage-dm.rules
Reading rules file: /usr/lib/udev/rules.d/60-persistent-storage-mtd.rules
Reading rules file: /usr/lib/udev/rules.d/60-persistent-storage-tape.rules
Reading rules file: /usr/lib/udev/rules.d/60-persistent-storage.rules
Reading rules file: /usr/lib/udev/rules.d/60-persistent-v4l.rules
Reading rules file: /usr/lib/udev/rules.d/60-sensor.rules
Reading rules file: /usr/lib/udev/rules.d/60-serial.rules
Reading rules file: /usr/lib/udev/rules.d/64-btrfs.rules
Reading rules file: /usr/lib/udev/rules.d/64-ext4.rules
Reading rules file: /usr/lib/udev/rules.d/70-camera.rules
Reading rules file: /usr/lib/udev/rules.d/70-joystick.rules
Reading rules file: /usr/lib/udev/rules.d/70-memory.rules
Reading rules file: /usr/lib/udev/rules.d/70-mouse.rules
Reading rules file: /usr/lib/udev/rules.d/70-power-switch.rules
Reading rules file: /usr/lib/udev/rules.d/70-touchpad.rules
Reading rules file: /usr/lib/udev/rules.d/70-uaccess.rules
Reading rules file: /usr/lib/udev/rules.d/71-axp-power-button.rules
Reading rules file: /usr/lib/udev/rules.d/71-seat.rules
Reading rules file: /usr/lib/udev/rules.d/73-seat-late.rules
Reading rules file: /usr/lib/udev/rules.d/73-special-net-names.rules
Reading rules file: /usr/lib/udev/rules.d/75-net-description.rules
Reading rules file: /usr/lib/udev/rules.d/75-probe_mtd.rules
Reading rules file: /usr/lib/udev/rules.d/78-sound-card.rules
Reading rules file: /usr/lib/udev/rules.d/80-debian-compat.rules
Reading rules file: /usr/lib/udev/rules.d/80-docker.rules
Reading rules file: /usr/lib/udev/rules.d/80-drivers.rules
Reading rules file: /usr/lib/udev/rules.d/80-net-setup-link.rules
Reading rules file: /usr/lib/udev/rules.d/81-net-dhcp.rules
Reading rules file: /usr/lib/udev/rules.d/90-alsa-restore.rules
Reading rules file: /etc/udev/rules.d/90-chromium-video.rules
Reading rules file: /usr/lib/udev/rules.d/90-console-setup.rules
Reading rules file: /usr/lib/udev/rules.d/90-iocost.rules
Failed to open /run/udev/rules.d/90-netplan.rules, ignoring: Permission denied
Failed to read rules file /run/udev/rules.d/90-netplan.rules, ignoring: Permission denied
Reading rules file: /usr/lib/udev/rules.d/95-dm-notify.rules
Reading rules file: /usr/lib/udev/rules.d/96-e2scrub.rules
Reading rules file: /usr/lib/udev/rules.d/97-hid2hci.rules
Reading rules file: /usr/lib/udev/rules.d/99-systemd.rules
Reading rules file: /etc/udev/rules.d/99-usb-tether.rules
2-1: /usr/lib/udev/rules.d/50-udev-default.rules:19 Importing properties from results of builtin command 'usb_id'
2-1: /usr/lib/udev/rules.d/50-udev-default.rules:19 Importing properties from results of builtin command 'hwdb --subsystem=usb'
2-1: hwdb modalias key: "usb:v18D1p4EE3:Pixel 5a"
2-1: /usr/lib/udev/rules.d/50-udev-default.rules:29 Importing properties from results of builtin command 'path_id'
2-1: /usr/lib/udev/rules.d/50-udev-default.rules:69 MODE 0664
Properties:
  DEVPATH=/devices/platform/usb@fe900000/fe900000.usb/xhci-hcd.4.auto/usb2/2-1
  DEVNAME=/dev/bus/usb/002/002
  DEVTYPE=usb_device
  DRIVER=usb
  PRODUCT=18d1/4ee3/440
  TYPE=0/0/0
  BUSNUM=002
  DEVNUM=002
  MAJOR=189
  MINOR=129
  SUBSYSTEM=usb
  ACTION=add
  TAGS=:seat:
  ID_BUS=usb
  ID_MODEL=Pixel_5a
  ID_MODEL_ENC=Pixel\x205a
  ID_MODEL_ID=4ee3
  ID_SERIAL=Google_Pixel_5a_18161JECB02915
  ID_SERIAL_SHORT=18161JECB02915
  ID_VENDOR=Google
  ID_VENDOR_ENC=Google
  ID_VENDOR_ID=18d1
  ID_REVISION=0440
  ID_USB_MODEL=Pixel_5a
  ID_USB_MODEL_ENC=Pixel\x205a
  ID_USB_MODEL_ID=4ee3
  ID_USB_SERIAL=Google_Pixel_5a_18161JECB02915
  ID_USB_SERIAL_SHORT=18161JECB02915
  ID_USB_VENDOR=Google
  ID_USB_VENDOR_ENC=Google
  ID_USB_VENDOR_ID=18d1
  ID_USB_REVISION=0440
  ID_USB_INTERFACES=:e00103:0a0000:
  ID_VENDOR_FROM_DATABASE=Google Inc.
  ID_MODEL_FROM_DATABASE=Nexus/Pixel Device (tether)
  ID_PATH_WITH_USB_REVISION=platform-xhci-hcd.4.auto-usbv3-0:1
  ID_PATH=platform-xhci-hcd.4.auto-usb-0:1
  ID_PATH_TAG=platform-xhci-hcd_4_auto-usb-0_1
  REALTEK_NIC_MODE=1
  CURRENT_TAGS=:seat:
  ID_FOR_SEAT=usb-platform-xhci-hcd_4_auto-usb-0_1
  USEC_INITIALIZED=3084785
Tags:
  seat
Inotify watch:
  disabled
Device node permission:
  0664
Unload kernel module index.
Unloaded link configuration context.


 

it looks like another earlier rule is overwriting my rule possibly??
/usr/lib/udev/rules.d/50-udev-default.rules

 

 

 

Ive also tried seting up .link files, which seems like a simpler solution if it works... But it doesnt.

/etc/systemd/network/99-usb-tether.link

[Match]
OriginalName=enx*

[Link]
Name=usb0

 

How can i get my rule to take preference?

Edited by Gibbz
  • Solution
Posted

i got it working by renaming the files with smaller numbers.

 

/etc/systemd/network/10-internet-usb.link

/etc/systemd/network/10-internet-usb.network

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines