Skip to contentSkip to conversation

NETDEV WATCHDOG: eth0: transmit timed out

Qemu-devel Horst Schlonz 5 participants 17 messages Jan 5, 2005 – Jan 8, 2005

lore
Share & tools
lore
#0 lore raw

hi,

i have qemu 0.6.1 and a debian host system. i started qemu like this:
root@host # chmod 666 /dev/net/tun
root@host # logout
user@host # qemu -hda debiansarge.img
Password:
Connected to host network interface: tun0

i have installed debian sarge as guest system before. on the host i have a tun0 interface:
user@host # ifconfig tun0
ifconfig tun0
tun0 Protokoll:Ethernet Hardware Adresse 00:FF:58:37:D9:25

          inet Adresse:172.20.0.1 Bcast:172.20.255.255 Maske:255.255.0.0
          [...]

now, on the guest i setup networking:
root@guest # ifconfig eth0 172.20.0.2 netmask 255.255.0.0 up root@guest # ifconfig eth0
eth0 Protokoll:Ethernet Hardware Adresse 52:54:00:12:34:56

          inet Adresse:172.20.0.2 Bcast:172.20.255.255 Maske:255.255.0.0
          [...]

the problem is:
root@guest # ping -c1 172.20.0.1
PING 172.20.0.1 (172.20.0.1) 56(84) bytes of data
NETDEV WATCHDOG: eth0: transmit timed out
NETDEV WATCHDOG: eth0: transmit timed out

Quoted 1 line

From 172.20.0.2 icmp_seq=1 Destination Host Unreachable

--- 172.20.0.1 ping statistics ---
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms root@guest #

can anyone confirm this? is something wrong with the emulated realtek-network-device?

#1 lore raw
Quoted 5 lines · Horst Schlonz

the problem is:
root@guest # ping -c1 172.20.0.1
PING 172.20.0.1 (172.20.0.1) 56(84) bytes of data NETDEV WATCHDOG: eth0: transmit timed out NETDEV WATCHDOG: eth0: transmit timed out

Quoted 9 lines
Quoted 1 line

From 172.20.0.2 icmp_seq=1 Destination Host Unreachable

--- 172.20.0.1 ping statistics ---
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms root@guest #

can anyone confirm this? is something wrong with the emulated realtek-network-device?

Looks like you may need to set up iptables. E.g. make sure the kernel firewall isn't blocking it.

Also possible that you are using the wrong driver in the guest OS, so it doesn't see the ethernet card.

Signature · 2 lines
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.
#2 lore raw
Quoted 3 lines · I wrote:

Also possible that you are using the wrong driver in the guest OS, so it doesn't see the ethernet card.

Sorry, stupid me. If you can see eth0 in the guest, that means it is using the right driver.

Signature · 2 lines
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.
#3 lore raw
In reply to Jim C. Brown

Am Mittwoch, den 05.01.2005, 10:43 -0500 schrieb Jim C. Brown:

Quoted 16 lines · Horst Schlonz
Quoted 5 lines

the problem is:
root@guest # ping -c1 172.20.0.1
PING 172.20.0.1 (172.20.0.1) 56(84) bytes of data NETDEV WATCHDOG: eth0: transmit timed out NETDEV WATCHDOG: eth0: transmit timed out

Quoted 9 lines
Quoted 1 line

From 172.20.0.2 icmp_seq=1 Destination Host Unreachable

--- 172.20.0.1 ping statistics ---
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms root@guest #

can anyone confirm this? is something wrong with the emulated realtek-network-device?

Quoted 6 lines

Looks like you may need to set up iptables. E.g. make sure the kernel firewall isn't blocking it.

Also possible that you are using the wrong driver in the guest OS, so it doesn't see the ethernet card.

so, this is supposed to work, right? does it work for you? or am i missing something here? i have tried various drivers (kernels, indeed).
suse 9.2, latest knoppix... same problem there.

maybe it's the tun-driver of my host kernel. i have ubuntu hoary with stock kernel 2.6.9-1-686 here. firewall tables are all clean on host and guest, i have checked this already with iptables -L.

#4 lore raw
Quoted 3 lines · Horst Schlonz

so, this is supposed to work, right? does it work for you? or am i missing something here? i have tried various drivers (kernels, indeed).
suse 9.2, latest knoppix... same problem there.

Have you tried to use -user-net?

I am successfully using a custom 2.6.9-based distro in QEMU using "-nics 1 -user-net -isa", the guest kernel uses the NE2000 driver, the host is either a powerpc or a x86 running Linux. PCI is on my todo list.

And I have only used the network to talk with the integrated TFTP server.

/ magnus

#5 lore raw
Quoted 6 lines · Magnus Damm

Have you tried to use -user-net?

I am successfully using a custom 2.6.9-based distro in QEMU using "-nics 1 -user-net -isa", the guest kernel uses the NE2000 driver, the host is either a powerpc or a x86 running Linux. PCI is on my todo list.

PCI is better in general (tho as far as the NICs go it doesn't make much of a difference). You shouldn't need to pass the -nics 1 option, as that is the default.

Quoted 2 lines

And I have only used the network to talk with the integrated TFTP server.

Is that the only use of the network that works correctly?

Quoted 9 lines

/ magnus

_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel

Signature · 2 lines
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.
#6 lore raw
Quoted 11 lines · Jim C. Brown
Quoted 6 lines · Magnus Damm

Have you tried to use -user-net?

I am successfully using a custom 2.6.9-based distro in QEMU using "-nics 1 -user-net -isa", the guest kernel uses the NE2000 driver, the host is either a powerpc or a x86 running Linux. PCI is on my todo list.

PCI is better in general (tho as far as the NICs go it doesn't make much of a difference). You shouldn't need to pass the -nics 1 option, as that is the default.

Yeah, PCI should probably give improved performance compared to ISA. But I have something that works for me and I am not too tempted to break it right now... =)

Quoted 3 lines
Quoted 1 line

And I have only used the network to talk with the integrated TFTP server.

Is that the only use of the network that works correctly?

Nah. Or?
I use the integrated TFTP server many times per day to transfer files from the host to the guest (testing code) so I just happen to know that that part works for me. I don't know about other parts except that the integrated BOOTP server seems to work too.

/ magnus

#7 lore raw
In reply to Horst Schlonz
Quoted 20 lines · Horst Schlonz

Am Mittwoch, den 05.01.2005, 10:43 -0500 schrieb Jim C. Brown:

Quoted 19 lines · Horst Schlonz
Quoted 5 lines

the problem is:
root@guest # ping -c1 172.20.0.1
PING 172.20.0.1 (172.20.0.1) 56(84) bytes of data NETDEV WATCHDOG: eth0: transmit timed out NETDEV WATCHDOG: eth0: transmit timed out

Quoted 9 lines
Quoted 1 line

From 172.20.0.2 icmp_seq=1 Destination Host Unreachable

--- 172.20.0.1 ping statistics ---
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms root@guest #

can anyone confirm this? is something wrong with the emulated realtek-network-device?

Looks like you may need to set up iptables. E.g. make sure the kernel firewall isn't blocking it.

Quoted 7 lines
Quoted 3 lines

Also possible that you are using the wrong driver in the guest OS, so it doesn't see the ethernet card.

so, this is supposed to work, right? does it work for you? or am i missing something here? i have tried various drivers (kernels, indeed).
suse 9.2, latest knoppix... same problem there.

Show us what is in your /etc/qemu-ifup script.

Quoted 4 lines

maybe it's the tun-driver of my host kernel. i have ubuntu hoary with stock kernel 2.6.9-1-686 here. firewall tables are all clean on host and guest, i have checked this already with iptables -L.

That isn't good enough, you need to add several rules to get it to work.

Signature · 2 lines
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.
#8 lore raw

Am Mittwoch, den 05.01.2005, 14:50 -0500 schrieb Jim C. Brown:

Quoted 25 lines · Horst Schlonz
Quoted 24 lines

Am Mittwoch, den 05.01.2005, 10:43 -0500 schrieb Jim C. Brown:

Quoted 22 lines · Horst Schlonz
Quoted 5 lines

the problem is:
root@guest # ping -c1 172.20.0.1
PING 172.20.0.1 (172.20.0.1) 56(84) bytes of data NETDEV WATCHDOG: eth0: transmit timed out NETDEV WATCHDOG: eth0: transmit timed out

Quoted 9 lines
Quoted 1 line

From 172.20.0.2 icmp_seq=1 Destination Host Unreachable

--- 172.20.0.1 ping statistics ---
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms root@guest #

can anyone confirm this? is something wrong with the emulated realtek-network-device?

Looks like you may need to set up iptables. E.g. make sure the kernel firewall isn't blocking it.

Also possible that you are using the wrong driver in the guest OS, so it doesn't see the ethernet card.

Quoted 6 lines
Quoted 3 lines

so, this is supposed to work, right? does it work for you? or am i missing something here? i have tried various drivers (kernels, indeed).
suse 9.2, latest knoppix... same problem there.

Show us what is in your /etc/qemu-ifup script.

user@host # cat /etc/qemu-ifup
#!/bin/sh
sudo -p "Password for $0:" /sbin/ifconfig $1 172.20.0.1 user@host #

Quoted 7 lines
Quoted 4 lines

maybe it's the tun-driver of my host kernel. i have ubuntu hoary with stock kernel 2.6.9-1-686 here. firewall tables are all clean on host and guest, i have checked this already with iptables -L.

That isn't good enough, you need to add several rules to get it to work.

i just followed the documentation:

quote
3.7.1 Using tun/tap network interface
This is the standard way to emulate network. QEMU adds a virtual network device on your host (called tun0), and you can then configure it as if it was a real ethernet card.

As an example, you can download the linux-test-xxx.tar.gz' archive and copy the script qemu-ifup' in /etc' and configure properly sudo so that the command ifconfig contained in qemu-ifup' can be executed as root. You must verify that your host kernel supports the TUN/TAP network
interfaces: the device `/dev/net/tun' must be present. /quote

#9 lore raw
Quoted 6 lines · Horst Schlonz
Quoted 2 lines

Show us what is in your /etc/qemu-ifup script.

user@host # cat /etc/qemu-ifup
#!/bin/sh
sudo -p "Password for $0:" /sbin/ifconfig $1 172.20.0.1 user@host #

Yes, you are missing the iptables lines. (Personally I prefer ipchains to iptables, but alas ...)

(the following script was "borrowed" from http://www.scaramanga.co.uk/stuff/qemu-ifup)

--CUT HERE--
#!/bin/sh

## Setup your guest OS with the following parameters ## IP - 192.168.1.1
## Mask - 255.255.255.0
## Gateway - 192.168.1.254
## DNS - whatver is in your resolv.conf

# Remember to have the following in sysctl.conf and do sysctl -p

# net.ipv4.ip_forward = 1

# Set these to the IP/mask you want to your qemu vm to have on the network qemu_ip="152.78.192.217"
qemu_netmask="255.255.252.0"

# Setup an interface for the vm to use
ifconfig eth0:1 up $qemu_ip netmask $qemu_netmask

# Clear iptables
iptables -t nat -F PREROUTING
iptables -t nat -F POSTROUTING

# Setup NAT

iptables -t nat -A PREROUTING -d $qemu_ip \
        -j DNAT --to-destination 192.168.1.1
iptables -t nat -A POSTROUTING -s 192.168.1.1 \
        -j SNAT --to-source $qemu_ip

# Bring up the TUN interface
sudo -p "Password for $0:" /sbin/ifconfig $1 192.168.1.254 --CUT HERE--

can you test out that script and see if it works?

Quoted 11 lines
Quoted 2 lines

That isn't good enough, you need to add several rules to get it to work.

i just followed the documentation:

quote
3.7.1 Using tun/tap network interface
This is the standard way to emulate network. QEMU adds a virtual network device on your host (called tun0), and you can then configure it as if it was a real ethernet card.

Quoted 7 lines

As an example, you can download the linux-test-xxx.tar.gz' archive and copy the script qemu-ifup' in /etc' and configure properly sudo so that the command ifconfig contained in qemu-ifup' can be executed as root. You must verify that your host kernel supports the TUN/TAP network
interfaces: the device `/dev/net/tun' must be present. /quote

Did you copy the qemu-ifup script from the one in linux-test-xxx.tar.gz? I've never looked at it (since I use VDE) but I'd be suprised if that script contained only what you showed me.

Signature · 2 lines
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.
#10 lore raw

Am Mittwoch, den 05.01.2005, 16:33 -0500 schrieb Jim C. Brown:

Quoted 8 lines · Horst Schlonz
Quoted 6 lines
Quoted 2 lines

Show us what is in your /etc/qemu-ifup script.

user@host # cat /etc/qemu-ifup
#!/bin/sh
sudo -p "Password for $0:" /sbin/ifconfig $1 172.20.0.1 user@host #

Quoted 4 lines

Yes, you are missing the iptables lines. (Personally I prefer ipchains to iptables, but alas ...)

[script for setting up masquerading snipped]

well, i don't see how masquerading and forwarding will help me in pinging from guest to host or vice versa. but i did as you say and - as expected - it does not work. see subject for failure message.

Quoted 2 lines

can you test out that script and see if it works?

actually in the past few days i tried every qemu networking configuration i could get my hands on. i tried -user-net and vde, i fiddled with iptables, arp and tcpdump, masquerading, forwarding, bridging, everything.

after manually filling all arp-caches with correct mac-adresses i can even see icmp-packet coming out of the guest (with the ususal WATCHDOG-failure, though). but the icmp-replys never show up in the guest.

i think, the problem is, that every time network traffic is issued from or to the guest, it does not work and these failure shows up in /var/log/messages on the guest:

Jan  5 03:53:14 guest kernel: NETDEV WATCHDOG: eth0: transmit timed out

last hope for me was asking qemu devs on this list, but now i will try one last thing. ditch the ubuntu-qemu and compile it myself.

#11 lore raw
Quoted 2 lines

last hope for me was asking qemu devs on this list, but now i will try one last thing. ditch the ubuntu-qemu and compile it myself.

Did you try a linux guest where the kernel is configured with CONFIG_NE2000? This together with together with "qemu -isa"?

/ magnus

#12 lore raw

Am Donnerstag, den 06.01.2005, 01:58 +0100 schrieb Magnus Damm:

Quoted 6 lines
Quoted 2 lines

last hope for me was asking qemu devs on this list, but now i will try one last thing. ditch the ubuntu-qemu and compile it myself.

Did you try a linux guest where the kernel is configured with CONFIG_NE2000? This together with together with "qemu -isa"?

it's configured as a module. loading ne module fails due to missing parameters and probably to missing isapnptools.

well, let's try knoppix...
loadind ne fails (ne.c: You must supply "io=0xNNN" value(s) for ISA cards).
pnpdump reveals "No board found"

#13 lore raw
Quoted 4 lines · Horst Schlonz
Quoted 3 lines

Did you try a linux guest where the kernel is configured with CONFIG_NE2000? This together with together with "qemu -isa"?

Quoted 8 lines

it's configured as a module. loading ne module fails due to missing parameters and probably to missing isapnptools.

well, let's try knoppix...
loadind ne fails (ne.c: You must supply "io=0xNNN" value(s) for ISA cards).
pnpdump reveals "No board found"

Quoted 1 line

This together with together with "qemu -isa"?

Sounds like you forgot the -isa option. If you put that in, then something inside of qemu is clearly broken.

Quoted 8 lines

_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel

Signature · 2 lines
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.
#14 lore raw

Am Mittwoch, den 05.01.2005, 20:53 -0500 schrieb Jim C. Brown:

Quoted 8 lines · Horst Schlonz
Quoted 7 lines
Quoted 3 lines

Did you try a linux guest where the kernel is configured with CONFIG_NE2000? This together with together with "qemu -isa"?

it's configured as a module. loading ne module fails due to missing parameters and probably to missing isapnptools.

Quoted 9 lines
Quoted 5 lines

well, let's try knoppix...
loadind ne fails (ne.c: You must supply "io=0xNNN" value(s) for ISA cards).
pnpdump reveals "No board found"

Quoted 1 line

This together with together with "qemu -isa"?

Sounds like you forgot the -isa option. If you put that in, then something inside of qemu is clearly broken.

i have compiled the latest snapshot of qemu (qemu-snapshot-2005-01-04_23) and my dead simple network configuration in my orginal post works now. i can ping and i am confident, that the neat stuff (vde) will now work too.

there is probably something wrong with this qemu-package:

 # dpkg --info /var/cache/apt/archives/qemu_0.6.1-1_i386.deb
 neues Debian-Paket, Version 2.0.
 Größe 2677974 Byte: control-Archiv= 1581 Byte.
      15 Bytes,     1 Zeilen      conffiles
    1029 Bytes,    24 Zeilen      control
    1556 Bytes,    26 Zeilen      md5sums
 Package: qemu
 Version: 0.6.1-1
 Section: misc
 Priority: optional
 Architecture: i386
 Depends: libc6 (>= 2.3.2.ds1-4), libsdl1.2debian (>> 1.2.7-0), zlib1g
(>= 1:1.2.1), vgabios, bochsbios, sharutils
 Suggests: sudo
 Installed-Size: 6992
 Maintainer: Debian QEMU Team <[email protected]>

anyway, thank you guys.

#15 lore raw
Quoted 19 lines · Horst Schlonz

Am Mittwoch, den 05.01.2005, 20:53 -0500 schrieb Jim C. Brown:

Quoted 8 lines · Horst Schlonz
Quoted 7 lines
Quoted 4 lines

Did you try a linux guest where the kernel is configured with CONFIG_NE2000? This together with together with "qemu -isa"?

it's configured as a module. loading ne module fails due to missing parameters and probably to missing isapnptools.

Quoted 10 lines
Quoted 5 lines

well, let's try knoppix...
loadind ne fails (ne.c: You must supply "io=0xNNN" value(s) for ISA cards).
pnpdump reveals "No board found"

Quoted 1 line

This together with together with "qemu -isa"?

Sounds like you forgot the -isa option. If you put that in, then something inside of qemu is clearly broken.

Quoted 5 lines

i have compiled the latest snapshot of qemu (qemu-snapshot-2005-01-04_23) and my dead simple network configuration in my orginal post works now. i can ping and i am confident, that the neat stuff (vde) will now work too.

there is probably something wrong with this qemu-package:

Indeed, noted as Debian bugs 283166 and 285752.

bugs.debian.org/package-name (in this case bugs.debian.org/qemu) is often a good first step to see if anyone else has had the same issue.

Anand

Signature · 3 lines
linux.conf.au 2005   -  http://lca2005.linux.org.au/  -  Birthplace of Tux
April 18th to 23rd   -  http://lca2005.linux.org.au/  -       LINUX
Canberra, Australia  -  http://lca2005.linux.org.au/  -    Get bitten!
#16 lore raw
In reply to Horst Schlonz
Quoted 29 lines · Horst Schlonz

hi,

i have qemu 0.6.1 and a debian host system. i started qemu like this:
root@host # chmod 666 /dev/net/tun
root@host # logout
user@host # qemu -hda debiansarge.img
Password:
Connected to host network interface: tun0

i have installed debian sarge as guest system before. on the host i have a tun0 interface:
user@host # ifconfig tun0
ifconfig tun0
tun0 Protokoll:Ethernet Hardware Adresse 00:FF:58:37:D9:25

          inet Adresse:172.20.0.1 Bcast:172.20.255.255 Maske:255.255.0.0
          [...]

now, on the guest i setup networking:
root@guest # ifconfig eth0 172.20.0.2 netmask 255.255.0.0 up root@guest # ifconfig eth0
eth0 Protokoll:Ethernet Hardware Adresse 52:54:00:12:34:56

          inet Adresse:172.20.0.2 Bcast:172.20.255.255 Maske:255.255.0.0
          [...]

the problem is:
root@guest # ping -c1 172.20.0.1
PING 172.20.0.1 (172.20.0.1) 56(84) bytes of data
NETDEV WATCHDOG: eth0: transmit timed out
NETDEV WATCHDOG: eth0: transmit timed out

Quoted 8 lines
Quoted 1 line

From 172.20.0.2 icmp_seq=1 Destination Host Unreachable

--- 172.20.0.1 ping statistics ---
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms root@guest #

can anyone confirm this? is something wrong with the emulated realtek-network-device?

mandrake based host system here, after booting a
default 2.6.10 kernel with:

qemu-0.6.1/i386/qemu-fast -nographic -L qemu-0.6.1/pc-bios 	\
	-m 64 -snapshot -hda IMGs/TESTn_32M.img -kernel 	\
	/src/linux-2.6.10-P1/arch/i386/boot/bzImage 		\
	-append "rw root=/dev/hda1 devfs=mount init=/bin/bash"

(the following script is executed on the host:)

# cat /etc/qemu-ifup
---------------------------------------------------------
#!/bin/bash

IF="$1"
NR=echo $IF | sed 's/^[a-z]*//'
NX=$[NR+10]

IFX="10.0.$NR.1"
BCX="10.0.$NR.255"
RMX="10.0.$NR.2"

echo -e "\e[33m$IF configured for $IFX/$RMX\e[0m"

ifconfig $IF $IFX netmask 255.255.255.0 broadcast $BCX route add -net 192.168.$NR.0/24 gw $RMX

# route add -host 10.0.0.$NX dev $IF
echo 1 > /proc/sys/net/ipv4/conf/$IF/proxy_arp

---------------------------------------------------------

(now on the guest)

[root@(none) /]$ ifconfig lo 127.0.0.1
[root@(none) /]$ ifconfig eth0 10.0.0.2
[root@(none) /]$ ping -c 2 10.0.0.1
PING 10.0.0.1 (10.0.0.1) from 10.0.0.2 : 56(84) bytes of data. 64 bytes from 10.0.0.1: icmp_seq=0 ttl=64 time=7.181 msec 64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=821 usec

--- 10.0.0.1 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss round-trip min/avg/max/mdev = 0.821/4.001/7.181/3.180 ms

(the relevant kernel config parts)

CONFIG_NET=y
CONFIG_UNIX=y
CONFIG_INET=y
CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_PNP=y
CONFIG_NETDEVICES=y
CONFIG_DUMMY=y
CONFIG_NET_ETHERNET=y
CONFIG_MII=y
CONFIG_NET_PCI=y
CONFIG_NE2K_PCI=y

HTH,
Herbert

Quoted 4 lines

_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel