qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] user-mode networking not allowing internet traffic
@ 2011-06-15 18:12 Amitava Shee
  2011-06-15 19:37 ` Blue Swirl
  0 siblings, 1 reply; 3+ messages in thread
From: Amitava Shee @ 2011-06-15 18:12 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 2043 bytes --]

My ubuntu 11.04 guest is not able to connect to the internet when launched
as -net user. Any help is much appreciated.

qemu command line
==============
amitava@bonjovi:/var/vms$ qemu-system-x86_64 -m 512 -drive
index=0,media=disk,if=virtio,file=ub2.qcow2,boot=on -vnc :0 -monitor stdio
-net nic,model=virtio,vlan=1 -net user,vlan=1,hostname=ubuntu2

ifconfig output in guest
=================
amitava@ubuntu2:~$ ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 52:54:00:12:34:56
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::5054:ff:fe12:3456/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:11 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1984 (1.9 KB)  TX bytes:1748 (1.7 KB)

amitava@ubuntu2:~$ nslookup google
Server:        10.0.2.3
Address:    10.0.2.3#53

Non-authoritative answer:
Name:    google.com
Address: 74.125.115.104
Name:    google.com
Address: 74.125.115.106
Name:    google.com
Address: 74.125.115.105
Name:    google.com
Address: 74.125.115.147
Name:    google.com
Address: 74.125.115.103
Name:    google.com
Address: 74.125.115.99

amitava@ubuntu2:~$ traceroute google.com
traceroute to google.com (74.125.115.99), 30 hops max, 60 byte packets
 1  10.0.2.2 (10.0.2.2)  0.469 ms  0.457 ms  0.453 ms
 2  * * *
 3  * * *
 4  * * *
 5  * * *
 6  * * *
 7  * * *
 8  * * *
 9  * * *
10  * * *
11  * * *
12  * * *
13  * * *
14  * * *
15  * * *
16  * * *
17  * * *
18  * * *
19  * * *
20  * * *
21  * * *
22  * * *
23  * * *
24  * * *
25  * * *
26  * * *
27  * * *
28  * * *
29  * * *
30  * * *

Here's the host info
==============
amitava@bonjovi:~$ uname -a
Linux bonjovi 2.6.32-32-server #62-Ubuntu SMP Wed Apr 20 22:07:43 UTC 2011
x86_64 GNU/Linux

amitava@bonjovi:~$ qemu-system-x86_64 --version
QEMU PC emulator version 0.12.3 (qemu-kvm-0.12.3), Copyright (c) 2003-2008
Fabrice Bellard


Thank you,
Amitava

[-- Attachment #2: Type: text/html, Size: 2564 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] user-mode networking not allowing internet traffic
  2011-06-15 18:12 [Qemu-devel] user-mode networking not allowing internet traffic Amitava Shee
@ 2011-06-15 19:37 ` Blue Swirl
  2011-06-16  3:15   ` Amitava Shee
  0 siblings, 1 reply; 3+ messages in thread
From: Blue Swirl @ 2011-06-15 19:37 UTC (permalink / raw)
  To: Amitava Shee; +Cc: qemu-devel

On Wed, Jun 15, 2011 at 9:12 PM, Amitava Shee <amitava.shee@gmail.com> wrote:
> My ubuntu 11.04 guest is not able to connect to the internet when launched
> as -net user. Any help is much appreciated.
>
> qemu command line
> ==============
> amitava@bonjovi:/var/vms$ qemu-system-x86_64 -m 512 -drive
> index=0,media=disk,if=virtio,file=ub2.qcow2,boot=on -vnc :0 -monitor stdio
> -net nic,model=virtio,vlan=1 -net user,vlan=1,hostname=ubuntu2
>
> ifconfig output in guest
> =================
> amitava@ubuntu2:~$ ifconfig eth0
> eth0      Link encap:Ethernet  HWaddr 52:54:00:12:34:56
>           inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
>           inet6 addr: fe80::5054:ff:fe12:3456/64 Scope:Link
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:11 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:1984 (1.9 KB)  TX bytes:1748 (1.7 KB)
>
> amitava@ubuntu2:~$ nslookup google
> Server:        10.0.2.3
> Address:    10.0.2.3#53
>
> Non-authoritative answer:
> Name:    google.com
> Address: 74.125.115.104
> Name:    google.com
> Address: 74.125.115.106
> Name:    google.com
> Address: 74.125.115.105
> Name:    google.com
> Address: 74.125.115.147
> Name:    google.com
> Address: 74.125.115.103
> Name:    google.com
> Address: 74.125.115.99

This and the IP address of the eth0 show that the connection is working.

> amitava@ubuntu2:~$ traceroute google.com
> traceroute to google.com (74.125.115.99), 30 hops max, 60 byte packets
>  1  10.0.2.2 (10.0.2.2)  0.469 ms  0.457 ms  0.453 ms
>  2  * * *
>  3  * * *
>  4  * * *
>  5  * * *
>  6  * * *
>  7  * * *
>  8  * * *
>  9  * * *
> 10  * * *
> 11  * * *
> 12  * * *
> 13  * * *
> 14  * * *
> 15  * * *
> 16  * * *
> 17  * * *
> 18  * * *
> 19  * * *
> 20  * * *
> 21  * * *
> 22  * * *
> 23  * * *
> 24  * * *
> 25  * * *
> 26  * * *
> 27  * * *
> 28  * * *
> 29  * * *
> 30  * * *

User mode network (SLIRP) only supports plain TCP and UDP, traceroute
and ping (which need ICMP) do not work.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] user-mode networking not allowing internet traffic
  2011-06-15 19:37 ` Blue Swirl
@ 2011-06-16  3:15   ` Amitava Shee
  0 siblings, 0 replies; 3+ messages in thread
From: Amitava Shee @ 2011-06-16  3:15 UTC (permalink / raw)
  To: Blue Swirl; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 701 bytes --]

> User mode network (SLIRP) only supports plain TCP and UDP, traceroute and
ping (which need ICMP) do not work.

Indeed - wget google.com works just fine!

Chris, your link to the documentation is helpful. Here's my modified command

amitava@bonjovi:~/qemu$ kvm -name cold -m 512 -drive
file=$PWD/cold.qcow2,if=virtio,boot=on -vnc :0 -netdev type=user,id=mynet0
-device e1000,netdev=mynet0

For folks who might be looking for tap/tun approach (to allow ssh'ing to the
guest) -

 amitava@bonjovi:~/qemu$ sudo kvm -name cold -m 512 -drive
file=$PWD/cold.qcow2,if=virtio,boot=on -vnc :0 -netdev type=tap,id=netdev0
-device virtio-net-pci,netdev=netdev0

Thank you Chris and Blue for your help.

-Amitava

[-- Attachment #2: Type: text/html, Size: 808 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-06-16  3:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-15 18:12 [Qemu-devel] user-mode networking not allowing internet traffic Amitava Shee
2011-06-15 19:37 ` Blue Swirl
2011-06-16  3:15   ` Amitava Shee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).