Вы находитесь на странице: 1из 16

Based on the GNS3 template

Introducing GNS3
GNS3 is capable of:

 Emulated hardware
 Simulated OS
 Scalability with GNS3 server

Emulated vs Simulated devices

 Simulated: mimics all the characterristics of an actual device, like an ethernet switch which does
not run an OS, or an IOU
 Emulated: like a cisco IOS router. It emulates hardware

Installing GNS3
Main ideas of this section

 Run on multiple platforms


 What is a GNS3 Appliance?
 A list of GNS3 appliances

GNS3 Appliances
https://gns3.com/marketplace/appliances

 simply a virtual machine that comes with GNS3 already installed


 Pros and Cons:
o Pros:
 Ease & portability
o Cons:
 Need powerful computer
 List of appliances:
o GNS3 Workbench (most recommended) (1,15)
 How to install (1,16)

Configuration

Acquiring an IOS image


Stable & unstable images
From ref 1:
 Do not use c26xx images -> not stable
 Recommended IOS version:
o C36xx
o C37xx
o C7200 (not the c7200p)

Suggested from Google (stable images):

 c2691-adventerprisek9-mz.124-5a
 c3660-jk9o3s-mz.124-17.bin
 c3725
 c37xx
 c7200-advipservicesk9-mz.122-33

Suggested via an instructor on GNS3 academy


 They are c3725, c3745, c7200

Crash often

 c3640-a3jk9s-mz.124-16a.bin

Set up your first IOS router

Creating & managing projects

Project Management Overview


Terminology:

 What is a snapshot? (1,32)


 A topology
 A project
 A node

Screen layout

 GNS3 toolbar
 Devices toolbar
 Console
 Topology summary
 Workspace

GNS3 toolbar & related stuff


The GNS3 toolbar is divided into groups based on functions

Text edit:

 r.click the text label / text edit -> get much bigger editing area

Use “shift” to add multiple identical devices

start/stop/suspense

 Suspense:
o simulate a failure without having to go through the process of saving your configuration,
stopping the router, and restarting it
o the router also resumes more quickly (like hibernate function in windows)
o In fact, repeatedly stopping and restarting GNS3 routers can cause Dynamips to crash
with some IOS versions

GNS3 styles

 edit / preferences / general / general / select the style

Create a project
About the GNS3 file ios_base_startup-config.txt (1,38)

 You can add commands to this file so that they get applied straight away after you start up a
router

About the file ios_base_private-config.txt (1,38)

Integrating more components

VPCS
by typing the command "save"

commands:
 Save: save configuration of VPCS devices
 Show ip

VirtualBox
Setup wizard / local GNS3 VM / select VirtualBox

Note that the number of CPU cores were selected for us which may not be right. Get back to the running
VirtualBox, and note down the number of CPU cores being allocated to the virtual machine image, then
enter that number into the “setup wizard”

GNS3 VM
https://docs.gns3.com/1wdfvS-OlFfOf7HWZoSXMbG58C4pMSy7vKJFiKKVResc/index.html (title: GNS3
Setup wizard with the GNS3 VM)

Cisco IOU
IOU functions similarly to Dynamips but uses far fewer resources

IOU images
IOU filename breakdown (1,153)

Other features
GNS3 Console
Commands:

 help
 show device

Useful practices
About the GNS3 file ios_base_startup-config.txt

 you can add commands to this file so that they get applied straight away after you start up a
router

Snapshot

Suspend (instead of stop)


-----------------------------------------------

GNS3 basic usage

Change symbol
After dragging a router, a switch, or anything into the workspace, we can change that symbol into
another one by r.clicking on the symbol, choose change symbol (the appearance may change; however
it’s still a router if initially it’s a router)

Choose terminal type


Edit / preferences … / terminal settings. We can choose from a variety of terminal types:

 Putty
 SecureCRT
 TeraTerm

Windows Firewall
- This illustrates how to configure Windows Vista firewall to not filter loopback adapter on the local PC:

- Open firewall / change settings / advanced / uncheck loopback under network connections

- After this, we will be able to ping from the PC to a router or the reverse

Connect GNS3 to the real world

- The first topology was created using GNS3, the 2nd topology illustrates real world connections between
real devices

- HPLaptop will use Loopback card to connect to R1 in GNS3, and use its Ethernet card to connect to the
Internet.
- For R1 to connect to the Internet, HPLaptop will be a NAT Server for R1. We can do this by sharing
HPLaptop “Local Area Connection”:

+ R.click “Local Area Connection”/properties/sharing

(loopback card should be enabled already)

- We can further configure R1 to be DNS client by:

(config)# ip domain-lookup

(config)# ip name-server 192.168.1.1

(192.168.1.1 is the IP address of ADSL router)

Memory allocation failed


- This may happen when we configure NAT on a Router. We can use the tool “Cisco Feature Navigator”
to check the amount of RAM for an IOS image, then allocate the essential amount of RAM in GNS3

http://tools.cisco.com/ITDIT/CFN/jsp/index.jsp

- How to adjust RAM for a router:

+ R.click the router/configure/memories and disks

+ Change the value in RAM size: 128, 256, 512, …


Mkdir not supported
Under normal circumstances, we can’t use mkdir command. However, if we format flash, we can use
that command

# format flash:

If there is error formatting the flash (no device available), we have to erase flash first:

# erase flash:

# format flash:

VPCS
http://www.gns3.net/documentation/gns3/adding-hosts-to-your-topologies/

(title: Adding hosts to your Topologies)

vpcs can get an IP address from a DHCP server when the program starts up

ip 192.168.1.1 192.168.1.254 24 (ip address gateway mask)

Idle-PC value
This is from a tutorial on gns3 website:

“Potentially, better Idle-PC values are the ones with the highest values between the brackets. Choose
one of the values with an asterisk” -> try the highest values in the brackets and the values with asterisk

Adjust memory
- R.click the router / memories and disks

+ RAM size

+ NVRAM size

+ PCMCIA disk 0 size (flash memory)

- People said that the max configurable value of flash memory is 99 only (can’t adjust above)

File system
Besides pcmcia disk 0 which is flash memory, we can utilize pcmcia disk 1 as another file system storage
Change terminal type
- edit/preferences...

- general/terminal settings

- choose one, then click use

Save configuration on devices


1. save project as…

2. When we want to save configuration, issue:

# write

3. Issue that command on all devices

4. Click “save project or topology file” (or file/save)

5. done

Emulating Switch
- To emulate switch, there are 2 ways:

+ Use “EtherSwitch router” which includes the module NM-16ESW already

+ Use 36xx series or 37xx series, then add module NM-16ESW into one of the slots

I don’t know why on my GNS3 program, only 3640 router with module NM-16ESW can issue the
command “switchport …”. Others don’t have this command.

 I think the main reason is because we didn’t go into one of the ports residing on the switch
module.

Basic configuration
# vlan database

(vlan)# vlan 10,20 (no space btw , and 20)

# show vlan-switch brief (same as show vlan brief)

File *.net of GNS3


- File *.net of GNS3 can be edited using a text editor program
- When we use our loopback card to configure GNS3, it’s applicable only to our local machine. When we
move this *.net file to another machine, we need to reconfigure this loopback address. To know this
loopback interface on another machine:

+ 1st, enable this interface

+ Then, start / all programs / gns3 / network device list

+ We then see the following:

+ Edit *.net with Notepad and replace nio_gen_eth:\device\npf_{…..} by the one just been
found above, then save the file

Install GNS3 on Ubuntu 12.04

Step 1: Update and Install dependencies

Step 2 : Install GNS3

(create opt folder if it hasn’t been created yet)

(use either wget or browser to download the file)


Step 3 : Create folders

Step 4 : Install Dynamips

(the format of the file is *.bin)

Step 5 : Create the shortcut icon and run the app


- Create the Launcher on the Desktop by using the old GUI dialog

- In the command field, type in:

- If we run it only using python "/opt/GNS3/gns3" , we may get any of the Dynamips error message
below (depending on the operating system you use):

+ 206-unable to create UDP NIO

+ 206-unable to create generic ethernet NIO

+ 206-unable to create Linux raw Ethernet NIO

Step 6 : Edit Parameters in GNS3


- Start GNS3

- Getting started:

+ Step 1 – Dynamips

* Executable path to Dynamips: /opt/GNS3/Dynamips/dynamips-0.2.8.bin

* Working directory for Dynamips : /opt/GNS3/tmp

-> Then, click “test setting”

+ Step 2 – General
* PathsProject directory : /opt/GNS3/Project

* Image Directory :/opt/GNS3/Images

- Edit / preferences / capture:

+ working directory for capture files : /opt/GNS3/Project

Step 7: Fine Tuning


- Uncompress Cisco IOS to get rid of a slow Cisco router IOS self decompressing image sequence

- Delay between device start and Autosave

+ If you have many devices, while starting all at same time , it will choke you CPU.

-> should add delays between each device start.

+ Edit | preferences |General | General Settings

-> Delay between each device start when starting all devices:

5 seconds

Autosave: 300 seconds

Configure ASA Firewall

Use in GNS3
- Get the source files available:

+ asa842-initrd.gz

+ asa842-vmlinuz

- GNS3 preferrences -> QEMU -> ASA

+ RAM: 1024 MB

+ Number of NICs: 6

+ Qemu options: -m 1024 -icount auto -hdachs 980,16,32

+ Initrd: C:\ASA\asa842-initrd.gz

+ Kernel: C:\ASA\asa842-vmlinuz

+ Kernel cmd line: -append ide_generic.probe_mask=0x01 ide_core.chs=0.0:980,16,32 auto


nousb console=ttyS0,9600 bigphysarea=65536
- Click save

- Start the device

- Enter activation key (use either one):

# activation-key 0x4a3ec071 0x0d86fbf6 0x7cb1bc48 0x8b48b8b0 0xf317c0b5

# activation-key 0xb23bcf4a 0x1c713b4f 0x7d53bcbc 0xc4f8d09c 0x0e24c6b6

- Save the configuration (also save the key):

# write

- Stop and start the ASA again

CPU Usage
- There is no idle PC, use 3rd party software instead. The name is “BES – Battle Encoder Shirase”

http://mion.faireal.net/BES/

- Start BES / click target / choose qemu.exe / click “limit this” / OK

- Click control button / specify to 50%

Connect an ASA in a topology


- The ASA can’t connect directly to a cloud. Use Ethernet Switch in between

Installing ASDM Launcher


- Copy file asdm.bin into flash using TFTP

- Configure basic information for accessing

# int g0

# ip address 192.168.1.1 255.255.255.0

# no shut

# nameif inside

+ security-level 100

+ http server enable

+ http 192.168.1.0 255.255.255.0 inside


+ username admin password cisco privilege 15

- Open web browser, enter: https://192.168.1.1

- Download ASDM launcher into local machine

- Install it

References
http://www.gns3.net/documentation/gns3/pix-firewall-emulation/

VoIP Topology

Make sure your router has at least 256 MB RAM -> use 7200

Case 1

Even though there is no switch in between, the softphone still registers with the router and everything
works fine

Case 2
Before we process with an explanation of how to build a VoIP topology with GNS3, we need to
understand one important thing. An IP phone uses an IP address of the host which the phone is running
on (this is # from a hardphone). This means we can only have one softphone configured within one OS. If
there are multiple IP softphones running, they all have the same IP address. As a result, to have more
than one softphones, we need to have a virtual machine running another OS (for ex: running 2 virtual
machines will provide us with 2 more softphones)

The cloud on the right uses a loopback (as an alternative, it can use the real network interface). The one
on the left is using a vmware network adapter in NAT mode (we can’t run in bridged mode because this
mode needs a physical adapter involved). To make life a bit simpler (on the left branch), we can
represent it as:
(192.168.80.202 is the IP address of Windows XP (also of a softphone))

Note that the XP virtual machine receives IP address from DHCP server which is the VmWare. We can
disable VmWare DHCP server so that windows XP (also the softphone running on it) can receive the IP
address from the CME R2 router). To do that, in vmware choose edit / virtual network editor / choose a
vmware adapter / deselect “use local DHCP service to distribute IP address to VMs”

Case 3

According to what we said the case 2 above, in order to make this topology work, we can use either
scenario below:

 C2 uses a physical adapter, C3 uses a vmware adapter (nat mode), and vice versa
 C2 uses a loopback adapter, C3 uses a vmware adapter (nat mode), and vice versa

Troubleshooting

An IOS crashes
When we start an IOS, if it crashes with the message “Connection refused...”, it’s the problem with the
IOS -> try another IOS

GNS3 Doctor
gns3 installation troubleshooting: help / gns3 doctor
-----------------------------------------

REFERENCES
1. The book of GNS3

Вам также может понравиться