I have a bit of software that is hard coded to open eth0. My system assigned the name enp0s25 to my ethernet connection. I could go through the code and replace all instances of eth0; I'm just hoping there is a shortcut I can take.

Is it safe to create symbolic links inside /sys/class/net? I see lo and enp0s25 in there. I'm tempted to just create a link named eth0 there, but I have no idea what that would do to my system.


According to udev manpage the udev-systemd daemon provides interfaces names using internal rules. This can be overriden by adding a rule file in the /etc/udev/rules.d directory. One of this file should be used to set persistent ethernet interfaces names, containing commented rules like that one :

#SUBSYSTEM=="net", DRIVERS=="?*", ATTR{address}=="00:1c:c4:e1:2e:d6", KERNEL=="eth*", NAME="ethx"

You can create your own rule that match your interface MAC address and NAME=eth0.

I recommend you read this : Understanding systemd’s predictable network device names

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.