0

I am creating a lab to test the Kubernetes. My guest OS is Windows 10 and using VirtualBox 6 to create the lab. I have created three Ubuntu 16.04 VMs to install Kubernetes master and workers. I need the following communication. Just wondering how to establish it. I have tried NAT networking, host-only adapter and bridged network adapter; these options doesn't satisfy my requirement.

Requirements:

  1. Guest VM to VM communication (Guest VMs should be able to use static IP).
  2. Host to Guest VM communication.
  3. Internet connection from Guest VMs.

Any help for this setup?

2 Answers 2

0

Network connectivity to your VM - assuming of course that it has a properly configured service to connect to - depends on what network type you've chosen in the VM settings.

1) NAT - this does what it says. Unfortunately, it doesn't create a matching address on your host machine. The only way to connect is to forward individual ports, just like you would on your home router. This is done in the manager interface, in the settings for the machine, on the networks tab. If you have "NAT" selected as the network type and the card is active/enabled, the Port Forwarding button will be active and available.

1b) "NAT network" - Like above, but you have to configure a NAT network first. You'll be able to pick subnet, if there is DHCP, etc. If you have multiple VMs on a "NAT network" they can communicate between themselves. You can create multiple "NAT network" names and subnets, they do not see each other unless you go out of your way to set that up.

2) Bridged - this bridges across one of your ethernet devices in the host machine, and connects directly to the network as if it were plugged in to a jack somewhere. HOWEVER... some work places, schools, etc. do not allow multiple MAC addresses to communicate through a single managed switch port, and if that is the case on whatever LAN you are connecting to it Won't Work.

3) Host Only - this creates a virtual network between your host machine and the guest(s). There is a dhcp service available, but it won't provide a gateway. If you want your guests to connect, you'll need to set up NAT/etc on the host machine and provide access that way.

4) Internal only - this connects machines to a virtual internal dumb switch. No DHCP service, no gateway access, nothing. Oh, and no matching adapter on your host machine.

What I do for a lot of practice/playground/experimentation is set up one machine with 2 interfaces - one on bridged, and one internal. I then turn that into a router machine, with a fake domain (fake.tld) DNS service, DHCP, caching DNS service for the world, etc. and then spin up other VMS to actually experiment and do things with on the internal only network

1
  • bridged network did the job. I was using static IP for the guest VMs. Had to adjust the static IP according to the IP address of host machine. Commented Jun 11, 2019 at 9:10
0

Bridged networking should do the job, unless your host computer is attached to a switch that's doing some kind of MAC filtering, or if you're limited on the number of IP addresses you're allotted. With bridged networking, each guest gets put on the exact same subnet as your host. Therefore, you can treat your guests just like they are each a separate, physical machine on the same LAN as your host.

1
  • Bridged network helped achieving my requirement. I had to adjust the static IP configured for guest VMs based on the IP address of host machine. Commented Jun 11, 2019 at 9:12

You must log in to answer this question.

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