When using custom network interface name in Centos 8 an output of ip a
command starts to show "interface altname".
# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: myeth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 82:61:d0:94:fb:f0 brd ff:ff:ff:ff:ff:ff
altname enp0s18
altname ens18
inet 192.168.1.224/24 brd 192.168.1.255 scope global myeth0
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether ee:84:38:d1:3f:5d brd ff:ff:ff:ff:ff:ff
altname enp0s19
altname ens19
inet 192.168.22.3/24 brd 192.168.22.255 scope global eth1
How to prevent creation of these altnames for interfaces?
Interface altname can be temporary removed using this approach:
ip link property del dev myeth0 altname ens18
ip link property del dev myeth0 altname enp0s19
But it will be assigned again after reboot.
I was also trying to change AlternativeNamesPolicy
option to "none" or to empty value in file:
/usr/lib/systemd/network/99-default.link