Skip to contentSkip to conversation

accidental mistyping of command line kills networking

Qemu-devel Beth Kon 4 participants 7 messages Oct 27, 2009 – Oct 28, 2009

lore
Share & tools
lore

Beth Kon

author
#0 lore raw

I accidentally entered a command line as follows:

/usr/bin/qemu-kvm -drive file=/scratch/images/beth/windows/win2k3_32_R2.dat.10G.img,if=ide -m 2048 -boot cd -net nic,model=rtl8139 -net tap,script=/etc/qemu-ifup -vnc :12 -usbdevice tablet -monitor stdio -net nic,model=e1000 -net tap,script=/etc/qemu-ifup

and the machine's networking broke, requiring a network restart to get it back in order. The second -net tap,script=/etc/qemu-ifup causes the problem.

/var/log/messages shows
tap0: received packet with own address as source address

I don't have time at the moment to look into what's going wrong. Just wanted to make people aware.

Beth Kon

author
#1 lore raw
Quoted 6 lines · Beth Kon

I accidentally entered a command line as follows:

/usr/bin/qemu-kvm -drive file=/scratch/images/beth/windows/win2k3_32_R2.dat.10G.img,if=ide -m 2048 -boot cd -net nic,model=rtl8139 -net tap,script=/etc/qemu-ifup -vnc :12 -usbdevice tablet -monitor stdio -net nic,model=e1000 -net
tap,script=/etc/qemu-ifup

Quoted 10 lines

and the machine's networking broke, requiring a network restart to get it back in order. The second -net tap,script=/etc/qemu-ifup causes the problem.

/var/log/messages shows
tap0: received packet with own address as source address

I don't have time at the moment to look into what's going wrong. Just wanted to make people aware.

Beth Kon

A clarification... this command line is ok. But as it happens, windows datacenter does not have a driver for rtl8139. So somehow, this driverless adapter in windows is effectively causing an "extra" tap device to be specified on the qemu command line, wreaking havoc with the networking on the host.

#2 lore raw
Quoted 9 lines · Beth Kon
Quoted 8 lines · Beth Kon

I accidentally entered a command line as follows:

/usr/bin/qemu-kvm -drive file=/scratch/images/beth/windows/win2k3_32_R2.dat.10G.img,if=ide -m 2048 -boot cd -net nic,model=rtl8139 -net tap,script=/etc/qemu-ifup -vnc :12 -usbdevice tablet -monitor stdio -net nic,model=e1000 -net
tap,script=/etc/qemu-ifup

and the machine's networking broke, requiring a network restart to get it back in order. The second -net tap,script=/etc/qemu-ifup causes the problem.

Quoted 7 lines
Quoted 6 lines

/var/log/messages shows
tap0: received packet with own address as source address

I don't have time at the moment to look into what's going wrong. Just wanted to make people aware.

Beth Kon

A clarification... this command line is ok. But as it happens, windows datacenter does not have a driver for rtl8139. So somehow, this driverless adapter in windows is effectively causing an "extra" tap device to be specified on the qemu command line, wreaking havoc with the networking on the host.

It's actually not okay. You're creating a bridge with two tap devices on the bridge that happen to be connected in qemu by a vlan. If one tap device receives a packet, qemu is going to forward that packet to the other tap device, which will in turn send the packet to the bridge which in turn sends it to the first tap device.

Resulting in an infinite networking loop.

Regards,

Anthony Liguori

#3 lore raw
Quoted 5 lines · Anthony Liguori

It's actually not okay. You're creating a bridge with two tap devices on the bridge that happen to be connected in qemu by a vlan. If one tap device receives a packet, qemu is going to forward that packet to the other tap device, which will in turn send the packet to the bridge which in turn sends it to the first tap device.

Resulting in an infinite networking loop.

It shouldn't kill networking though. If a guest has two nics connected to the same host bridge (a reasonable configuration), and then connects these two nics through its own bridge, it creates the same sort of loop. If that kills networking, we have a guest-initiated DoS (not that the userspace-initiated DoS was much better).

Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
#4 lore raw
Quoted 12 lines · Avi Kivity
Quoted 10 lines · Anthony Liguori

It's actually not okay. You're creating a bridge with two tap devices on the bridge that happen to be connected in qemu by a vlan. If one tap device receives a packet, qemu is going to forward that packet to the other tap device, which will in turn send the packet to the bridge which in turn sends it to the first tap device.

Resulting in an infinite networking loop.

Quoted 7 lines

It shouldn't kill networking though. If a guest has two nics connected to the same host bridge (a reasonable configuration), and then connects these two nics through its own bridge, it creates the same sort of loop. If that kills networking, we have a guest-initiated DoS (not that the userspace-initiated DoS was much better).

That's what STP is for.

--
Gleb.

#5 lore raw
Quoted 9 lines · Gleb Natapov
Quoted 9 lines

It shouldn't kill networking though. If a guest has two nics connected to the same host bridge (a reasonable configuration), and then connects these two nics through its own bridge, it creates the same sort of loop. If that kills networking, we have a guest-initiated DoS (not that the userspace-initiated DoS was much better).

Quoted 3 lines

That's what STP is for.

The guest need not respect it. The host must survive network loopbacks.

Signature · 1 line
error compiling committee.c: too many arguments to function
#6 lore raw
Quoted 9 lines · Avi Kivity
Quoted 8 lines · Gleb Natapov
Quoted 8 lines

It shouldn't kill networking though. If a guest has two nics connected to the same host bridge (a reasonable configuration), and then connects these two nics through its own bridge, it creates the same sort of loop. If that kills networking, we have a guest-initiated DoS (not that the userspace-initiated DoS was much better).

Quoted 5 lines
Quoted 2 lines

That's what STP is for.

The guest need not respect it. The host must survive network loopbacks.

I am not sure how STP handles situation when one bridge doesn't support STP. If it disables one of the ports in such situation the setup will work. If it does not then rate limiting traffic is the only solution I see.

--
Gleb.