You are on page 1of 23

Dynamips & GNS3

Tutorial

Daniel Pea
Channel SE Cisco Chile
Daniel.pena@cisco.com

Cisco Confidential

Copyright 2009 Cisco Systems, Inc. All rights reserved.

Agenda
Introduction: What are Dynamips and GNS3?
Part I: Getting Started with Dynamips/GNS3

Part II: IOS Images & Console Access


Part III: Creating a Basic Lab Environment
Part IV: Including Virtual PCs on the Topology
Part V: Managing Virtual Routers with CCP 2.1
Part VI: Linking GNS3 with your NIC
Part VII: Creating a FR/ATM Lab Environment

Cisco Confidential

Copyright 2009 Cisco Systems, Inc. All rights reserved.

Introduction: What is Dynamips?


Its a free and legal Cisco HW Router emulator software (not
a router simulator) developed by Christophe Fillot.
Its an IOS virtualization software - Similar to Virtual PC and
VMWare which is virtualization software for Windows/Linux.
Allows booting actual IOS images - Supports all features
native to IOS.
Originally emulated only Cisco 7200 router - Now can also
emulate 1700, 2600, 3600, 3700.
Runs on Windows XP/2000/Vista, Linux X86/64 - Runs on
Intel and AMD

Cisco Confidential

Copyright 2009 Cisco Systems, Inc. All rights reserved.

Introduction: What is Dynagen?


Its a text-based front-end for DYNAMIPS, written in
PYTHON and developed by Greg Anuzelli.
DYNAGEN has a simple CLI interface to start, stop routers
and uses MAP files (.NET extension files) to create network
topologies.

Includes virtual Ethernet switches, virtual Frame-Relay


switches and virtual ATM switches and Bridges.
Today, DYNAGEN also includes QEMU for PIX/ASA/IDS
and Juniper router emulation.
DYNAGEN requires WINPCAP 4.0 (Windows) or LIBCAP
(Linux).
Can tie virtual router interfaces to PCs NIC.
Cisco Confidential

Copyright 2009 Cisco Systems, Inc. All rights reserved.

Introduction: What is Dynagen?

autostart = False
[localhost:7200]
workingdir = C:\DOCUME~1\danpena\LOCALS~1\Temp
udp = 10000

Hypervisor #1

[[7200]]
image = C:\Program Files\GNS3\C7200-IK.BIN
idlepc = 0x608ab510
ghostios = True
[[FRSW FR2]]
2:103 = 3:102
Frame Relay
2:104 = 4:102
3:104 = 4:103
[[ROUTER R3]]
console = 2003
slot1 = PA-A1
a1/0 = ATM1 3
slot2 = PA-4T+
s2/0 = FR2 3

Router Template
Parameters

Router R3 Parameters

Switch

[localhost:7201]
workingdir = C:\DOCUME~1\danpena\LOCALS~1\Temp
udp = 10100

Hypervisor #2
Router Template
Parameters

Router R4 Parameters

[[7200]]
image = C:\Program Files\GNS3\C7200-IK.BIN
idlepc = 0x608ab510
ghostios = True
[[ROUTER R4]]
console = 2004
slot1 = PA-A1
a1/0 = ATM1 4
slot3 = PA-4T+
s3/0 = FR2 4
[[ATMSW ATM1]]
3:104 = 4:103
4:103 = 3:104

Cisco Confidential

(contd)

Copyright 2009 Cisco Systems, Inc. All rights reserved.

ATM Switch
5

Introduction: What is GNS3


GNS3 is a graphical front end for Dynagen, which is a text front
end that runs on top of Dynamips.

GNS3 provides

a graphical drag & drop, windows-like


environment that eases the work of network topology creation.

GNS3 is an open source, free program however, due to licensing


restrictions, you have to provide your own Cisco IOS.

GNS3 will provide around 1,000 packets


per second throughput in a virtual
environment compared to a normal router
which will provide hundreds or thousands
times greater throughput.

GNS3 installer contains all what is


needed: Dynamips, Dynagen, WinPcaP,
Qemu/Pemu and GNS3 GUI.

GNS3

was developed
Jeremy Grossmann.

Cisco Confidential

primarily

Copyright 2009 Cisco Systems, Inc. All rights reserved.

by
6

Introduction: Dynamips Caveats


Doesnt emulate Catalyst switches
There are three solutions:
DYNAGEN has built-in basic virtual Ethernet switch. It
is not configurable. It supports VLANs, dot1Q tagging,
and learning of MAC addresses.
Connect virtual router interface to the PCs physical
NIC, then connect PC NIC to the real Cisco Catalyst
switch.
Use NM-16ESW on Cisco 2600/3600/3700.

Cisco Confidential

Copyright 2009 Cisco Systems, Inc. All rights reserved.

Introduction: System Requirements


Windows XP/VISTA or Linux:
With Windows you wont run as many routers as on Linux and performance on XP is better
than on Vista.
Dynamips on Windows is unstable, it can easily crash after running for a few hours.
Tested on Linux RedHat, Linux Fedora Core, Linux Ubuntu Desktop, Linux Ubuntu Server
edition.
Best performance found on Linux Ubuntu Server edition.
Windows XP (Laptop)
Intel Core 2 Duo and 1 GB of RAM
5-6 routers
Low cost remote (PC)
PC with Intel Core 2 Duo and 2 GB of RAM
15 routers
Extreme (Server)
Server with dual 4-core Intel Xeon 3.0 GHZ (combined 24 Ghz)
16 GB of RAM
170 routers
Utilization: 16GB of RAM and CPU 24% with base IOS config

Cisco Confidential

Copyright 2009 Cisco Systems, Inc. All rights reserved.

Introduction: Performance Tips (1 of 4)


Performance depends mainly on four things:

RAM and CPU horse power of your PC.


How much RAM each router is configured for in the .net file
How good the Idle PC value is.
How many features are been used (BGP, MPLS, Multicast, etc).
Tuning your Idle PC value

Idle PC is a parameter that helps Dynamips to emulate virtual routers idle CPU
state. With an incorrect value your CPU will run at around 60-100% for just one
router. With the correct value your CPU will run at 1-10% for just one router.

This value is tied to the IOS image you are using. If you change IOS image
release, youll need a new Idle PC value.

If you change dynamips/dynagen version, you might also need to find a new
good Idle PC value for each IOS image.
Cisco Confidential

Copyright 2009 Cisco Systems, Inc. All rights reserved.

Introduction: Performance Tips (2 of 4)


How to find a good Idle PC value
Create a topology with one router running the IOS image for which you are trying to find a
good Idle PC value.

Right click on the router and select Idle PC from menu (see the picture). Choose an Idle
PC value and see if the CPU utilization is improved. If not, try again with another value.
Note that you can potentially ignore values with *, because most other non * values are
good too.

Good Idle PC values will result in your PC CPU


utilization drop from around 60-100% to 2-10%.

Copy paste the Idle PC value into the .net


file for every hypervisor instance. Repeat this
process for every different IOS image that you
are using in your topology.

Idle PC is not tied to the PC you are using, or


how much RAM you have, or what OS you are
running. You can copy the topology to another
PC and/or OS, and your Idle PC value will still
work.
Cisco Confidential

Copyright 2009 Cisco Systems, Inc. All rights reserved.

10

Introduction: Performance Tips (3 of 4)


Try to use an IOS image with the features you need but with the smallest RAM
requirements. Dont use 12.4T if you dont need it (256 MB RAM), try using 12.3 (128 MB
RAM), or 12.0S (64 MB RAM).

If one router with a good Idle PC value is using 10% of CPU, then you can run maximum
of 10 routers with that IOS image (but 9 is better), until performance drastically hinders.

After you start a topology, your CPU utilization will be high. Connect to every router and
get to Router> prompt by hitting <enter> a few times. Once you get a prompt on every
router, CPU utilization will drop.

Configure exec-timeout 0 0 under line con 0 to prevent consoles from timing out which
will cause CPU to go back to 100% until you reconnect to every router.

Cisco Confidential

Copyright 2009 Cisco Systems, Inc. All rights reserved.

11

Introduction: Performance Tips (4 of 4)


You can run one topology on several PCs. Its a simple way to distribute processing if not
enough RAM or CPU power is available on one PC.

Cisco Confidential

Copyright 2009 Cisco Systems, Inc. All rights reserved.

12

Resources
GNS3: http://www.gns3.net
GNS3s Wiki site: http://wiki.gns3.net
Dynamips: http://www.ipflow.utc.fr/index.php/Cisco_7200_Simulator
Dynamips Blog: http://www.ipflow.utc.fr/blog

Dynagen: http://dyna-gen.sourceforge.net
Virtual PC Sim: http://wiki.freecode.com.cn/doku.php?id=wiki:vpcs
Forum: http://7200emu.hacki.at/index.php
Tutorials: http://www.blindhog.net

Cisco Confidential

Copyright 2009 Cisco Systems, Inc. All rights reserved.

13

Part I: Getting started with Dynamips/GNS3

Download, Install & Run


Dynamips Tutorial

2010 Cisco Systems, Inc. All rights reserved.

Cisco Confidential

Part II: IOS Images and Console Access

Dynamips Tutorial

2010 Cisco Systems, Inc. All rights reserved.

Cisco Confidential

Commands for SecureCRT


Program Path

start C:\Progra~1\VanDyk~1\SecureCRT\securecrt.exe /script


C:\Progra~1\GNS3\securecrt.vbs /arg %d /T /telnet %h %p &
sleep 1
#$Language = "VBScript"
#$Interface = "1.0"

Sub main
crt.window.caption =
crt.arguments(0)
End Sub

Cisco Confidential

Copyright 2009 Cisco Systems, Inc. All rights reserved.

16

Part III: Creating a Basic Lab Environment

Dynamips Tutorial

2010 Cisco Systems, Inc. All rights reserved.

Cisco Confidential

Part IV: Including Virtual PCs on the Topology

Dynamips Tutorial

2010 Cisco Systems, Inc. All rights reserved.

Cisco Confidential

Part V: Managing Virtual Routers with CCP

Dynamips Tutorial

2010 Cisco Systems, Inc. All rights reserved.

Cisco Confidential

Commands Required on Routers

Router(config)# username name privilege 15 secret 0 password


Router(config)# interface <int_name/number>
Router(config-if)# ip address 10.10.10.1 255.255.255.248
Router(config-if)# no shutdown
Router(config-if)# exit
Router(config)# ip http server
Router(config)# ip http secure-server
Router(config)# ip http authentication local
Router(config)# ip http timeout-policy idle 60 life 86400 requests 10000
Router(config)# line vty 0 4
Router(config-line)# privilege level 15
Router(config-line)# login local
Router(config-line)# transport input telnet ssh
Router(config-line)# exit
Router(config)# line vty 5 15
Router(config-line)# privilege level 15
Router(config-line)# login local
Router(config-line)# transport input telnet ssh
Router(config-line)# end

Cisco Confidential

Copyright 2009 Cisco Systems, Inc. All rights reserved.

20

Part VI: Linking GNS3 with your NIC

Dynamips Tutorial

2010 Cisco Systems, Inc. All rights reserved.

Cisco Confidential

Part VII: Creating a FR/ATM Lab Environment

Dynamips Tutorial

2010 Cisco Systems, Inc. All rights reserved.

Cisco Confidential

Cisco Confidential

Copyright 2009 Cisco Systems, Inc. All rights reserved.

23

You might also like