[DevOps] Networking between virtual machine

--

This year, I am in a DevOps role in my working company. In the Kubernetes that I am learning, I need to create and connect a variety of virtual machines but both tech stacks (Oracle Virtualbox and Kubernetes) are newer to me. I have researched a lot of articles and I found an article that taught me how to communicate between 2 or more VMs (virtual machines)

Create NAT Networks

More information about VM networks

All of about VM networks

Attach Cloud NAT to VM

After creating the NAT Network, we process attach into the VMs then all VMs using the same network. In this case the IPs range is 10.0.2.0/24

Forward 22 port (SSH port) between Guest and VM. Allow remote via SSH Guest into VM. This means when we connect to localhost:22 in the Guest machine and the system auto-forwards this into the VM host with port 22.

Check connection

Manual login using user and password with Oracle Virtualbox interface and check IPv4 each VMs with command

ip a | grep 10.

Check IP V4 of Base Host

IPv4 of other VM in this NAT network

From the Base host try to connect to other VMs in the NAT network
In this case, we trying to connect from 10.0.2.4 to 10.0.2.5 with the command

telnet 10.0.2.5 22

Perfect, that working fine. Next, we need to set up SSH for the remote without the password with this instruction. I think the instruction from Digital Ocean is fully and very detail

Setup SSH

Test SSH

SSH has been worked and the article will be ending. Thanks for reading my article and do not forget to follow me. Checkout my Github repo

Articles that you may interest

Setup Linux server & Visual Code for development (Comming soon)

Disclaimer

All knowledgable in my article is my research result, which may be incorrect. If any knowledge was incorrect, please contact me via EMAIL. Do not forget to follow me and check out my GitHub repo

Hao Hoang — Python Developer / DevOps / Open Source Enthusiast

https://github.com/hdsme
https://www.linkedin.com/in/hdsme

If you like this article, please show your support by clicking the clap button below and follow for more. Thank you! ❤️

--

--

Hao Hoang - Open Source Enthusiast

I’m a Vietnamese guy who has a curious mind. I’d like to learn something new every day and become a data scientist. https://www.linkedin.com/in/hdsme