lost and found ( for me ? )

Showing posts with label GNS3. Show all posts
Showing posts with label GNS3. Show all posts

Linux Mint 12 : How to install dynamips and gns3 ( Cisco Router Emulator )


Here’s an explanation of how to install dynamips and gns3 on Linux Mint 12.

# uname -ri
3.0.0-15-generic x86_64

# tail -1 /etc/lsb-release
DISTRIB_DESCRIPTION="Linux Mint 12 Lisa"


[ install dynamips and gns3 ]

dynamips is Cisco Router emulator and gns3 is GUI tool for dynamips.
# apt-get install -y dynamips gns3


[ initial setup ]

start gns3
$ gns3 &


do step1 ( configure working directory ) and then step2 ( load IOS )


step1 ( click OK. default settings )


step2

select the IOS image you want to run.
I used c3640-jk9s-mz.124-13a.bin.


click “Save”

drag and drop “Router c3600” icon like this.




start c3600

configure Idle PC

By default , the dynamips process uses around 100% CPU consumption.
# top -b -n 1 | grep dynamips
25472 hattori   20   0  363m 185m  65m S   99  1.5   3:17.27 dynamips


To reduce CPU consumption

select Router icon , right-click , Idle PC



Dynampis will calculate an appropriate Idle PC values.


Click “Apply”

After configuring Idle PC values.
# top -b -n 1 | grep dynamips
25472 hattori   20   0  363m 185m  65m S    8  1.5   6:57.80 dynamips

CPU consumption is 8%.

Configuration file is stored under .gns/ directory. ( gns3.ini file )
# head -5 /home/hattori/.gns3/gns3.ini
[GNS3]
version=1795
lang=en
project_startup=true
relative_paths=true


Ubuntu 10.10 Server : How to run Cisco IOS 15.1 on dynamips (GNS3)

Here’s how to fly an ISO 15.1 on dynamips.

# tail -1 /etc/lsb-release
DISTRIB_DESCRIPTION="Ubuntu 10.10"

# uname -r
2.6.35-28-server

# dynamips --version
Cisco Router Simulation Platform (version 0.2.8-RC2-amd64)

# gns3 --version
gns3 0.7

[ prepare an IOS for Cisco 7206VXR ]

I used c7200-adventerprisek9-mz.151-4.M.bin

plz note that not c7200p images! In my testing , these images don’t seem to boot.

[ configure GNS3 to fly IOS 15.1 ]

select c7200-adventerprisek9-mz.151-4.M.bin as a boot ISO image


If you haven’t installed dynamips , just tyep
# apt-get install gns3 dynamips


General:

Midplane is vxr and NPE is npe-400.


Memories n’ disks setting is default.




add a module on slot1

[ fly R1(c7200) via GNS3 ]

calculate n’ set IDLEPC value.


IOS 15.1 is running



# cat .gns3/gns3.ini
[GUIState]
Geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x1\0\0\0\0\0\x98\0\0\x1\x92\0\0\x3\xb5\0\0\x3\x9b\0\0\0\x98\0\0\x1\x92\0\0\x3\xb5\0\0\x3\x9b\0\0\0\0\0\0)
State=@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\x3\0\0\0\0\0\0\x1\0\0\0\x1\xb3\xfc\x2\0\0\0\x2\xfb\0\0\0(\0\x64\0o\0\x63\0k\0W\0i\0\x64\0g\0\x65\0t\0_\0N\0o\0\x64\0\x65\0T\0y\0p\0\x65\0s\x1\0\0\0\x41\0\0\x1\xb3\0\0\0g\0\xff\xff\xff\xfb\0\0\0&\0\x64\0o\0\x63\0k\0W\0i\0\x64\0g\0\x65\0t\0_\0U\0n\0\x64\0o\0V\0i\0\x65\0w\0\0\0\0\0\xff\xff\xff\xff\0\0\0g\0\xff\xff\xff\0\0\0\x1\0\0\x1\0\0\0\x1\xb3\xfc\x2\0\0\0\x1\xfb\0\0\0$\0\x64\0o\0\x63\0k\0W\0i\0\x64\0g\0\x65\0t\0_\0T\0o\0p\0o\0S\0u\0m\x1\0\0\0\x41\0\0\x1\xb3\0\0\0l\0\xff\xff\xff\0\0\0\x3\0\0\x1\x12\0\0\0\xd9\xfc\x1\0\0\0\x1\xfb\0\0\0$\0\x64\0o\0\x63\0k\0W\0i\0\x64\0g\0\x65\0t\0_\0\x43\0o\0n\0s\0o\0l\0\x65\x1\0\0\x1\x6\0\0\x1\x12\0\0\0O\0\a\xff\xff\0\0\x1\x12\0\0\0\xd4\0\0\0\x1\0\0\0\x2\0\0\0\x1\0\0\0\x2\xfc\0\0\0\x1\0\0\0\x2\0\0\0\x3\0\0\0\x1e\0t\0o\0o\0l\0\x42\0\x61\0r\0_\0G\0\x65\0n\0\x65\0r\0\x61\0l\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\"\0t\0o\0o\0l\0\x42\0\x61\0r\0_\0\x45\0m\0u\0l\0\x61\0t\0i\0o\0n\x1\0\0\x1\\\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\x1e\0t\0o\0o\0l\0\x42\0\x61\0r\0_\0\x64\0r\0\x61\0w\0i\0n\0g\x1\0\0\x2L\xff\xff\xff\xff\0\0\0\0\0\0\0\0)

[GNS3]
version=1792
lang=en
project_startup=true
relative_paths=true
slow_start=0
console=
use_shell=true
gui_show_status_points=true
gui_use_manual_connection=false
gui_draw_selected_rectangle=false
project_directory=/home/hattori/.gns3
ios_directory=/home/hattori/.gns3
scene_width=2000
scene_height=1000

[Dynamips]
hypervisor_path=/usr/bin/dynamips
hypervisor_port=7200
hypervisor_baseUDP=10000
hypervisor_baseConsole=2000
hypervisor_working_directory=/tmp
clean_working_directory=true
dynamips_ghosting=true
dynamips_sparsemem=false
dynamips_mmap=true
hypervisor_memory_usage_limit=512
hypervisor_udp_incrementation=100
hypervisor_manager_import=true
hypervisor_manager_binding=localhost

[Qemu]
qemuwrapper_path=
qemuwrapper_working_directory=
qemu_path=qemu
qemu_img_path=qemu-img
external_hosts=localhost:10525
enable_QemuManager=true
qemu_manager_import=true
qemu_manager_binding=localhost
qemuwrapper_port=10525
qemuwrapper_baseUDP=20000
qemuwrapper_baseConsole=3000
default_pix_image=
default_pix_memory=128
default_pix_nic=e1000
default_pix_options=-nographic
default_pix_kqemu=false
default_pix_key="0x00000000,0x00000000,0x00000000,0x00000000"
default_pix_serial=0x12345678
default_junos_image=
default_junos_memory=96
default_junos_nic=e1000
default_junos_options=
default_junos_kqemu=false
default_junos_kvm=false
default_asa_memory=256
default_asa_nic=e1000
default_asa_options="-hdachs 980,16,32"
default_asa_kqemu=false
default_asa_kvm=false
default_asa_kernel=
default_asa_initrd=
default_asa_kernel_cmdline="auto console=ttyS0,9600 bigphysarea=16384 ide1=noprobe"
default_ids_image1=
default_ids_image2=
default_ids_memory=512
default_ids_nic=e1000
default_ids_options="-smbios type=1,product='IDS-4215'"
default_ids_kqemu=false
default_ids_kvm=false

[Capture]
working_directory=.
capture_reader_cmd=/usr/bin/wireshark %c
auto_start_cmd=true

[IOS.images]
15\filename=/home/hattori/c7200-adventerprisek9-mz.151-4.M.bin
15\chassis=7200
15\platform=c7200
15\hypervisors=
15\default_ram=256
15\idlepc=0x638617b4
15\default=true

# pwd
/home/hattori/.gns3/test/test_working

# ls
c7200-adventerprisek9-mz.151-4.M.bin-localhost.ghost
c7200_R1_bootflash
c7200_R1_disk0
c7200_R1_lock
c7200_R1_log.txt
c7200_R1_nvram
c7200_R1_rommon_vars
c7200_ghost-c7200-adventerprisek9-mz.151-4.M.bin-localhost.ghost_bootflash
c7200_ghost-c7200-adventerprisek9-mz.151-4.M.bin-localhost.ghost_disk0
c7200_ghost-c7200-adventerprisek9-mz.151-4.M.bin-localhost.ghost_log.txt
c7200_ghost-c7200-adventerprisek9-mz.151-4.M.bin-localhost.ghost_nvram

Cisco router emulator : how to use dynamips n’ GNS3 on Ubuntu10.04 64bit

root@hat1:~# cat /etc/lsb-release | grep -i description
DISTRIB_DESCRIPTION="Ubuntu 10.04.1 LTS"

root@hat1:~# apt-cache search dynamips
dynagen - Cisco 7200 Router Emulator Command Line Interface
dynamips - Cisco 7200/3600/3725/3745/2600/1700 Router Emulator
gns3 - graphical network simulator

- install dynamips n’ gns3

CLIで操作したい場合は dynagen をインストール。
GUIで操作したいので、 Ciscoエミュレータの dynamips と フロントエンドGUI の GNS3 をインストール。

root@hat1:~# apt-get install dynamips gns3

- GNS3を起動

アプリケーション -> 教養・教育 -> GNS3



Step1 で dynamips がインストールディレクトリなど全般設定をする。
apt-get で dynamips , gns3 をインストールしている場合、デフォルト設定でOK


IOSを選択


ラボの作成

file -> New project


トポロジーを作成

node types のアイコンをドラッグn’ドロップで中央にもっていく
適当にリンクを追加


起動


こんな感じ


idlepc の設定

デフォルトだとCPU100% 使用するので idlepc 値を設定する。

2つルータを起動sいているので、CPUがほぼ200%

 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
2813 root      20   0  551m 144m  71m S  197  1.9  13:31.43 dynamips

ルータアイコン右クリック -> IDLE PC


IDLE PC 設定後のCPU使用率。さがった。

 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
2813 root      20   0  551m 144m  71m S   21  1.9  17:11.02 dynamips

停止は、ルータを suspend 。
設定の保存: ネットワークファイルを名前を付けて保存(アイコン)
設定の復旧: ネットワークファイルを開く ( アイコン ) -> *.net ファイルを指定