qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-discuss] connect qemu to internet


From: Fatemeh Mehdizadeh
Subject: Re: [Qemu-discuss] connect qemu to internet
Date: Mon, 23 Jun 2014 10:40:33 +0430


>With "user" networking, the Qemu-provided network environment includes
>a DNS server (as described in
>http://wiki.qemu.org/Documentation/Networking).  It is at 10.0.2.3.
>It address is provided in the DHCP messages provided by the DHCP
>server on that simulated LAN.

>If you use "user" networking, I'd advise you to configure the
>interface on the guest to obtain its network parameters from the DHCP
>messages it will see.


Thank you for your instant response,
 I don't have dhcp server so, I cannot use dhcp in my network. I used TAP to connect to internet. I should install a package from debian repository on my qemu guest (vyatta) because of this problem I cannot connect to repository.

the steps I used is in http://en.wikibooks.org/wiki/QEMU/Networking#TAP.2FTUN_device

1.
$ sudo mkdir /dev/net
$ sudo mknod /dev/net/tun c 10 200 $ sudo /sbin/modprobe tun
2.
In /etc/qemu-ifup:

P37P1IPADDR=192.168.0.127
GATEWAY=192.168.0.1
BROADCAST=192.168.0.255


/sbin/ifdown p37p1
/sbin/ifconfig p37p1 0.0.0.0 promisc up
/usr/sbin/openvpn --mktun --dev $1 --user `id -un`
/sbin/ifconfig $1 0.0.0.0 promisc up
/usr/sbin/brctl addbr br0
/usr/sbin/brctl addif br0 p37p1
/usr/sbin/brctl addif br0 $1
/usr/sbin/brctl stp br0 off
/sbin/ifconfig br0 $P37P1IPADDR netmask 255.255.255.0 broadcast $BROADCAST
/sbin/route add default gw $GATEWAY

3. I make qemu-ifdown and set sudoers file as described in the link.

4.run qemu
#sudo /etc/qemu-ifup tap0
#/usr/bin/qemu-system-i386 -m 256 -hda vyatta6.4vc.img  -net nic -net tap,ifname=tap0,script=no,downscript=no

I'm so confused and don't know what to do.

Thank you for your help and sharing your knowledge.
 


On Mon, Jun 23, 2014 at 8:00 AM, Dale R. Worley <address@hidden> wrote:
> From: Fatemeh Mehdizadeh <address@hidden>
>
> But another problem occure : I cannot ping hosts like google.com on qemu
> guest. It says "unknown host". Again I google for this and I found the
> message related to DNS error. so, I set dns in qemu guest (vyatta) by the
> command :

With "user" networking, the Qemu-provided network environment includes
a DNS server (as described in
http://wiki.qemu.org/Documentation/Networking).  It is at 10.0.2.3.
It address is provided in the DHCP messages provided by the DHCP
server on that simulated LAN.

If you use "user" networking, I'd advise you to configure the
interface on the guest to obtain its network parameters from the DHCP
messages it will see.

Dale


reply via email to

[Prev in Thread] Current Thread [Next in Thread]