11

I am trying to hunt down information for why a network interface name would have an at sign, but there's too much noise in the results I am so far getting (I lack the correct terminology to search on)

I have a LXC container on a Ubuntu host. Inside the container I run and get:

# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    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
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
9: eth0@if10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 00:16:3e:37:a0:7a brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 10.0.3.195/24 brd 10.0.3.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::216:3eff:fe37:a07a/64 scope link 
       valid_lft forever preferred_lft forever

Note that eth0@if10

What is this @ portion called / referring to?

On the host there is no such if10, another container I have has an eth0@if8 - I must assume this is part of LXC's/containers' handling of network translations somehow, but I had not noticed this existing previously, and wonder if it's a complement to bridging, that might exist in other scenarios ?

7

eth0@if10 means:

  • your network interface is named still simply eth0 and network tools and apps can only refer to this name, without the @ appendix. (As a sidenote, this is most probably a veth peer, but the name does not need to reflect this.)
  • @if10 means: eth0 is connected to some (other) network interface with index 10 (decimal). Since there is also a link-netnsid 0 shown, this other network interface is in another network namespace (kind of virtual IP stack), presumably the root (a.k.a. host) network namespace.

If you use ip link show in your host, and not in your container, then one of the network interfaces listed there should have an @9 appendix; the interface name will probably start with veth.... This interface is the peer to the eth0@10 interface you asked about. Veth interfaces come in pairs connected to each other, like a virtual cable.

So, the @... is an appendix created by the ip tool, and it is not part of Linux' network interface names. The number after the @ refers to another network interface with the index number that is shown after the @. The index numbers are printed before the network interface names, such as in 9: eth0@if10. The peer network interface can be in a different network namespace.

Unfortunately, finding the correct network namespace for the link-netnsid .. is rather involved, see how to find the network namespace of a veth peer ifindex.

| improve this answer | |
  • Thanks - following that explanation it looks like what I'm looking at is what's properly called "network namespaces". Ta. – taifwa Jun 27 '18 at 19:35
  • 1
    The @ notation is also used in other situations not related to network namespaces, such as MACVLAN interfaces attached to another physical network interface. It's the link-netnsid 0 that signals that another network namespace is involved. The @ just says that there another interface involved, but not where that other interface is. – TheDiveO Jun 30 '18 at 13:16
0

Check for a file like 70-persistent-net.rules under /etc/udev/rules.d or under /lib/udev/rules.d. There should be a line with the network interface name and MAC address. Altering that and rebooting should rename the NIC.

| improve this answer | |
  • I'm not trying to rename the NIC - I'm trying to understand what is present.... – taifwa Dec 7 '17 at 14:03
  • Understood. But is there a persistent-net rules file with the "at" sign in the NIC name? – bootbeast Dec 9 '17 at 0:18
  • The @ sign is in this case not part of the interface name, but instead an artefact of the ip tool. Just compare with ifconfig ... or do some quick Python script dumping interface names using pyroute2. All will show there un-adorned real network interface names. – TheDiveO Jun 30 '18 at 13:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.