[linux] How do I delete virtual interface in Linux?

ip link shows this:

[root@0-25-90-68-79-4a log]# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP qlen 1000
    link/ether 00:25:90:68:79:4a brd ff:ff:ff:ff:ff:ff
5: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP 
    link/ether 00:25:90:68:79:4a brd ff:ff:ff:ff:ff:ff
8: gre0: <NOARP> mtu 1476 qdisc noop state DOWN 
    link/gre 0.0.0.0 brd 0.0.0.0
10: 35978f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br35978f0 state UP qlen 32
    link/ether fe:ff:ff:ff:ff:ff brd ff:ff:ff:ff:ff:ff
13: br35978f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP 
    link/ether fe:ff:ff:ff:ff:ff brd ff:ff:ff:ff:ff:ff

Here, the interface 35978f0 is the virtual interface which is tied to the bridge br 35978f0. I've already done ifconfig 35978f0 down and brctl delif br35978f0 35978f0.

But how do I delete interface 35978f0?

This question is related to linux networking linux-kernel virtual-machine ifconfig

The answer is


Have you tried:

ifconfig 10:35978f0 down

As the physical interface is 10 and the virtual aspect is after the colon :.

See also https://www.cyberciti.biz/faq/linux-command-to-remove-virtual-interfaces-or-network-aliases/


You can use sudo ip link delete to remove the interface.


Examples related to linux

grep's at sign caught as whitespace How to prevent Google Colab from disconnecting? "E: Unable to locate package python-pip" on Ubuntu 18.04 How to upgrade Python version to 3.7? Install Qt on Ubuntu Get first line of a shell command's output Cannot connect to the Docker daemon at unix:/var/run/docker.sock. Is the docker daemon running? Run bash command on jenkins pipeline How to uninstall an older PHP version from centOS7 How to update-alternatives to Python 3 without breaking apt?

Examples related to networking

Access HTTP response as string in Go Communication between multiple docker-compose projects Can't access 127.0.0.1 How do I delete virtual interface in Linux? ConnectivityManager getNetworkInfo(int) deprecated Bridged networking not working in Virtualbox under Windows 10 Difference between PACKETS and FRAMES How to communicate between Docker containers via "hostname" java.net.ConnectException: failed to connect to /192.168.253.3 (port 2468): connect failed: ECONNREFUSED (Connection refused) wget: unable to resolve host address `http'

Examples related to linux-kernel

How to fix: fatal error: openssl/opensslv.h: No such file or directory in RedHat 7 How do I delete virtual interface in Linux? Image vs zImage vs uImage iptables v1.4.14: can't initialize iptables table `nat': Table does not exist (do you need to insmod?) IOCTL Linux device driver How to solve "Kernel panic - not syncing - Attempted to kill init" -- without erasing any user data What is ":-!!" in C code? What is the difference between the kernel space and the user space? What does "make oldconfig" do exactly in the Linux kernel makefile? "FATAL: Module not found error" using modprobe

Examples related to virtual-machine

virtualbox Raw-mode is unavailable courtesy of Hyper-V windows 10 How to install Guest addition in Mac OS as guest and Windows machine as host How do I delete virtual interface in Linux? Bridged networking not working in Virtualbox under Windows 10 How to enable copy paste from between host machine and virtual machine in vmware, virtual machine is ubuntu VirtualBox: mount.vboxsf: mounting failed with the error: No such device What does the DOCKER_HOST variable do? VBoxManage: error: Failed to create the host-only adapter How to export a Vagrant virtual machine to transfer it installing vmware tools: location of GCC binary?

Examples related to ifconfig

How to install "ifconfig" command in my ubuntu docker image? How do I delete virtual interface in Linux? How to get the primary IP address of the local machine on Linux and OS X? How to get default gateway in Mac OSX