Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to ping from guest to my host network without success.

qemu-system-x86_64 -hda debian_squeeze_amd64_standard.qcow2 -netdev user,id=user.0 -device e1000,netdev=user.0

I try to ping a random machine:

$ ping
Destination Host Unreachable

In the guest I'm only able to ping the host (DHCP server).

share|improve this question
Attach it to a tap device and attach the tap device & your network device to the bridge – Ulrich Dangel Jun 10 '13 at 22:29
up vote 4 down vote accepted

QEMU supports ICMP on the SLIRP backend. It is necessary to allow so called ping socket (PF_INET, SOCK_DGRAM, PROT_ICMP) for users in kernel.

It is simple

sysctl -w net.ipv4.ping_group_range='0 2147483647'

See also http://lwn.net/Articles/422330/

share|improve this answer

From QEMU wiki, QEMU doesn't support ICMP on the SLIRP backend.

User Networking (SLIRP)

This is the default networking backend and generally is the easiest to use. It does not require root / Administrator privileges. It has the following limitations:

  • there is a lot of overhead so the performance is poor
  • ICMP traffic does not work (so you cannot use ping within a guest)
  • the guest is not directly accessible from the host or the external network

For ICMP work you'll need use TAP, VDE or Socket.

More information: QEMU Wiki - Networking and alo the Wikibooks QEMU networking section

Recommended also: advanced guide for dealing with VLANs

share|improve this answer
There's a good overview on the networking options here as well: en.wikibooks.org/wiki/QEMU/Networking, and also an advanced guide for dealing with VLANs – slm Jun 11 '13 at 2:47
@slm Ty. added your links in answer ;) – Victor Aurélio Jun 11 '13 at 16:06

The simplest and more effective I found out for me was this.

In summary:

tunctl -u maiko

echo 1 > /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/ipv4/conf/wlan0/proxy_arp
echo 1 > /proc/sys/net/ipv4/conf/tap0/proxy_arp

ip link set tap0 up
route add -host dev tap0   <-- to be changed by you.

and for the guest, just run it with:

kvm -hda ~/fedora.qcow2 -net nic -net tap,ifname=tap0,script=no -usb


qemu -hda ~/fedora.qcow2 -net nic -net tap,ifname=tap0,script=no -usb 

You just have to configure a tap device, owned by your user, enable arp proxying and configure a route between your host and guest.

The author (and myself) used that to deal with the problem of bridging to a wlan0 device, which is not supported by the Linux kernel. But it works as well with a wired connection. In the arp configuration, just change wlan0 to eth0.

The guest IP address must be set by you, as DHCP doesn't work.

And you can already pint your host.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.