Score:0

prevent displaying of network interface altname on centos 8

mx flag

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

A.B avatar
cl flag
A.B
https://access.redhat.com/solutions/6964829
Dmitry Novice avatar
mx flag
Thanks. I found that I already tried to change file 99-default.link. AlternativeNamesPolicy was set to "none". I was also trying to left AlternativeNamesPolicy just empty. After reboot altname appears again.
A.B avatar
cl flag
A.B
In case your question is about parsing this output, then you should use a JSON output and don't bother about these altnames.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.