Page 1 of 1

[Solved] Network between two or more VMs

Posted: 23. Sep 2009, 20:32
by moritzzz
I'd like to create a network between some virtual machines I'm running on the same computer. In fact I have a Linux host system (Debian) and downloaded the newest Version of vbox directly from the vbox Repository. On this Debian I'd like to have a bunch of different virtual machines running and connect them through an "internal software network". My first tries weren't successful and I have no clue how to establish such a network with vbox. As some of the machines are supposed to work like routers or NAT-boxes it's no option to just bridge the virtual devices as some machines must have more than one device and there's just one in the real machine.
Can anybody please tell me how I can setup this kind of network?

Re: Network between two or more VMs

Posted: 23. Sep 2009, 21:47
by vbox4me2
Easy, create an internal network and attach all VM's to it, create a router/dhcp VM or let one of the VM's do dhcp, or set fixed addresses.

Re: Network between two or more VMs

Posted: 23. Sep 2009, 21:56
by moritzzz
Mmm I need different subnets. Sthg like this:

(vm1<->(router)<->vm2)

So vm1 and the router are in one subnet and vm2 and the router in another one.

Setting up a dhcp for that would suck a bit. If I use different internal networks (just give them different names in the gui??), can I just set fixed ips on the virtual machines for it to work too?

Re: Network between two or more VMs

Posted: 23. Sep 2009, 22:10
by vbox4me2
It depends what you want, an internal network is isolated by itself (named), by adding a second lan adapter to the VM you can add internet access, for example I've made a VM router that sits between a Bridge and an internal networked VM's cluster in much the same way by using 2 vm adapters on the vm router. The outside lan uses 192.168.200.x and the internal lan 10.20.122.x, neither can see or reach each other but both can access the internet independantly, this vm router is also double firewalled and another nicety is that each 10.x VM can still be accessed by vRDP.

Re: Network between two or more VMs

Posted: 23. Sep 2009, 22:27
by moritzzz
No I need those two networks to be able to reach each other. We're working on some NAT stuff and need to emulate a network like this:

vm1 10.0.0.2 <-> 10.0.0.1 router 10.1.0.1 <-> 10.1.0.2 vm2

So vm1 and 2 have to be able to communicate.

Re: Network between two or more VMs

Posted: 23. Sep 2009, 23:22
by vbox4me2
Same thing, configure the router with proper routing tables.

Re: Network between two or more VMs

Posted: 24. Sep 2009, 00:15
by moritzzz
Okay it worked out with two different internal networks. Thanks for help :)