In my earlier posts, I covered How to - Create a Ubuntu VM in Virtualbox, topics related that and Networking for VirtualBox VMs.
In this post, I will provide steps to create the following simple network topology using VirtualBox VMs:
H1 <-----> R1 <-----> R2 <-----> H2
As we need only interconnectivity among the VMs, we can use "Internal Networking" mode as detailed in Networking for VirtualBox VMs. Also, I am going to leave the default NAT mode enabled VM adapters as-is. Instead, I will use the remaining VM adapters to create the above topology.
- Right click VM H1, select "Settings", select "Network" tab, select "Adapter2", check "Enable Network Adapter", choose "Internal Network" in "Attached to". Then provide a name in "Name" field. This name & the name we provide in VM R1's Adapter should match. The VM adapters with matching names will be connected.
- Right click VM R1, select "Settings", select "Network" tab, select "Adapter2", check "Enable Network Adapter", choose "Internal Network" in "Attached to". Then provide a name in "Name" field. This name & the name we provide in VM H1's Adapter should match. The VM adapters with matching names will be connected.
- Now the link "H1 <-----> R1" is established.
- Similarly, I established the other two links: "R1 <-----> R2" & "R2 <-----> H2"
Now, I booted my VMs, configured IP addresses & ran ping tests to check whether work fine. Here, I am providing screenshots of H1 & R1 VM bash terminals:
References: