Setting up GNS3 for Network Simulations
This will be a straight, to-the-point explanation of setting up GNS3 to begin working network simulations.
GNS3 is an opensource, free, network simulation and virtualization suite. It allows users to configure routers, switches, and computers to interact with each other using virtual networks. These virtual systems and networks can be connected to physical hardware, or the tools can be used to practice and educate students on networking skills.
GNS3 can be downloaded from Github at the following link:https://github.com/GNS3/gns3-gui/releases
As seen in the screenshot to the right, the main download is the “All In One” executable. This is the primary installer for GNS3. However, if you scroll further down the page, you will see that you can also download the GNS3 VM. This isn’t necessary for basic networking, but it is required to virtualize systems like "true" switches and some non-Cisco routers. Of course, this also means you'll need to have—or build—a virtual environment. GNS3 is best-supported on VMWare, but you can also use Hyper-V and VirtualBox.
Next, in order to run a virtual router, you need a compatible operating system executable like a Cisco IOS bin file. The IOS for a 7200 series router is the easiest to implement. That file has to be downloaded externally, so work with an authorized tech to get the "c7200-adventerprisek9" file. Keep in mind that Cisco isn't all that's supported, and there are ways to run Linux VMs as routers and switches. Later tutorials will cover the use of OpenSource, non-proprietary learning systems like SDNs with FRR.
Once downloaded, you can click through the installation without changing any of the default settings. The installer will ask to download some additional tools, and it’s best to allow the system to do just that. These tools include WinPcap and WireShark, and they’re required to make sure the system can communicate with the Windows networking stack and allow for packet capturing of your virtual network.
You may see some “errors” if you’re installing GNS3 on a closed network, or on a computer that doesn’t have internet access. If that happens, just cancel out of the dialog and continue the rest of the installation. None of the "undownloadable" notices will affect GNS3's core functionality.
The installer will also offer you the chance to get some SolarWinds tools. Feel free to take them up on the offer; there aren’t any hidden fees, but you will have to offer up an email address. Again, avoiding the offer won't affect GNS3's functionality.
GNS3 is a popular tool, so it’s VM has been built for many different hypervisors. It’s best to use the virtualization environment that you’re most comfortable with, but keep in mind that some hypervisors will not provide the full functionality required for advanced virtualization. ESXi and VMware Workstation are the best-supported, and will give the GNS3 VM access to the underlying hardware.
As an additional note, keep in mind that not all CPUs will support full virtualization for the GNS3 VM. Some processors do not support the threading and/or hardware access that will enable advanced virtualization features. If the VM “complains” about a lack of virtualization access, check your BIOS/UEFI to make sure that virtualization is enabled.
After GNS3 is installed, you will also have to install your chosen hypervisor. For tools like VMware WorkStation, or VirtualBox, you can just click the “File” menu and import the VM software you downloaded. For Hyper-V, make sure to run the PowerShell script to generate your VM. With ESXi, you’ll have to connect to the vSphere Client or web client to import the OVA. Once it’s installed, power it on and you’ll be greeted with an image similar to what you see on the right. Take note of this IP, as sometimes it’s required to connect from the GNS3 GUI depending on the hypervisor environment that's in use.
When it’s first started, GNS3 will ask you a few questions about how it will be used. As seen right, select to “Run only legacy IOS on my computer.” You can change it later, but this is all that’s needed to run the 7200 IOS image. This would change if you already went through setting up your hypervisor and the GNS3 VM, but this guide won't go into that.
When you get to the server path settings to the left, make sure to put in the localhost IP of 127.0.0.1 for the host binding. Otherwise, it might auto-select an interface that has a changing IP. This will prevent errors if your IP changes. Alternatively, this would be where you'd use the IP address of the GNS3 VM if that was already installed.
After a few seconds, the server should connect and GNS3 will continue to the initial IOS settings. The program will ask you to create a “New appliance template.” This is where the 7200 IOS image can be imported. Select “Add an IOS router using a real IOS…” and then click OK. GNS3 will open a file browser, so navigate to the 7200 bin file and load it into the program. It will ask if you want to decompress and select “Yes.”
As you install a device operating system, it will ask you to select the network adapters for that device. This allows you to add extra interfaces onto the router’s default startup. Select the GE interface for each slot. That way, if you're loading a 7200 router, it would already have six GigabitEthernet interfaces to play with.
Setting the Idle-PC value is the last thing to do for an IOS installation. This makes sure that the virtual router won’t bog down your computer by using too much processing power. Click the button that says “Idle-PC finder” and it’ll pop up with the “Please wait” window as seen to the left. Give it time to find a proper value. If it fails, try again. Sometimes, the computer needs to be restarted before an Idle-PC value is found.
Once GNS3 finds the Idle-PC value, the IOS installation is complete. Now, just click on the router icon as circled to the right. Then, drag and drop the c7200 router image onto the GNS3 map. To power it on, just right-click on the device and select “Start”.
1: Click on the router icon to browse your installed router systems. Drag and drop the icon of your preferred device onto the GNS3 map. Do this until you have at least R1 and R2.
2: Before we start up the systems, make any changes to the device names or configurations as needed. You must power the device off to correctly set names, RAM usage, and available interfaces. In this case, we don't have to make changes, but just keep that in mind for future networks. Right-click on each router and click the “Start” menu option. Wait for the router icon to show green in the right-side Topology Summary.
3: Click the connection icon as shown above. Then click on each device that you want to connect. This will show a sub-menu of interfaces, so select one to continue, and then go click on the device that needs the opposite end of that connection. We can just think of this part like plugging in a CAT5 cable between the two systems. If you forget which port you plug in, don't worry, just hover the mouse over the line to see what's connected where.
4: Once both routers are powered on, and after connecting them with the connection tool, double-click on a router to open a PuTTY session to that device. At this point, we can start using these terminals just as if we were configuring any physical network device. Note that PuTTY is the default program bundled with GNS3, but you can always change the default if you'd want to. Also, notice on the diagram that the ports are showing "green" as soon as you connect a "wire". However, on most Cisco routers in-particular, the port is still starting as admin down.
5: And that's it! At this point, it's time to start configuring everything else, but obviously that'll depend on the purpose of each lab. For now, we'll leave off this tutorial here. Thanks for checking in!