Using GNS3 and VirtualBox Virtualize Network Test-Labs - Tashi Wangchuk
Using GNS3 and VirtualBox Virtualize Network Test-Labs - Tashi Wangchuk
Downloading GNS3
The GNS3 software can be obtained from the official website of the
GNS3. However, before we get to download, we have to signup if we
don’t have an account or login if we already have an account
created. Follow the link https://www.gns3.com/ and download the
software appropriate for your Operating System.
At the time of this writing, GNS3 Version 2.1.5 (for Windows)
was released, however, it appeared to be behaving in an
unexplainable way and instead Version 2.0.0a3 is used in this
book. You can continue to use the latest GNS3 Version or the
one used in this book as most of the basic features and
functionalities remain similar.
Further Reading
Cisco IOS images for Dynamips. (n.d.). Retrieved April 06, 2018, from
https://docs.gns3.com/1-kBrTplBltp9P3P-AigoMzlDO-ISyL1h3bYpOl5Q8mQ/
GNS3 Labs | CCNP | CCNA Labs. (n.d.). Retrieved April 05, 2018, from
http://commonerrors.blogspot.com/2012/12/gns3-installation-and-configuration-on.html
GNS3 Labs | CCNP | CCNA Labs. (n.d.). Retrieved April 05, 2018, from
http://commonerrors.blogspot.com/2014/10/add-router-ios-in-gns3-10-beta2.html
How to Add Router IOS Image in GNS3. (2016, July 16). Retrieved April 06, 2018, from
https://protechgurus.com/how-to-add-router-ios-image-in-gns3/
Introduction. (n.d.). Retrieved April 05, 2018, from
https://docs.gns3.com/1PvtRW5eAb8RJZ11maEYD9_aLY8kkdhgaMB0wPCz8a38/index.ht
ml
Chapter 2
Install and Configure VirtualBox
The Oracle VM VirtualBox Manager is an open source virtualization
software developed by the Oracle. It allows running a wide range of
guest operating systems including Windows, MAC, Solaris, and
Linux. In this chapter, we will install the Oracle VM VirtualBox
Manager and also learn to install CentOS 7 as the Guest Operating
System.
Display Settings
In the “Display” section, we can leave the settings of all the tabs to
the defaults for the time being.
Storage Settings
Under the “Storage” section, we can customize the settings related
to the storage devices such as HDD, VHD, and CD/DVD. More
importantly, since we are going to install the CentOS 7 as the Guest
Operating System, we have to browse to a location where we have
stored the ISO file of the CentOS 7.
Further Reading
P. (2016, July 27). CCNA. Retrieved from
https://protechgurus.com/category/virtualbox/page/2/
Chapter 1. First steps. (n.d.). Retrieved from https://www.virtualbox.org/manual/ch01.html
Configuring virtual machines. (n.d.). Retrieved from
https://www.virtualbox.org/manual/ch03.html
Creating a New Virtual Machine in VirtualBox. (n.d.). Retrieved from
https://docs.oracle.com/cd/E26217_01/E26796/html/qs-create-vm.html
How to install VirtualBox on Windows 7, 8, and 10? (2018, January 29). Retrieved from
https://www.smarthomebeginner.com/install-virtualbox-on-windows/
Installation details. (n.d.). Retrieved from https://www.virtualbox.org/manual/ch02.html
Installing and Configuring CentOS 7 on Virtualbox. (2017, February 09). Retrieved from
http://resources.infosecinstitute.com/installing-configuring-centos-7-virtualbox/#gref
ProTechGurus. (2016, July 28). How To Install Windows 10 on VirtualBox. Retrieved from
https://protechgurus.com/install-windows-10-virtualbox/
Stegner, B. (2017, October 18). How to Use VirtualBox: User’s Guide. Retrieved from
https://www.makeuseof.com/tag/how-to-use-virtualbox/
Chapter 3
Creating Adaptors and Cloning VMs
Oracle VM VirtualBox Manager has made working with it very easy.
We have to install a particular Guest Operating System on a Virtual
Machine in VirtualBox only once; then it allows to clone the virtual
machine saving our time and efforts. Also, if multiple VMs are to be
used, we can also create virtual adaptors. In this chapter, we will
look into creating VirtualBox Host-only Ethernet Adaptors and the
clones of a VM.
Host-Only Networking
In Host-Only Adaptor the Host machine and the Guest VMs are on a
private network, where the Host can provide DHCP services to the
Guest VMs. In order to configure the Host-Only networking, we have
to create a required number of VirtualBox Host-only Ethernet
Adapter(s). The requirement of the VirtualBox Host-Only Ethernet
Adaptors actually depends on the number of the guest VMs to be
used for the networking.
By default, one VirtualBox Host-Only Ethernet Adaptor is created
when the Oracle VM VirtualBox Manager application is installed. The
VirtualBox Host-Only Ethernet Adaptor will be listed under the “Host-
only Adaptor” as shown in the following figure.
Figure 3.1: Default VirtualBox Host-Only Ethernet Adaptor
If more adaptors are required as per the networking plan,
accordingly we have to create the required numbers. Assuming that
we require seven VirtualBox Host-Only Ethernet Adaptors excluding
the first adaptor, we will go onto the creation of the adaptors.
Creating VirtualBox Host-Only Ethernet
Adaptors
To create the VirtualBox Host-Only Ethernet Adaptors, in the
VirtualBox Manager Window (Figure 3.2), click on the “Global Tools”.
Further Reading
Canepa, G. (n.d.). Cloning, exporting, importing, and removing virtual machines in
VirtualBox. Retrieved from
https://www.systemcodegeeks.com/virtualization/virtualbox/cloning-exporting-importing-
removing-virtual-machines-virtualbox/
Host-only Networking in VirtualBox. (n.d.). Retrieved from
http://condor.depaul.edu/glancast/443class/docs/vbox_host-only_setup.html
Host-only Networking in VirtualBox. (n.d.). Retrieved from
http://condor.depaul.edu/glancast/443class/docs/vbox_host-only_setup.html
ProTechGurus. (2016, July 29). How To Clone Virtual Machine in VirtualBox. Retrieved from
https://protechgurus.com/clone-virtual-machine-virtualbox/
VirtualBox 5: Saving the State of the Machine - GROK Knowledge Base. (n.d.). Retrieved
from https://software.grok.lsu.edu/article.aspx?articleid=13463
Wallen, J. (n.d.). Clone and move virtual machines in VirtualBox. Retrieved from
https://www.techrepublic.com/blog/tr-dojo/clone-and-move-virtual-machines-in-virtualbox/
Chapter 4
Exporting and Importing Appliances
In the situations, where you will have to copy the virtual machine files
from one system to another system, exporting and importing the
virtual machines as a virtual appliance (VA) is a good way. A virtual
appliance is a virtual machine file which consists of a pre-configured
operating system (OS) environment as a single application.
Exporting the virtual machines as appliances is one of the easiest
and most reliable ways to move VMs from one host to another host.
In this section, we will learn to export the virtual machines as a
virtual appliance and import it to another system.
Further Reading
4.7.2 Exporting Virtual Machines to Virtual Appliances. (2017, October 03). Retrieved from
https://docs.oracle.com/cd/E64076_01/E64081/html/vmcon-repositories-assemblies-
export.html
D. (2017, September 13). How to Import/Export OVA Files in VirtualBox. Retrieved from
https://www.maketecheasier.com/import-export-ova-files-in-virtualbox/
Stanisic, S. (2017, January 09). Exporting virtual machine as an appliance in the Oracle
VirtualBox. Retrieved from https://mivilisnet.wordpress.com/2016/04/04/exporting-virtual-
machine-as-an-appliance-in-the-oracle-virtualbox/
VirtualBox 5: Importing and Exporting Virtual Machines - GROK Knowledge Base. (n.d.).
Retrieved from https://software.grok.lsu.edu/article.aspx?articleid=13838
Wallen, J. (n.d.). How to import and export VirtualBox appliances from the command line.
Retrieved from https://www.techrepublic.com/article/how-to-import-and-export-virtualbox-
appliances-from-the-command-line/
Chapter 5
Integrating VMs with GNS3
Till this point, we have created virtual machines and the clones of it
in the Oracle VM VirtualBox Manager for CentOS and Windows 7. In
order for us to be able to use the virtual machines inside the GNS3
virtualized network, we have to link virtual machines existing in the
Oracle VM VirtualBox to the GNS3 so that those VMs would be
available for use in the GNS3 topologies. In this section we will learn
to add the existing VMs to the GNS3.
Adding VMs
Launch the GNS3 application, close the Project dialog box if it
appears as shown in figure 5.1.
Further Reading
Import VirtualBox VM template to GNS3. (2016, January 24). Retrieved from http://www.it-
tutorials.net/import-virtualbox-vm-template-to-gns3/
Install an appliance from the GNS3 Marketplace. (n.d.). Retrieved from
https://docs.gns3.com/1MAdxz0BSEAfGM7tA-w-o3TMmf8XOx7nBf0z6d9nRz_c/
Integrating GNS3 and VirtualBox. (n.d.). Retrieved from
https://digi.ninja/blog/gns_vbox_basic_lab.php
Technical Documentation. (n.d.). Retrieved from
https://docs.cumulusnetworks.com/display/VX/GNS3 and VirtualBox
Using VirtualBox linked clones in the GNS3 network simulator. (2017, January 03).
Retrieved from http://www.brianlinkletter.com/using-virtualbox-linked-clones-in-the-gns3-
network-simulator/
Video - How to Connect GNS3 to VirtualBox in Windows 8. (n.d.). Retrieved from
https://www.interfacett.com/blogs/how-to-connect-your-gns3-environment-to-a-virtual-box-
in-windows-8/
VMs in GNS3: Add VirtualBox servers to your network lab. (2018, March 09). Retrieved
from https://www.ictshore.com/gns3/vms-in-gns3-virtualbox/
Chapter 6
Creating a GNS3 Network Topology
We have looked into the installation and the configuration of the
required applications for building a virtualized network. To continue, it
is presumed that all the required applications are installed and
configuration is being made accordingly by following the previous
chapters. As we go on, you would be getting familiarized with the
toolbars and the interface slowly. To begin with, we will create a
small network as a test bed for learning purpose.
Further Reading
Configuring the GNS3 Topology. (n.d.). Retrieved from
https://www.freeccnaworkbook.com/workbooks/ccna/configuring-the-free-ccna-workbook-
gns3-topology
Connecting GNS3 to Real Networks. (2016, March 14). Retrieved from
http://www.smartpctricks.com/2014/06/connecting-gns3-real-networks.html
GNS3 Graphical User Interface. (n.d.). Retrieved from
https://docs.gns3.com/1NjJlvu176VG4mq7qAl4wDo79P7pmOaiaa-c7kW5htuo/index.html
Network device simulation with GNS3. (n.d.). Retrieved from https://frinx.io/ftpp/network-
device-simulation-with-gns3
Your First GNS3 Topology. (n.d.). Retrieved from
https://docs.gns3.com/1wr2j2jEfX6ihyzpXzC23wQ8ymHzID4K3Hn99-qqshfg/
Chapter 7
Configure and Test Network
Once the creation of the network topology in the GNS3 is completed,
it is time for us to be able to access the nodes and start configuring.
In this chapter, based on the network topology created in the
previous chapter, we will access the nodes and configure, so that the
virtual network becomes functional. Finally, the configured network
created in the GNS3 will be tested for the functionality.
Network Scenario
Before we go onto accessing and configuring the nodes, let us
consider the following network scenario to get a clear picture of the
sample network. In this network, the cloud which is connected to the
ethernet adaptor of the host computer is treated as a connection to
the internet. On the interface 0/1 of the router (R1) the IP address
assigned is 172.168.30.1/24 and the other consideration is, the
Windows 7 device would be assigned the IP address dynamically
from the DHCP service configured on the router (R1), where NAT is
also configured on the same router.
Finally, when the configurations are completed, the Windows 7
device should be able to browse and access the web services
hosted outside of this network.
Figure 7.1: Network scenario
Accessing and Configuring Router
Once the router is being started, to configure it we have access to it.
Unlike the virtual machines, the routers when started doesn’t show
up for access immediately. We can have access to the router’s
console by right-clicking the router and choosing the “Console”
option.
Configuring NAT
The following commands can be used for configuring the NAT on the
router so that the devices which are assigned IP addresses by the
DHCP service configured on the router would be able to make a
request to the computers on the internet.
R1#conf t
R1(config)#access-list 1 permit 172.168.30.0 0.0.0.255
R1(config)#ip nat inside source list 1 interface fastEthernet 0/0 overload
R1(config)#interface fastEthernet 0/1
R1(config-if)#ip nat inside
R1(config-if)#exit
R1(config)#interface fastEthernet 0/0
R1(config-if)#ip nat outside
R1(config-if)#end
R1#wr
Testing the Network
The basic configuration required is completed and the client device
(Windows 7) in the GNS3 network should be able to get the IP
address assigned dynamically and also should be able to browse the
internet.
For the verification, use the ipconfig command in the Windows 7
virtual machine’s command prompt. The details of the IP address
assigned would be shown in the output section of the command
prompt as shown below.