netplan. After that, cloning 2 more virtual machines and adjust the ip addresses in the network configuration.
Create a virtual machine and configure its network
Create new virtual machine and attach bridge network adapter to Adapter 1 and Adapter 2. Let's put the name for the machine as
- Find out what are the name of the network interfaces using command
- Then modify the file with content similar to below. Copy the content below to
/etc/netplan/00-installer-config.yaml, then modify the ethernet interfaces to match with your virtual machine's interfaces. After that, run
netplan applyfor the new configuration to take effect.
network: ethernets: enp0s3: dhcp4: false dhcp6: false enp0s8: dhcp4: false dhcp6: false bridges: br0: interfaces: [enp0s3] addresses: [192.168.1.100/24] gateway4: 192.168.1.1 mtu: 1500 nameservers: addresses: [22.214.171.124, 126.96.36.199] parameters: stp: true forward-delay: 4 dhcp4: no dhcp6: no br1: interfaces: [enp0s8] addresses: [10.0.0.100/24] gateway4: 10.0.0.1 mtu: 1500 nameservers: addresses: [10.0.0.1] parameters: stp: true forward-delay: 4 dhcp4: no dhcp6: no version: 2
In this set up, the first interface is in the same network with the host machine and can communicate with the internet (public network). The second network is for communicating among the virtual machines only (private network).
Clone more machines and adjust the ip addresses
Now clone the
red macine into
green machine. Then change the addresses from
10.0.0.102. After all, you can
ping between virtual machines using either address and
ping to address on the internet from the virtual machines. The below pictures show the steps to clone a machine.
Now, I hope that you enjoy this little data center and can have fun experiment installing tools such as Kubernetes or Apache Spark cluster