Chapter 1. Introducing GNS3

GNS3 is a cross-platform graphical network simulator that runs on Windows, OS X, and Linux, and it’s the collaborative effort of some super-talented, industrial-strength nerds—folks such as Christophe Fillot, Jeremy Grossmann, and Julien Duponchelle, just to name a few. Fillot is the creator of the MIPS processor emulation program (Dynamips) that allows you to run Cisco’s router operating system, and Grossmann is the creator of GNS3. He took Dynamips and integrated it, along with other open source software, into an easy-to-use graphical user interface. Duponchelle assists with coding GNS3, and his contributions have helped to advance the software.

GNS3 lets you design and test virtual networks on your PC, including (but not limited to) Cisco IOS, Juniper, MikroTik, Arista, and Vyatta networks, and it’s commonly used by students who need hands-on experience with Cisco IOS routing and switching while studying for the Cisco Certified Network Associate (CCNA) and Cisco Certified Network Professional (CCNP) exams. But that merely scratches the surface of what GNS3 can do. In this chapter, I discuss what GNS3 is, as well as the benefits and limitations of the software.

Why Use GNS3?

Before the wonders of virtualization, network engineers, administrators, and students had to build labs with physical hardware or rent time on a rack. Both options can be expensive and inconvenient, and they limit the network designs available to you. Software simulation programs such as RouterSim and Boson NetSim have been around for a long time, too, but these limited applications merely simulate the commands of Cisco IOS. Cisco Education does offer cheaper virtualized rack rental, based on Cisco IOS on Unix (IOU), but it allows you to practice on only specific precon-figured network configurations. It also requires that you have an active Internet connection to access the labs. Cisco also offers a product named Virtual Internet Routing Lab (VIRL) that’s similar to GNS3, but it requires an annual fee, limits the number of objects you can use in your labs, and uses only simulated Cisco operating systems.

GNS3, on the other hand, allows you to customize your network labs to exactly meet your needs, create unlimited projects using Cisco and non-Cisco technology, add unlimited objects to your projects, and access those projects anytime, regardless of Internet connectivity. GNS3 provides maximum flexibility for your designs through a combination of emulated hardware devices that run real network operating systems such as Cisco IOS, simulated operating systems such as NX-OSv, and the ability to share resources across multiple computers.

Emulated Hardware

GNS3’s graphical interface allows you to create virtualized network labs with a variety of routers, switches, and PCs, but it really shines when it’s paired with Cisco IOS. Unlike similar applications, GNS3 doesn’t merely mimic Cisco IOS commands or features. Instead, it uses a backend hypervisor application to emulate the hardware that runs Cisco IOS. Because only the hardware is emulated, you run an actual IOS image file on your PC. All the configuration commands and output come from a real IOS, and theoretically, any protocols or features that an IOS version supports are available to use in your network designs. This functionality distinguishes GNS3 from programs such as RouterSim, Boson NetSim, or VIRL, which simulate the entire experience and provide only limited environments, commands, and scenarios for you to work with.

Simulated Operating Systems

In addition to emulated hardware, GNS3 integrates simulated operating systems, and they can be fully networked to other GNS3 devices. One such example is Cisco IOU, which I cover in Chapter 9. IOU consists of a series of Linux binary files that emulate the features of IOS images, and it’s fully supported by GNS3.

In addition to Cisco IOS, GNS3 can integrate Quick Emulator (QEMU) and VirtualBox virtual machines running operating systems such as Linux, BSD, or Windows. For example, to practice installing and configuring an Apache web server on Linux, just add a VirtualBox virtual machine (VM) running Linux and Apache to GNS3 and test it by browsing to it from another VirtualBox host. All of this is done within the GNS3 user environment. If you want to throw a firewall in front of your Apache server, you could use a Cisco router, adaptive security appliance (ASA) firewall, or even a Linux-based firewall such as Vyatta.

Scalability with the GNS3 Server

GNS3 leverages client-server technology; much like a web browser connects to a web server to access and display web pages, the GNS3 graphical user interface (GUI) program accesses a GNS3 server, allowing it to start, stop, and otherwise control GNS3 devices. This allows your projects to scale because they’re not restricted to running on a single computer. If you work with large or complex topologies, you can also run the GNS3 server program on a different PC than the GNS3 GUI program. If you have access to a high-end server with a lot of memory and processing power, you can install the GNS3 server program on the server hardware but control all the devices from the GNS3 GUI program running on a more modest PC.

Virtual Connectivity

The true beauty of GNS3 lies in its ability to network your virtual devices together, usually using protocols such as Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6), to create labs that can run on just a single computer. Some of the simplest designs may have only a few components, like the project shown in Figure 1-1.

A GNS3 topology integrating Fedora Linux, Cisco, and Juniper routers

Figure 1-1. A GNS3 topology integrating Fedora Linux, Cisco, and Juniper routers

The project in Figure 1-1 allows a Fedora Linux host to access the live Internet via a switch, a Juniper router, a Cisco router, and finally a GNS3 Cloud node. That’s a simple network, but you can create complex networks made up of a dozen or more routers, switches, and PCs, like the design in Figure 1-2.

A complex, multiprotocol GNS3 topology

Figure 1-2. A complex, multiprotocol GNS3 topology

The project in Figure 1-2 is configured with more than 25 devices, including redundant switch blocks, EtherChannel, L2 Hot Standby Routing Protocol (HSRP), Frame Relay, Enhanced Interior Gateway Routing Protocol (EIGRP), Open Shortest Path First (OSPF), and Border Gateway Protocol (BGP), but the project can be run on a modestly configured PC. To keep your devices straight, you can also annotate your designs with colored, scalable text, as I’ve done in this example. If you have a laptop, you can even take projects on the road to present to clients, solve design issues, or study for certification exams. CCNA or CCNP candidates can also create all the training labs necessary to learn Cisco’s exam material, practice with real operating systems, and study from anywhere.

GNS3 has the ability to bridge virtual interfaces in your lab devices to one or more physical Ethernet interfaces in your PC. This allows you to connect your virtual networks to real hardware such as routers, switches, and other PCs. For example, you can run two or more GNS3 networks using multiple PCs and connect the PCs together using an Ethernet crossover cable or a physical switch. Doing so gives you the capability to connect all GNS3 devices across all the PCs. (I affectionately refer to this as a GNS3 ubernet!)

Open Source Integration

GNS3 performs its magic by leveraging open source technologies, including Dynamips, QEMU, and VirtualBox. It can run Juniper, Arista, and many other network operating systems as easily as Cisco IOS.

The Dynamips Hypervisor

To emulate Cisco hardware, GNS3 comes bundled with Dynamips, a wonderful application created in 2005 by Christophe Fillot of France and kept current by contributions from Flávio J. Saraiva and others. The Dynamips hypervisor program can emulate Cisco 1700, 2600, 3600, 3700, and 7200 series router hardware. Thanks to Dynamips, you can quickly and easily configure these router models with a variety of emulated Cisco network SLOT and WAN interface cards (WICs) in GNS3. Virtual input/output (I/O) cards allow you to add multiple Ethernet interfaces, switch modules, and serial ports to your devices. You can even add or remove memory on a per-device basis, depending on your project requirements and Cisco IOS version.

QEMU and VirtualBox

You can add QEMU and VirtualBox virtual machines to GNS3 and use them in your projects. These devices can be linked to other GNS3 devices to form a complete end-to-end network. For example, you can connect a VirtualBox host to a series of switches and routers and permit it to access resources on another VirtualBox host on that network. In this scenario, you can configure and test all sorts of routing protocols as well as features such as network address translation (NAT), access control lists (ACLs), and virtual private networks (VPNs). Naturally, your physical computer’s hardware places restrictions on your resources, but modern computers have many unused resources just waiting to be tapped by GNS3.

A Few Limitations

GNS3 is not without its limitations. Dynamips has been limited in such a way that you cannot use it in a production environment, making it useful only for education. Additionally, switching is limited to a modest command set, unless you integrate one or more physical Catalyst switches into your GNS3 projects. Fortunately, IOU helps bridge some of this gap.

Some Assembly Required

All great things come at a price, and GNS3 is no exception. Most notably, GNS3 requires one or more Cisco IOS images to run on your virtual Dynamips routers, and GNS3 does not provide them. Images can be copied from a router you own or through a Cisco connection online (CCO) account, if you have a contract with Cisco.

Limited Emulation

Dynamips is unable to emulate the application-specific integrated circuit (ASIC) hardware of Cisco’s advanced Catalyst switches. This is a minor setback for the aspiring CCNA or even CCNP, but it does hamper aspiring Cisco Certified Internetwork Experts (CCIEs) who need the switches’ advanced features. However, the versatility of GNS3 allows you to integrate your GNS3 virtual labs with actual Catalyst switches. This can greatly reduce the cost of creating a CCIE lab, and because most of the lab is virtualized, it allows for greater flexibility in your configurations.

When you don’t need those advanced features, you can add a virtual switch module, like the Cisco NM-16ESW, to one of your virtual Cisco routers to create a simple layer 3 switch. This device should satisfy modest switching needs, including virtual local area networks (VLANs), 802.1Q trunking, spanning-tree, EtherChannel, and multiprotocol routing using EIGRP, OSPF, BGP, and other protocols. Lastly, Cisco IOU images can be used to emulate Cisco switches, and they provide more commands than the Dynamips switch module.

Hamstrung Network Performance

Another GNS3 limitation is network performance. Because Dynamips is an emulator that doesn’t provide any hardware acceleration, throughput is restricted from 1.5Mb to 800Mb per second, depending on which IOS you use and your configuration. This may seem like a limitation, but it’s actually a good thing because it prevents users from virtualizing Cisco hardware and placing it into production environments. Imagine if emulated devices ran at full throughput: every network nerd from here to Timbuktu would install virtual routers on cheap PCs and use them in production networks, effectively stealing Cisco’s intellectual property. If that happened, Cisco would have come down on the Dynamips developers like a proverbial ton of bricks, and GNS3 wouldn’t exist today. This limitation has little to no effect when using GNS3 for education and testing.

Final Thoughts

Now that I’ve hit the highlights of GNS3, I hope you’re as excited as I am to use it on your own computer. Unlike similar applications or tools, GNS3 gives you complete control, leaving you free to use your imagination to create, learn, and develop elaborate networks that meet your needs. Furthermore, you can do it all without the hassle of spending a ton of money on routers and switches only to end up with a room full of noisy, electricity-sucking hardware.

In the next chapter, I’ll show you how to install GNS3. Let’s get started!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset