You are not logged in.

#1 2020-11-15 16:05:23

kevdog
Member
Registered: 2013-01-26
Posts: 102

Can not rename interface enp0s4 to eth0

Hi I'm trying to rename my only wired network interface which is assigned enp0s4 at boot.

I followed the instructions listed:
https://wiki.archlinux.org/index.php/Ne … rface_name

Here are my files:

# cat /sys/class/net/enp0s4/address                                                                                                 
00:a0:98:32:e4:bc
# cat /etc/udev/rules.d/10-network.rules                                                                                             
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="00:a0:98:32:e4:bc", NAME=“eth0"
# journalctl -u systemd-udevd -b

...
Nov 15 03:56:51 arch-FreeNAS systemd-udevd[256]: /etc/udev/rules.d/10-network.rules:1 Invalid key/value pair, ignoring.
....

So I'm assuming the key/value pair refers to NAME?  or another attribute?

Offline

#2 2020-11-15 16:25:06

seth
Member
Registered: 2012-09-03
Posts: 49,951

Offline

#3 2020-11-15 17:21:35

tors42
Member
Registered: 2020-11-14
Posts: 4

Re: Can not rename interface enp0s4 to eth0

The first quotation mark in your NAME= is wrong - it is a “ instead of a " smile
This has happened to me when copy/paste from formatted documents, i.e PDF-documents.

So change:
... NAME=“eth0"

To:
... NAME="eth0"

and that might be it! (I haven't tested)

Offline

#4 2020-11-15 20:20:45

kevdog
Member
Registered: 2013-01-26
Posts: 102

Re: Can not rename interface enp0s4 to eth0

@tors42 -- Holy crap -- you were right.  I can't believe I missed that.

@seth - I actually ended up doing it the way you suggested.  The reason for this solution was with the other method, eth0 was getting assigned like two IP addresses.  I'm not sure why that was.  I use p10k with zsh and have a command prompt that displays internal ip address.  I don't know the logic written in this part of the code, however the IP address being displayed was the incorrect IP address (meaning of the two IP addresses, it was the one I didn't want to be displayed.  By doing it the way you suggested, eth0 was simply assigned one IP address. I have no idea the difference between the udev implementation and the implementation you linked.

Offline

#5 2020-11-15 21:14:03

seth
Member
Registered: 2012-09-03
Posts: 49,951

Re: Can not rename interface enp0s4 to eth0

The device is probably occupied when udev tries to re-rename it and that gets you an altname and that somehow results in two IPs, but we'd have to look at the configuration/logs to see what's going on.
The other solution simply prevents the device from being renamed to enp0s4 in the first place.

Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Offline

Board footer

Powered by FluxBB