The better part of a year ago when the Cisco CSR1000V was publicly released, I quickly tested the notion of running the Cloud Services Router in VMWare Fusion on the Mac, rather than on a full vSphere server. Since then, I occasionally see that some readers land on my blog after searching for the terms “CSR1000V GNS3” looking for assistance in integrating the CSR with the popular networking simulation platform. The CSR1000V is attractive as it provides a means to run IOS-XE, the same variant as on the ASR-series routers, and unlike Dynamips, Cisco has blessed use of the CSR with the 2.5 Mb/s throughput-limited trial license as a legitimate labbing platform. Last night I decided to see if it could be done. Turns out, it’s easy.
Download the Image
The key to running the CSR1000V in GNS3 is running it in VirtualBox. Well, OK, perhaps it’s possible to get it going with QEMU as I also noticed in the release notes for the 3.11 release that Linux KVM is a supported hypervisor now, but VirtualBox seemed the path of lesser resistance to me so that’s the way I went. In order to install the CSR in a non-VMWare environment, you need to download the ISO install image rather than the OVA. I simply went to Cisco’s site, logged in (even a guest-level account should be able to access this download) and found the current version of the CSR (3.11 as of this writing) in the downloads section. Make sure you pick the ISO.
Save the ISO locally, and you’re ready to build a router.
Build the CSR in VirtualBox
I expected installing the CSR to a VirtualBox VM to be a serious pain. It turns out with the current version, it’s really quite trivial. In some cursory investigation, I found this blog article which suggests that the CSR’s flexibility only came around in the 3.10 release. I didn’t go back and try this with the 3.9 release to see, so that may well be true. Anyway, if you haven’t already, install Oracle VirtualBox. I should note that I did all this on a Windows machine as I feel that is actually the best platform for GNS3 these days — or at least it’s the one that in my experience requires the least fiddling to get all the extra bits working. I’m sure this can be done on Mac OS X or Linux but I’ve always had trouble getting GNS3 and VirtualBox both working nicely with each other on any platform besides Windows. YMMV. The VM settings for the CSR are very straight-forward:
OS: Other Linux (64-bit)
RAM: 2560-4096 MB (as of 3.10, a minimum of 2.5 GB is supported for basic operation)
Hard Disk: 8GB IDE
Important: Serial Ports: Enable Serial port 1, but you can leave it in Disconnected port state for now.
Just about everything else can be left to defaults. In the screenshot below you’ll see that I added additional NICs, but this wasn’t necessary. GNS3 will handle this for us later.
Set the CD-ROM to use the install ISO image, and boot the VM. During the first boot, the CSR will install itself to the hard drive:
After the install is complete, it will reboot itself. If you wait for it to reboot you will eventually get to the familiar IOS boot messages and a “Router>” prompt. You can power down the VM at this point, and remove the ISO from the CD configuration of the VM. Note that if you want multiple CSRs in your lab, you will need to create multiple VMs. You could either create them individually, or use the “Clone” function within VirtualBox. If you clone them, just make sure to select the option to generate new MAC addresses for the interfaces. Cloning the CSR through VirtualBox does correctly result in the clone router generating a new UDI/serial number on its next boot. Make no mistake that even with the somewhat reduced RAM requirement for the CSR with version 3.10 and later, running more than a couple of these will require a pretty beefy machine. My Windows laptop has 8 GB of RAM, and I can basically run two CSRs with 3 GB of RAM allocated before I’m maxing out my host’s RAM.
Adding the serial port (even without connecting it) was important here as I discovered that without the serial port, the GRUB boot loader hangs at a “press any key to continue” prompt pretty much indefinitely. It appears to be a bug related to serial console setups, and I found that by just making sure the VM actually has a serial port present, the “press any key” prompts appear 10 times over 10 seconds and then the normal GRUB boot menu appears and auto-boots within another second or two.
Add the CSR to GNS3
Now we’re getting somewhere. Once you have a CSR (or several) built in VirtualBox, fire up GNS3. Go to Edit > Preferences:
In the preferences dialog box, go to the VirtualBox section. In the “General Settings” tab, hit the “Test Settings” button to ensure the GNS3 vboxwrapper program has found your VirtualBox implementation. When it’s happy, click over to the “VirtualBox Guest” tab. Here, you can start defining one of your CSR instances, but it won’t appear in the dropdown until you click the “Refresh VM List” button:
Then, your CSR will appear in the “VM List” dropdown and you can select it:
Tweak a few more settings, like giving it several interfaces. Uncheck the “Reserve first NIC for NAT to Host OS.” Also, make sure “Enable Console Support” is selected, or else you’ll run into the GRUB issue I described in the previous section. Also, we want it for serial console access:
When you click the “Save” button here, your CSR VM will show up in the list of available VirtualBox VMs. Now, you can OK your way out and proceed to build your topology. When you drag the VirtualBox Guest object onto the GNS3 workspace, it will prompt you to pick which VM you are deploying. Select one of your CSR instances:
The CSR will appear as a “computer” icon in GNS3, but you can always right-click on the object and change the symbol to something that looks like a router. Then you can add your connections like normal. I always choose “Manual” connections in GNS3 because otherwise it tends to pick strange port pairs.
Now you can click the “Play” button to launch your simulation. My CSR was hooked up to a normal 7200 Dynamips image in this case. After they both booted, I started to configure. In order to get useful console access to the CSR and not be stuck configuring it from a no-history, fixed-width VM console window, we want to redirect the console to serial. This procedure is unique to the CSR1000V since in its intended deployment of cloud data centers, you may not have means to access a virtual serial port and may prefer to work from the VM console or a management interface in a dedicated VRF. To redirect the console output, we enter the following:
conf t platform console serial end write reload
This is entered within the VirtualBox VM console:
When the router reboots, you’ll see only OS-level stuff like the GRUB bootloader and some services startup messages on the VM console window. However, now you can right-click on the object in the GNS3 window and select “Console” which will open the serial console using a named pipe and it will act just like normal console sessions into Dynamips routers.
After some basic addressing, and remembering that the CSR has CDP disabled by default (and thus needs the global “cdp run” and the interface-level “cdp enable”, I got CDP connectivity. I threw on a basic OSPF configuration just to prove that link-local multicast and OSPF adjacency worked, and indeed, it did:
And there we have it. Running the CSR1000V in GNS3, successfully connecting with Dynamips emulated routers as well. Happy labbing!