CentOS7 And “ip Link Alias”

Home » CentOS » CentOS7 And “ip Link Alias”
CentOS 6 Comments

Hello List,

After demystifying the cause for my /sbin/ifup-local not being executed by network scripts for an Ethernet interface (don’t let NetworkManager control it or ifup-local won’t be executed)…

… I have a question with hopefully a simple answer:
I placed an alias/description on my interface during testing and now I want to remove it. But when I try to remove it, I’m either trying to do something _actually_
not supported or I don’t have the proper syntax to accomplish what I want.

~]# ip link set dev eno1 alias “hit”

~]# ip link show eno1
2: eno1: mtu 1500 qdisc mq state UP mode DEFAULT qlen 1000
link/ether 00:22:19:1e:a2:5b brd ff:ff:ff:ff:ff:ff
alias hit

~]# ip link delete dev eno1 alias “hit”
RTNETLINK answers: Operation not supported

Thoughts?
It’s mildly annoying at most.

6 thoughts on - CentOS7 And “ip Link Alias”

  • Thanks for the reply Gordon. That’s the conclusion I came to after scouring the man page, but wanted to make sure I wasn’t missing something.

    It’s a bit odd there isn’t a method to remove an interface alias.

  • The tool that allows you create something and does not allow destroy it is at the very least incomplete in my book, so I would just stay away from it.

    Valeri

    ++++++++++++++++++++++++++++++++++++++++
    Valeri Galtsev Sr System Administrator Department of Astronomy and Astrophysics Kavli Institute for Cosmological Physics University of Chicago Phone: 773-702-4247
    ++++++++++++++++++++++++++++++++++++++++

  • It doesn’t look like ‘ip link’ has the syntax to remove an alias, but it can be done via sysfs:

    # ip link show dev lo
    1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    # ip link set dev lo alias loopback
    # ip link show dev lo
    1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    alias loopback
    # echo > /sys/class/net/lo/ifalias
    # ip link show dev lo
    1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

    It also can be set there too:

    # echo hiCentOS > /sys/class/net/lo/ifalias
    # ip link show dev lo
    1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    alias hiCentOS


    Jonathan Billings

  • ;-)
    Nice.
    [Forest for the trees!] I didn’t think of sysfs because I was fixated on the ip link utility.

    Thanks Jonathan!


    —~~.~~—
    Mike
    // SilverTip257 //