We were discussing about physical networking with GNS3. GNS3 is the wonderful software for virtual networking computing. Last article, we had a discussion on virtual LAN network by interfacing GNS3 to local PC via Microsoft Loopback adapter. In this tutorial I would like to share how to configure GNS3 to connect VirtualBox virtual machines. As we know GNS3, the best virtual network software, supports oracle VirtualBox, hence it is easy to work around VirtualBox virtual machines (VMs) as comparing to vmWare VMs. Even though we could Interface GNS3 to vmWare with some tweaks that I will cover later. By interfacing GNS3 to connect VirtualBox you may realize the real network scenarios as a practical feel.
Now, let’s see the steps for connect GNS3 to VirtualBox Virtual Machines.
Before you Begin
Please make sure that you have the knowledge of the following and have equipped with specified tools and hardware.
- Basic understanding of GNS3 virtual network simulator (Check out some of my previous GNS3 articles)
- Installing and configuring Oracle VirtualBox virtual machine. (https://www.virtualbox.org/manual/ch01.html)
- Graphical Network Simulator GNS3: GNS3 is free Network Simulator that is available to download from the link (http://www.gns3.net/download/)
- Cisco IOS: GNS3 works with real Cisco Internet Operating System, you need to have a Cisco IOS for setting up virtual network labs. Distributing Cisco IOS is illegal so I could not support you for that, just Google it.
- Oracle VM VirtualBox: There are many Virtualization software are available, but Oracle VirtualBox is FREE and GNS3 supports it directly! Download Oracle VirtualBox
- Intel Core i3 Windows 7 PC
- 8GB RAM
I recommend these hardware configurations to learn virtual networking concepts because virtual machine networking requires at least 2 VMs to be up and run. Anyway you may also proceed even with 4GB RAM.
No you are ready to go….!
How to Connect Gns3 to VirtualBox VMs
VMs acts as virtual network client for GNS3 network topology.The step by step procedure to connect GNS3 to VirtualBox as follows.
Step 1: Setting up of VMs
Make sure you installed VirtualBox VMs, for me I have 4 VMs installed. Among these I will connect Win7_1 and Win7_2 to GNS3.
Run GNS3, Edit → Preferences → VirtualBox
In the General Settings tab click ‘Test Settings’ button, you will see a message ‘VBoxwrapper and VirtualBox API have successfully started’.
Select ‘VirtualBox Guest’ tab, you may find all VMs in the VM List. Select suitable one after setting an Identifier Name. Set required VMs and the click Save button.
Browse VirtualBox guest to the work space.
If you have more than one VM, you will be asked to select one among those.
Step 5: GNS3 Network scenario with VirtualBox
Build a simple scenario with VirtualBox guest. For me, I done with two VMs and one router.
Step 6: Run Simulation
Now let’s run our Network. Before running the simulation open VirtualBox side by side with GNS3. [Only open VirtualBox, do not run any VMs]. Then click Start button to begin simulation.
After starting the simulation the we can see all of the VMs that you added in the example scenario will run automatically.
Step 7: Set Static IP for VMs
Once the VMs are started change the IP of virtual machines. In my example I assigned 10.0.0.2/8 and 18.104.22.168/8 to the VMs
Step 8: Cisco Router Configuration for VirtualBox Interface.
Now configure the router and assign IP address to each port. Configuration commands are followed.
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#interface fastEthernet 0/0
R1(config-if)#ip address 10.0.0.1 255.0.0.0
*Jun 17 14:15:11.947: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Jun 17 14:15:12.947: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1(config)#interface fastEthernet 0/1
R1(config-if)#ip address 22.214.171.124 255.0.0.0
*Jun 17 14:15:30.303: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
*Jun 17 14:15:30.739: %SYS-5-CONFIG_I: Configured from console by console
*Jun 17 14:15:31.303: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
R1#copy running-config startup-config
Destination filename [startup-config]?
Warning: Attempting to overwrite an NVRAM configuration previously written
by a different version of the system image.
Overwrite the previous NVRAM configuration?[confirm]
Step 9: Ping test and verification
Try to ping from the router to the VMs and vice versa.
Troubleshooting: Unable to ping from VirtualBox to Router
Sometimes you can’t ping between VirtualBox VM and router. This is because your firewall blocking ICMP traffic. To get rid of from the issue disable firewall in the VirtualBox VMs or allow the networks 10.0.0./8 and 126.96.36.199/8. Actually disabling firewall is not a proper way, but times being do it. I will be sharing detailed troubleshooting guide for Windows firewall and other third party antivirus firewall.
Keep visiting SPT for more computer networking tutorials and how to guides. Don’t forget to like our Facebook page.