You are not logged in.
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
Online
The first quotation mark in your NAME= is wrong - it is a “ instead of a "
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
@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
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.
Online