Score:0

How do I find out what my different (virtual) network interfaces are, and what service created them?

in flag

I would like to "clean up" in the network interfaces. If I run ip addr, i get the following list (see bottom of post).

#2 and #3 are my 2 physical NICs (#2 currently unplugged), and I have created #5 and #6 myself in my netplan config. #10 (docker0) also makes sense to me.

However, most of the others are a complete mystery to me (e.g., all the virtual ethernets).

Is there a way to see which service created them, and if they are in use? Essentially, whether I can safely delete them. I'm a bit hesitant to just start sudo ip link delete INTERFACE without knowing more about them.

Output of brctl show:

bridge name bridge id       STP enabled interfaces
br-870fc0691e90     8000.0242670e67e3   no      veth3c7caf7
br-c43d0708a05e     8000.0242db5a4d9f   no      veth447ed70
br-f32d9d8a97b7     8000.024225ae37b1   no      veth0174902
                            veth0b62e6b
                            veth3965e56
                            veth52593cf
                            veth589e856
                            veth6acd0d3
                            veth74d8b27
                            vethb06ec0c
                            vethb71f188
                            vethcd3e855
                            vethe5a1aae
                            vetheb8ac27
                            vethff7a086
br0     8000.329db9331ed5   yes     eno1
                            vnet0
docker0     8000.0242c78c0ee3   no
virbr0      8000.5254002797d6   yes

Output of ip addr:

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
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br0 state UP group default qlen 1000
    link/ether 00:21:5e:c6:43:04 brd ff:ff:ff:ff:ff:ff
    altname enp11s0f0
3: eno2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 00:21:5e:c6:43:06 brd ff:ff:ff:ff:ff:ff
    altname enp11s0f1
4: enx02215eca3baf: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 02:21:5e:ca:3b:af brd ff:ff:ff:ff:ff:ff
5: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 32:9d:b9:33:1e:d5 brd ff:ff:ff:ff:ff:ff
    inet 10.0.30.21/24 metric 100 brd 10.0.30.255 scope global dynamic br0
       valid_lft 76838sec preferred_lft 76838sec
    inet6 fe80::309d:b9ff:fe33:1ed5/64 scope link
       valid_lft forever preferred_lft forever
6: vlan40@eno2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN group default qlen 1000
    link/ether 00:21:5e:c6:43:06 brd ff:ff:ff:ff:ff:ff
7: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 52:54:00:27:97:d6 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever
8: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br0 state UNKNOWN group default qlen 1000
    link/ether fe:54:00:26:69:40 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::fc54:ff:fe26:6940/64 scope link
       valid_lft forever preferred_lft forever
9: br-870fc0691e90: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
    link/ether 02:42:67:0e:67:e3 brd ff:ff:ff:ff:ff:ff
    inet 172.20.0.1/16 brd 172.20.255.255 scope global br-870fc0691e90
       valid_lft forever preferred_lft forever
    inet6 fe80::42:67ff:fe0e:67e3/64 scope link
       valid_lft forever preferred_lft forever
10: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
    link/ether 02:42:c7:8c:0e:e3 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
11: br-c43d0708a05e: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
    link/ether 02:42:db:5a:4d:9f brd ff:ff:ff:ff:ff:ff
    inet 172.11.0.1/24 brd 172.11.0.255 scope global br-c43d0708a05e
       valid_lft forever preferred_lft forever
    inet6 fe80::42:dbff:fe5a:4d9f/64 scope link
       valid_lft forever preferred_lft forever
12: br-f32d9d8a97b7: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
    link/ether 02:42:25:ae:37:b1 brd ff:ff:ff:ff:ff:ff
    inet 172.21.0.1/16 brd 172.21.255.255 scope global br-f32d9d8a97b7
       valid_lft forever preferred_lft forever
    inet6 fe80::42:25ff:feae:37b1/64 scope link
       valid_lft forever preferred_lft forever
14: vethb06ec0c@if13: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-f32d9d8a97b7 state UP group default
    link/ether 72:08:f7:98:75:d2 brd ff:ff:ff:ff:ff:ff link-netnsid 4
    inet6 fe80::7008:f7ff:fe98:75d2/64 scope link
       valid_lft forever preferred_lft forever
16: veth3c7caf7@if15: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-870fc0691e90 state UP group default
    link/ether 2a:fb:a7:23:ef:a5 brd ff:ff:ff:ff:ff:ff link-netnsid 2
    inet6 fe80::28fb:a7ff:fe23:efa5/64 scope link
       valid_lft forever preferred_lft forever
18: veth447ed70@if17: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-c43d0708a05e state UP group default
    link/ether ca:3a:29:a8:ba:bd brd ff:ff:ff:ff:ff:ff link-netnsid 1
    inet6 fe80::c83a:29ff:fea8:babd/64 scope link
       valid_lft forever preferred_lft forever
20: vethe5a1aae@if19: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-f32d9d8a97b7 state UP group default
    link/ether a2:c1:db:43:c0:bd brd ff:ff:ff:ff:ff:ff link-netnsid 5
    inet6 fe80::a0c1:dbff:fe43:c0bd/64 scope link
       valid_lft forever preferred_lft forever
22: veth52593cf@if21: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-f32d9d8a97b7 state UP group default
    link/ether ca:67:51:81:95:c5 brd ff:ff:ff:ff:ff:ff link-netnsid 3
    inet6 fe80::c867:51ff:fe81:95c5/64 scope link
       valid_lft forever preferred_lft forever
24: veth74d8b27@if23: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-f32d9d8a97b7 state UP group default
    link/ether 92:fa:e9:b0:13:d7 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet6 fe80::90fa:e9ff:feb0:13d7/64 scope link
       valid_lft forever preferred_lft forever
26: vethb71f188@if25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-f32d9d8a97b7 state UP group default
    link/ether 0e:0e:da:df:15:98 brd ff:ff:ff:ff:ff:ff link-netnsid 6
    inet6 fe80::c0e:daff:fedf:1598/64 scope link
       valid_lft forever preferred_lft forever
28: veth0174902@if27: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-f32d9d8a97b7 state UP group default
    link/ether 7e:e0:b1:76:d9:47 brd ff:ff:ff:ff:ff:ff link-netnsid 7
    inet6 fe80::7ce0:b1ff:fe76:d947/64 scope link
       valid_lft forever preferred_lft forever
30: veth3965e56@if29: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-f32d9d8a97b7 state UP group default
    link/ether b2:ca:05:df:1c:af brd ff:ff:ff:ff:ff:ff link-netnsid 9
    inet6 fe80::b0ca:5ff:fedf:1caf/64 scope link
       valid_lft forever preferred_lft forever
34: vethff7a086@if33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-f32d9d8a97b7 state UP group default
    link/ether 6a:97:34:da:5d:2f brd ff:ff:ff:ff:ff:ff link-netnsid 10
    inet6 fe80::6897:34ff:feda:5d2f/64 scope link
       valid_lft forever preferred_lft forever
36: vetheb8ac27@if35: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-f32d9d8a97b7 state UP group default
    link/ether f2:d3:47:65:5c:b0 brd ff:ff:ff:ff:ff:ff link-netnsid 11
    inet6 fe80::f0d3:47ff:fe65:5cb0/64 scope link
       valid_lft forever preferred_lft forever
38: veth0b62e6b@if37: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-f32d9d8a97b7 state UP group default
    link/ether 4e:05:42:a2:62:3d brd ff:ff:ff:ff:ff:ff link-netnsid 12
    inet6 fe80::4c05:42ff:fea2:623d/64 scope link
       valid_lft forever preferred_lft forever
40: veth6acd0d3@if39: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-f32d9d8a97b7 state UP group default
    link/ether b2:7e:7c:8c:85:b3 brd ff:ff:ff:ff:ff:ff link-netnsid 13
    inet6 fe80::b07e:7cff:fe8c:85b3/64 scope link
       valid_lft forever preferred_lft forever
42: veth589e856@if41: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-f32d9d8a97b7 state UP group default
    link/ether 0a:4e:7c:29:ba:3a brd ff:ff:ff:ff:ff:ff link-netnsid 14
    inet6 fe80::84e:7cff:fe29:ba3a/64 scope link
       valid_lft forever preferred_lft forever
72: vethcd3e855@if71: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-f32d9d8a97b7 state UP group default
    link/ether f6:24:c0:75:e6:24 brd ff:ff:ff:ff:ff:ff link-netnsid 8
    inet6 fe80::f424:c0ff:fe75:e624/64 scope link
       valid_lft forever preferred_lft forever

This is Ubuntu server LTS 22.04.

David avatar
cn flag
What is the version of Ubuntu?
Aephir avatar
in flag
Ubuntu server LTS 22.04 (updated post)
ru flag
Are you using `docker compose` commands with YAMLs? Because those create individual bridges, and *sometimes* create virtual ethernet devices that get attached to containers. If you have a lot of Docker containers running then I would suggest you take them all down and see if the `veth`s go away.
Aephir avatar
in flag
That (`docker-compose down`) took me from 27 to 9 interfaces. Still not sure about `enx02215eca3baf`, but I'm certainly close enough that if you, @ThomasWard, create an answer with this I'd accept that.
ru flag
@Aephir that's a physical interface. Either an ethernet adapter or a misidentified wireless dongle, etc. And it has the MAC of 02:21:5e:ca:3b:af.
Score:1
ru flag

When you use docker or containers or even Virtual machines, each container or system has to have a virtual ethernet device that connects to bridges.

You show you use Docker, which also is likely why you have the bridges running, because you're using docker-compose. Each container has its own veth on the host system that maps to the container's networking. The more Docker containers you run, the more veth devices that will spawn.

If you do a docker-compose down and shut all your Docker containers down/off, the number of veth devices will decrease drastically.


Note that enx devices are devices ID'd by mac address.

Per the Predictable Network Interface Naming systems (https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/) that SystemD uses, you can find this out pretty easy:

  1. Names incorporating Firmware/BIOS provided index numbers for on-board devices (example: eno1)
  2. Names incorporating Firmware/BIOS provided PCI Express hotplug slot index numbers (example: ens1)
  3. Names incorporating physical/geographical location of the connector of the hardware (example: enp2s0)
  4. Names incorporating the interfaces's MAC address (example: enx78e7d1ea46da)
  5. Classic, unpredictable kernel-native ethX naming (example: eth0)

(emphasis mine)

Your enx device is a physical interface with the MAC address of 02:21:5E:CA:3B:AF and is installed on your system somewhere, whether internally on the system or externally via a USB dongle or such is impossible to tell.

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.