# [SOLVED] KVM: can't delete tap0 from eth0: Operation not...

## JonW

I have two physical NICs on this box: eth0 and eth1. I'm using KVM with bridged networking, and my bridge is configured on _eth1_ as below.

Whenever I shut down a VM, I get this error, and I have to restart br0 before I restart the VM (otherwsie I get no networking in the VM.) This error refers to eth0, which has nothing to do with the bridge.

```

# /etc/conf.d/net:

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.7 2002/11/18 19:39:22 azarah Exp $

# Global config file for net.* rc-scripts

#mac_eth0="00:0c:6e:5d:b6:b0"

config_eth0=( "192.168.1.100 netmask 255.255.255.0 brd 192.168.1.255" )

routes_eth0=( "default via 192.168.1.254" )

dns_domain_eth0="home"

dns_servers_eth0="203.12.160.35 203.12.160.36 127.0.0.1"

ntp_servers_eth0="ntp.syd.connect.com.au"

bridge_br0="eth1 tap0 tap1"

brctl_br0=( "setfd 0" "sethello 0" "stp off" )

RC_NEED_br0="net.tap0 net.tap1"

#This host has no address on eth1 bridge

config_tap0=( "null" )

tuntap_tap0="tap"

tunctl_tap0="-u root"

mac_tap0="52:54:00:12:34:56"

config_tap1=( "null" )

tuntap_tap1="tap"

tunctl_tap1="-u root"

mac_tap1="52:54:00:12:34:57"

config_eth1=( "null" )

config_br0=( "null" )

```

Here's what happens when I start a VM and then shut it down:-

```
jon@server ~ $ sudo kvm  -net nic,macaddr=52:54:00:12:34:70,model=virtio -net tap,ifname=tap0,script=no  -drive file=/var/media/services.img,if=virtio,boot=on -k en-us -m 512 -smp 1 -cpu host

Warning: no scancode found for keysym 310

Warning: no scancode found for keysym 310

can't delete tap0 from eth0: Operation not supported
```

and this ends up in the messages log:-

```
Oct 14 21:56:26 server [567217.912131] br0: port 2(tap0) entering disabled state
```

I'd be grateful for any help fixing this.

Cheers,

JonLast edited by JonW on Thu Oct 15, 2009 10:53 am; edited 1 time in total

----------

## Hu

The script /etc/kvm/kvm-ifdown tries to discover the bridge interface using the heuristic that your default route will use your bridge.  Since you have your default route set to eth0, it grabs eth0 instead of br0.  You can use downscript=no to suppress the use of this script, or you can edit the script text to make it do the right thing.

I am not sure why your bridge ends up in a bad state after this.  Could you post the output of brctl show before, during, and after the execution of the guest?

----------

## JonW

Thanks - I edit ed my /etc/kvm/kvm-ifdown script to use eth1, but the error became:-

```
can't delete tap0 from eth1: Operation not supported
```

Then  I changed the kvm command to include "downscript=no" and that solved the problem.

Here's the output of brtcl show before I had done so.

Before execution of the guest:-

```
jon@server ~ $ sudo brctl show

bridge name     bridge id               STP enabled     interfaces

br0             8000.00241d7ccc6e       no              eth1

                                                        tap0

                                                        tap1
```

While running:-

```
jon@server ~ $ sudo brctl show

Password: 

bridge name     bridge id               STP enabled     interfaces

br0             8000.00241d7ccc6e       no              eth1

                                                        tap0

                                                        tap1

```

After VM shutdown

```
jon@server ~ $ sudo brctl show

bridge name     bridge id               STP enabled     interfaces

br0             8000.00241d7ccc6e       no              eth1

                                                        tap0

                                                        tap1
```

----------

