0

I have 3 virtual machines on Virtualbox connected to three different host-only networks in one Host, and 3 virtual machines on Virtualbox on another host with same configuration host-only networks. How can I connect two hosts host only networks such that all VMs should communicate?

1 Answer 1

0

While there may be ways to do that with firewall NAT rules, I don't understand why you're blocking outside connections and want them at the same time.

You should probably either bridge or NAT them all and if you're worried about external access, make appropriate firewall rules to prevent it. Note that those rules might be easier to implement on a bridge although both setups are possible.

5
  • Hi @Julie Pelletier thanks for ur answer. Can I bridge 3 VMS to one Ethernet Port? Is that allowed?
    – Harsha
    Jun 8, 2016 at 5:37
  • Of course you can. Bridging on VirtualBox will actually get all the VMs to become part of your whole LAN, using your router as the gateway. Jun 8, 2016 at 6:26
  • @Jullie Pelletier if I bridge all the three VMs to one ethernet Port, Can I get different IPs for all the three and what about the Mac addresses ? I guess firewall rules is the best one. If my interface is eth0 and host-only adapter is vboxnet0. I should add rules such that packets from Vboxnet0 should go to eth0 and viceversa. Can you help me in writing such rule in IPtables
    – Harsha
    Jun 8, 2016 at 6:39
  • Why not bridge it? They'll all be able to talk to each other and as with your other machines, they'll still be behind your router hiding them from the Internet unless they directly access it. Jun 8, 2016 at 6:47
  • @Jullie Pelletier I tried bridging but cannot ping between the guests in different hosts. In one host i assigned an ip address to eth0 (10.10.10.8) and bridged the port to instance and assigned IP address to eth0 on instance (10.10.10.9). In another host I assigned assigned an ip address to eth0 (10.10.10.10) and bridged the port to instance and assigned IP address to eth0 on instance (10.10.10.11). Now i cannot ping two guests. i.e .11 to .9. i have disabled firewall and enabled ip forwarding in sysctl.conf. Am i missing anything. is this correct way to do?
    – Harsha
    Jun 8, 2016 at 10:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .