Network device simulation with GNS3

This guide shows how to setup and run GNS3 simulation with IOS devices.
It also makes the devices available in an internal network for possible ODL testing.
All running locally with just approx. 4 GB of RAM.

This guide is aimed at WINDOWS + VIRTUAL BOX. Virtualbox does not support nested virtualisation so there might be warnings from GNS3 that the devices will be slow. However for basic configuration it is sufficient.

SETUP

Prerequisites:

Virtualbox installed

Installing GNS

Background

Download GNS3VM

Import the VM into Virtualbox
Set the RAM to 4GB and CPU to 2 cores
There should be 2 network ports preconfigured, add a 3rd one (Host only connection)
Start the VM
Just check whether it starts
Stop the VM

Download the GNS3 APP

Install it + ALL THE SUGGESTED TOOLS
If asked, pick the option for using GNS3 VM
Start the APP and point to your VM

IOS images can be downloaded from Cisco and many other sources on the Internet.

In the GNS3APP import IOS router FOR GNS 3 VM: https://protechgurus.com/how-to-add-router-ios-image-in-gns3/

Running simulated devices

Starting IOS device

Drag and Drop the IOS device in the app
Right click and start
Right click and open CLI to check if its all ok

Connecting to Virtualbox network

The desired network setup:

alt text

Go into the GNS3VM’s shell
Create a bridge: sudo ip link add name fw type bridge
Start the bridge: sudo ip link set fw up
Create a tap interface for each IOS: sudo tunctl
Turn the tap interface on: sudo ip link set tap0 up
Add the tap interface to bridge: sudo ip link set tap0 master fw
Turn on VM’s host only network NIC: sudo ifconfig eth2 up
Flush IP address from VM’s host only network NIC: sudo ip add flush eth
Add that NIC into bridge: sudo ip link set eth2 master fw

Connecting IOS device to tap interface

In GNS3 drop a cloud into the simulation

  • The cloud needs to represent GNS3 VM
  • In the configuration of the cloud add all the tap interfaces

Drag a link between the cloud and IOS device

  • Cloud end needs to be anchored to the tap interface
  • IOS end needs to be anchored to one of IOS interfaces

The result should look like this:

GNS3 project file can be accessed here

POSTMAN can be accessed here

Configure IOS interface

Open IOS shell from GNS
Configure ( This is assuming host-only network is 192168.56.0/24 ):

Now you should be able to ping your DEV VM from within IOS:

Mounting simulated IOS with ODL in DEV VM

Now you can proceed with mounting both of the devices in ODL, using CLI’s POSTMAN collection. But before that, both devices need to enable remote management.

Configure Telnet on IOS

Configure SSH on IOS

Running an IOS XR image on GNS

Chose an IOS XR ova image from here

convert it to qcow2 format.

import the IOS XR image as a Qemu VM in GNS3.

Add more NICs