Re: virtual network with qemu
marco.borsat...@poste.it wrote: Thank you twice: the communication between 2 virtual PCs works. Now should I configure another virtual PC as a gateway with a netmask, say, 255.0.0.0? The virtual PC have a calss B netmask. Yes, read bellow. I will also try the tools I've suggested to me. All IP addressing is pretty much automated in imunes, so you can create quickly the needed simulation environment. It's also somehow integrated with quagga, so you can use dynamic routing(OSPF, RIP, BGP and maybe IS-IS) besides static routing. But, anyway, it's a time saver to have all network interfaces configured automatically by the program. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: virtual network with qemu
On Thu, May 14, 2009 at 07:53:32AM +0200, marco.borsat...@poste.it wrote: > Hi to all. > I'd like to implement a little virtual network using QEMU 0.10.2, but, until > now, I have failed. > This is the situation. > Host: AMD 64 running FreeBSD 7.2 > #ifconfig > nfe0: flags=8843 metric 0 mtu 1500 > options=10b > ether 00:15:f2:44:2d:f9 > inet 192.168.0.2 netmask 0xff00 broadcast 192.168.0.255 > media: Ethernet autoselect (100baseTX ) > status: active > plip0: flags=108810 metric 0 mtu > 1500 > lo0: flags=8049 metric 0 mtu 16384 > inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3 > inet6 ::1 prefixlen 128 > inet 127.0.0.1 netmask 0xff00 > I've create an image using the FreeBSD 7.2 DVD: > #qemu-img create -f qcow2 hda fbsd72.img 10G > The image has been created. > #qemu -L /usr/local/share/qemu/ -cdrom /dev/acd0 -m 512 -boot d fbsd72.img > Alfter a long time, the installation of the guest system has been completed. It would probably be faster to use a FreeBSD ISO image instead of the real CD drive. > When the installation program asked for information about network > configuration, as a first step, I chose DHCP configuration and, as > usualy, the network has been set like this: > IP 10.0.2.15/255.255.255.0 > gateway 10.0.2.2 > nameserver 10.0.2.3 > > When the installation of the guest PC was finished, I've copied the > image to pc01.img, to keep the original untouched. After that I've started > qemu like this: > #qemu -L /usr/local/share/qemu -localtime -net nic,macaddr=00:15:f2:44:2d:01 > -net socket,mcast=230.0.0.1:1234 -hda pc01.img -cdrom /dev/acd0 & > but the network in the guest system does not work. Try the following command instead: qemu -L /usr/local/share/qemu -localtime -net nic -net user -hda pc01.img Roland -- R.F.Smith http://www.xs4all.nl/~rsmith/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) pgpASfY2VzOsL.pgp Description: PGP signature
Re: virtual network with qemu
On Thu, 14 May 2009 13:39:17 +0200 "marco\.borsati...@poste\.it" wrote: > First, thank you. > You are right, qemu has an internal DHCP server, which should be > perfect for me, becuse I would like to emulate a network without any > contact with external (real) world. The problem is that my virtual PC > can't ping the gateway. For my idea (this is just a way to study a > project for a network without a real network) the communication is > intended only among virtual PCs. But If I can't contact the (virtual) > gateway will it be possible to contact another virtual PC on a > different subnet? The problem is that ping is a setuid binary, so qemu cant send a ping into the outside world as an ordinary user process. I think you may be able to ping between two emulated machine within qemu. Even if you can't it might be worth staying with qemu's networking, if pings aren't essential, as it sounds closer to what you need than networking via tap. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: virtual network with qemu
Thank you twice: the communication between 2 virtual PCs works. Now should I configure another virtual PC as a gateway with a netmask, say, 255.0.0.0? The virtual PC have a calss B netmask. I will also try the tools I've suggested to me. Marco -- Original Header --- >From : "Nikos Vassiliadis" nvass9...@gmx.com To : "marco.borsat...@poste.it" marco.borsat...@poste.it Cc : freebsd-questions@freebsd.org Date : Thu, 14 May 2009 16:08:01 +0300 Subject : Re: virtual network with qemu > marco.borsat...@poste.it wrote: > > First, thank you. You are right, qemu has an internal DHCP server, > > which should be perfect for me, becuse I would like to emulate a > > network without any contact with external (real) world. The problem > > is that my virtual PC can't ping the gateway. For my idea (this is > > just a way to study a project for a network without a real network) > > the communication is intended only among virtual PCs. But If I can't > > contact the (virtual) gateway will it be possible to contact another > > virtual PC on a different subnet? Or even on the same subnet? In my > > idea I would like to create a little but complex net with one master > > controller, a slave controller, a little number of client belonging > > to different subnets. Maybe with or without a DHCP server. > > Yes, hosts on the same IP network, which of course are on the same > broadcast domain, are able to communicate with each other with no > other intermediates. A gateway is required only if you want to > communicate with other networks. So, you have to create, let's say, > 3 virtual PCs: > 1) host_a on network A > 2) host_b on network B > 3) router_a on both networks A and B > > That's all. > > I guess, qemu uses the multicast solution to create virtual > broadcast domains, like a switch does. qemu, I guess, has no > knowledge of what happens on these ethernets, like a real ethernet > switch. It's a real cool solution, since the user is able to > create networks than can span several physical machines. > > Maybe you should use socket instead of mcast, don't really > know the pros and cons of those two. > > Last but not least, since you seem to look for a learning tool, let > me suggest two great ones: > 1) imunes, you need vmware player for a quick start. > http://www.imunes.net/virtnet/ > 2) netkit > http://wiki.netkit.org/index.php/Download_Official > > I have extensively used imunes and it's great. > You should also check netkit. In case, it matters, the latter > is GNU/Linux based. > > HTH, Nikos > ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: virtual network with qemu
marco.borsat...@poste.it wrote: First, thank you. You are right, qemu has an internal DHCP server, which should be perfect for me, becuse I would like to emulate a network without any contact with external (real) world. The problem is that my virtual PC can't ping the gateway. For my idea (this is just a way to study a project for a network without a real network) the communication is intended only among virtual PCs. But If I can't contact the (virtual) gateway will it be possible to contact another virtual PC on a different subnet? Or even on the same subnet? In my idea I would like to create a little but complex net with one master controller, a slave controller, a little number of client belonging to different subnets. Maybe with or without a DHCP server. Yes, hosts on the same IP network, which of course are on the same broadcast domain, are able to communicate with each other with no other intermediates. A gateway is required only if you want to communicate with other networks. So, you have to create, let's say, 3 virtual PCs: 1) host_a on network A 2) host_b on network B 3) router_a on both networks A and B That's all. I guess, qemu uses the multicast solution to create virtual broadcast domains, like a switch does. qemu, I guess, has no knowledge of what happens on these ethernets, like a real ethernet switch. It's a real cool solution, since the user is able to create networks than can span several physical machines. Maybe you should use socket instead of mcast, don't really know the pros and cons of those two. Last but not least, since you seem to look for a learning tool, let me suggest two great ones: 1) imunes, you need vmware player for a quick start. http://www.imunes.net/virtnet/ 2) netkit http://wiki.netkit.org/index.php/Download_Official I have extensively used imunes and it's great. You should also check netkit. In case, it matters, the latter is GNU/Linux based. HTH, Nikos ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
virtual network with qemu
First, thank you. You are right, qemu has an internal DHCP server, which should be perfect for me, becuse I would like to emulate a network without any contact with external (real) world. The problem is that my virtual PC can't ping the gateway. For my idea (this is just a way to study a project for a network without a real network) the communication is intended only among virtual PCs. But If I can't contact the (virtual) gateway will it be possible to contact another virtual PC on a different subnet? Or even on the same subnet? In my idea I would like to create a little but complex net with one master controller, a slave controller, a little number of client belonging to different subnets. Maybe with or without a DHCP server. Marco -- Original Header --- >From : "Nikos Vassiliadis" nvass9...@gmx.com To : "marco.borsat...@poste.it" marco.borsat...@poste.it Cc : freebsd-questions@freebsd.org Date : Thu, 14 May 2009 11:28:59 +0300 Subject : Re: virtual network with qemu > marco.borsat...@poste.it wrote: > > When the installation program asked for information about network > > configuration, as a > > first step, I chose DHCP configuration and, as usualy, the network has been > > set > > like this: > > IP 10.0.2.15/255.255.255.0 > > If I recall correctly qemu has a built-in DHCP server. > That's the one that served you, not a "real" DHCP server > running on your LAN, that is, you are not in any way connected > to the "real" network. > > > #qemu -L /usr/local/share/qemu -localtime -net > > nic,macaddr=00:15:f2:44:2d:01 -net socket,mcast=230.0.0.1:1234 -hda > > pc01.img -cdrom /dev/acd0 & > > but the network in the guest system does not work. > > It makes sense, that the multicast option will work > between virtual hosts only. That is, it uses multicast > to provide a virtual broadcast domain, which appears to > the host operating system as a ethernet device. > > > ifconfig in the guest system tells: > > #ifconfig -a > > ed0: flags=8843 metric 0 mtu 1500 > > ether 00:15:f2:44:2d:01 > > media: Ethernet 10baseT/UTP > > plip0: ... > > lo0: ... > > If I try: > > #ping 10.0.2.2 (the gateway) > > all packets are lost. For this reason, I've tryed a static IP configuration > > like this: > > IP 10.0.2.4/255.255.255.0 > > gateway 10.0.2.2 > > nameserver 10.0.2.3 > > but the gateway does not respond. So it is useless to try with a second > > guest system. > > No, infact it's the exact opposite. This type of device > will work *only* if you add another virtual system. > > To get connected to the "real" network, you must use tap > devices. Correction: > Browsing the qemu's wiki I found out that there is a newer > and simpler approach that I am not familiar with: > http://calamari.reverse-dns.net:980/cgi-bin/moin.cgi/user-net > > So, if you do want internet access, just remove all network > associated options and it will work automagically. If you just > want to connect guest systems together use multicast or socket > or ... > > HTH, Nikos > > ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: virtual network with qemu
marco.borsat...@poste.it wrote: When the installation program asked for information about network configuration, as a first step, I chose DHCP configuration and, as usualy, the network has been set like this: IP 10.0.2.15/255.255.255.0 If I recall correctly qemu has a built-in DHCP server. That's the one that served you, not a "real" DHCP server running on your LAN, that is, you are not in any way connected to the "real" network. #qemu -L /usr/local/share/qemu -localtime -net nic,macaddr=00:15:f2:44:2d:01 -net socket,mcast=230.0.0.1:1234 -hda pc01.img -cdrom /dev/acd0 & but the network in the guest system does not work. It makes sense, that the multicast option will work between virtual hosts only. That is, it uses multicast to provide a virtual broadcast domain, which appears to the host operating system as a ethernet device. ifconfig in the guest system tells: #ifconfig -a ed0: flags=8843 metric 0 mtu 1500 ether 00:15:f2:44:2d:01 media: Ethernet 10baseT/UTP plip0: ... lo0: ... If I try: #ping 10.0.2.2 (the gateway) all packets are lost. For this reason, I've tryed a static IP configuration like this: IP 10.0.2.4/255.255.255.0 gateway 10.0.2.2 nameserver 10.0.2.3 but the gateway does not respond. So it is useless to try with a second guest system. No, infact it's the exact opposite. This type of device will work *only* if you add another virtual system. To get connected to the "real" network, you must use tap devices. Correction: Browsing the qemu's wiki I found out that there is a newer and simpler approach that I am not familiar with: http://calamari.reverse-dns.net:980/cgi-bin/moin.cgi/user-net So, if you do want internet access, just remove all network associated options and it will work automagically. If you just want to connect guest systems together use multicast or socket or ... HTH, Nikos ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
virtual network with qemu
Hi to all. I'd like to implement a little virtual network using QEMU 0.10.2, but, until now, I have failed. This is the situation. Host: AMD 64 running FreeBSD 7.2 #ifconfig nfe0: flags=8843 metric 0 mtu 1500 options=10b ether 00:15:f2:44:2d:f9 inet 192.168.0.2 netmask 0xff00 broadcast 192.168.0.255 media: Ethernet autoselect (100baseTX ) status: active plip0: flags=108810 metric 0 mtu 1500 lo0: flags=8049 metric 0 mtu 16384 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3 inet6 ::1 prefixlen 128 inet 127.0.0.1 netmask 0xff00 I've create an image using the FreeBSD 7.2 DVD: #qemu-img create -f qcow2 hda fbsd72.img 10G The image has been created. #qemu -L /usr/local/share/qemu/ -cdrom /dev/acd0 -m 512 -boot d fbsd72.img Alfter a long time, the installation of the guest system has been completed. When the installation program asked for information about network configuration, as a first step, I chose DHCP configuration and, as usualy, the network has been set like this: IP 10.0.2.15/255.255.255.0 gateway 10.0.2.2 nameserver 10.0.2.3 When the installation of the guest PC was finished, I've copied the image to pc01.img, to keep the original untouched. After that I've started qemu like this: #qemu -L /usr/local/share/qemu -localtime -net nic,macaddr=00:15:f2:44:2d:01 -net socket,mcast=230.0.0.1:1234 -hda pc01.img -cdrom /dev/acd0 & but the network in the guest system does not work. ifconfig in the guest system tells: #ifconfig -a ed0: flags=8843 metric 0 mtu 1500 ether 00:15:f2:44:2d:01 media: Ethernet 10baseT/UTP plip0: ... lo0: ... If I try: #ping 10.0.2.2 (the gateway) all packets are lost. For this reason, I've tryed a static IP configuration like this: IP 10.0.2.4/255.255.255.0 gateway 10.0.2.2 nameserver 10.0.2.3 but the gateway does not respond. So it is useless to try with a second guest system. Please help. Sorry for my bad english. Marco ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"