[Solved] Network between two or more VMs

This is for discussing general topics about how to use VirtualBox.
Post Reply
moritzzz
Posts: 12
Joined: 23. Sep 2009, 20:16
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Linux, Windows
Contact:

[Solved] Network between two or more VMs

Post 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?
Confidence is what you have before you understand the problem. - Woody Allen
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: Network between two or more VMs

Post 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.
moritzzz
Posts: 12
Joined: 23. Sep 2009, 20:16
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Linux, Windows
Contact:

Re: Network between two or more VMs

Post 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?
Confidence is what you have before you understand the problem. - Woody Allen
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: Network between two or more VMs

Post 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.
moritzzz
Posts: 12
Joined: 23. Sep 2009, 20:16
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Linux, Windows
Contact:

Re: Network between two or more VMs

Post 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.
Confidence is what you have before you understand the problem. - Woody Allen
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: Network between two or more VMs

Post by vbox4me2 »

Same thing, configure the router with proper routing tables.
moritzzz
Posts: 12
Joined: 23. Sep 2009, 20:16
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Linux, Windows
Contact:

Re: Network between two or more VMs

Post by moritzzz »

Okay it worked out with two different internal networks. Thanks for help :)
Confidence is what you have before you understand the problem. - Woody Allen
Post Reply