How to use switch in gns3 | switching labs in gns3 1.1

How to run a switch in Gns3:

In this article I will show you how to use Cisco switch in Gns3 1.1 and Gns3 0.8 virtualbox edition. You can perform switching functionality on GNS3 simply by using NM-16ESW module. This module is normally available or work with Cisco 3600 & 3700 series. Using NM-16ESW you can configure switching protocols like VLAN, STP, VTP on gns3 ect. 

Cisco Commands For Beginners

How to use Switch in Gns3 1.1:


Open Edit \ Preferences\ dynamips\IOS Router & click on new button.

Browse the Cisco 3600 & 3700 series image and click next.

Type it’s name and set a suitable RAM for it.


The next step is most important one, where you need to define NM-16ESW, you can choose it from drop down menu.

In next step, set the idle PC value for your router and finish this wizard.

After this you will find your router with switching functionality in Gns3 device menu.

You can drag it to gns3 stag and connect it via NM-16ESW module with other devices and you can try some switching commands that are mention at the end of this post.


How to use Switch in gns3 0.8 virtualbox edition:

  • First open the "Symbol Manger" from Edit tab.
  • Add a ethernet_switch from  available symbol to customize nodes. Type a name for switch and in Type field assign the Cisco router IOS to switch, in my case i select the  c3600 series and i have used IOS c3640-jk9o3s-mz.124-16a (33MB). You can download switch IOS for GNS3 from this link.

  • Click on apply and then on ok button.
  • Now you can find a new switch in nodes types.


  • Now drag this switch on stage and click on configuration and add  NM-16ESW module from slot tap.

  • click on OK you may received a message "You must use 'manual mode' to connect a link with a NM-16ESW module". Therefore use the manual method to configure this.

How to add switch image in GNS3 1.1

For gns3 1.1 open the edit\preferences, then explore the dynamips tab and click on "ios routers". now click on new and browse the above downloaded image, click next. 

Type name for router and click next. Now from slots tab choose the NM-16ESW for switching function and click finish.


Switching labs in gns3 

Now for test i shall configure two vlan on switch. For Vlan configuration you can use the following commands.
vlan database
vlan 10
vlan 20

  • Start your switch and try these commands also can see in screen-shot for vlan 10, 20.

For complete switching labs visit following posts of blog.   

1. Switch virtual interface SVI configuration on gns3 
2. Inter VLAN on gns3 
3. Hot Standby Router Protocol configuration on GNS3

108 comments:

  1. how mine is not working dam it

    ReplyDelete
  2. is there any error ??? and which IOS you are using...???

    ReplyDelete
    Replies
    1. If I add ethernet-switch and set it as ethernet-switch. I have not place to set the IOS as you do on a router.

      Delete
    2. If I add the ethernet-switch symbol and set it to ethernet-switch, there is no place to point the IOS, as there is on a router.

      Delete
    3. Please help didn't work with me !!!!

      Delete
    4. Hi,

      I had configured the router as Ethernet switch, but I am not able to use switch commands. Please help

      Delete
  3. thanks sooooooooooooooooooo much!!!

    ReplyDelete
  4. thanks alot ...........its working fine....:-)

    ReplyDelete
  5. Amazing it solve my problem thank you veeeeeeeeeeeery much.Keep it up

    ReplyDelete
  6. There is something incorrect as when I write that command:
    switch#vlan database, I got invalid input detected?!

    Any update in that case ??

    10x

    ReplyDelete
    Replies
    1. vlan database is old way of creating vlans. New one is switch(config)#vlan

      Delete
  7. make sure you have used NM-16ESW module in that router..

    ReplyDelete
  8. this is what i got !!!!

    % Invalid input detected at '^' marker.

    ReplyDelete
    Replies
    1. make sure your in enable mode, not global config when using R1# vlan database command
      ^

      Delete
  9. add NM-16ESW module in switch in order to execute the "switch#vlan database" command.

    ReplyDelete
  10. thanks man...i cleared my CCIE rns with this only.....amazing work guys...

    ReplyDelete
  11. Thanks Dear, it is great!!! i really mean it.

    ReplyDelete
  12. hi why is the link redirecting me to amazon?
    I cannot download the ios image
    please update the link

    ReplyDelete
  13. Downloading IOS files and refering to them is illegal, but you should be able to find them if you search hard enough(usenet,torrents etc.)

    ReplyDelete
  14. hi if you wana download IOS files then u can download from gns3.net or search google u ll find more links.

    ReplyDelete
  15. thank u so much.....m trying to use switch for 2 months but router interfaces came in between of etherswitch router

    ReplyDelete
  16. just use the "NM-16ESW module" in any router, then u can run different switch commands in gns3.. try this n reply what hapen...

    ReplyDelete
  17. Hi, I tried above setup but its not working...... any one pls suggest ...

    switch#vlan da
    switch#vlan database
    switch(vlan)#vlan 100
    VLAN 100 added:
    Name: VLAN0100
    switch(vlan)#vlan 200
    VLAN 200 added:
    Name: VLAN0200
    switch(vlan)#
    switch(vlan)#ex
    APPLY completed.
    Exiting....
    switch#
    switch#
    switch#config t
    Enter configuration commands, one per line. End with CNTL/Z.
    switch(config)#int fa 0/0
    switch(config-if)#sw
    switch(config-if)#swit
    switch(config-if)#swit?
    % Unrecognized command
    switch(config-if)#^Z
    switch#
    switch#
    switch#sh ver
    *Mar 1 00:02:26.927: %SYS-5-CONFIG_I: Configured from console by console
    switch#sh ver
    Cisco IOS Software, 3700 Software (C3725-ADVIPSERVICESK9-M), Version 12.4(23), RELEASE SOFTWARE (fc1)

    ReplyDelete
    Replies
    1. use the interfaces of fa1/0 ,fa1/1,fa1/2 .....etc

      instead of interface fa0/0 or fa0/1

      Delete
    2. Interface fa0/0 and fa0/1 are router interfaces. The Switch interfaces start from fa1/0.

      I hope this will help

      Delete
  18. its working fine......

    ReplyDelete
  19. hey i want to add switch catalyst 4507r. how can i do it ... help m plz

    ReplyDelete
  20. if ther any one can halp me this is my skype ;hamadabenyettou
    thnx

    ReplyDelete
  21. May I know the IOS version and sw / router module that is being used in order to configure VRRP and HSRP ? So far I am not able to use "standby" command and "vrrp" commands. I used "c3640-jk9o3s-mz.124-16a" IOS and using "NM-16ESW" , "NM-1FE-TX". But still cannot use "standby" and "vrrp"commands. Pls. advise.

    ReplyDelete
  22. Hi, this is working quite well but we can't access to all vlan acl can we?

    I tried

    SW1(config)#vlan access-map
    and
    SW1(config)#vlan filter

    It didn't work.. any idea how to make those work?

    ReplyDelete
  23. thanks a lot it`s working exactly the same to me

    ReplyDelete
  24. you are wonderful,thanks a million,i thought iwas lost forever.

    ReplyDelete
  25. hmm....When I do the steps...it shows the ethernet_switch under 'Decorative Nodes' in node panel and it doesn't give me more options like adding Adapters on slots...

    ReplyDelete
  26. thanks a lot, you`re genius

    ReplyDelete
  27. thankx for all ur comments.., it really help alot

    ReplyDelete
  28. why cant i see any Vlans (not even the default ones) when i enter show vlans on gns3

    ReplyDelete
  29. I have tried mounting the NM-16ESW module to multiple IOS images and router types but for some reason the add on card does not get picked up at all. No VLAN commands or interfaces visible. Other add on cards work and extra ports are picked up automatically. Am I missing something?

    ReplyDelete
  30. working for me... thank you. :)

    ReplyDelete
  31. Hello Can anybody share the link to download the module NM-16ESW please?

    ReplyDelete
    Replies
    1. i am not sure about other routers but 3600 series has NM-16ESW module..
      just add this router in your topology and from slot option select this module.. thanks..

      Delete
  32. hi, I did everything as described above, well I see all interfaces when show ip int brief. but if I type " show vlan" it doesn´t work for me, it says " Ambiguous command: show vlan " instead ,,, any idea why ? or maybe since it is router IOS it just doesnt support this command,,

    ReplyDelete
    Replies
    1. hi, do u manage to create vlan or not????

      Delete
    2. yes , I could create them, but once I type "show vlan" that message occured "Ambiguous command: show vlan " , don´t know why though... is there any other command to show list of vlans created on it? thanks

      Delete
    3. try following command:

      show vlan-switch brief

      Delete
    4. Thanks a lot! Had the same "problem"

      Delete
  33. show vlan does not work, use show vlans switch instead

    ReplyDelete
  34. hello, thanks I must have been blind yesterday when I missed this:
    http://commonerrors.blogspot.sk/2011/06/save-vlan-configuration-database-in.html
    show vlan-switch solved my problem...

    ReplyDelete
  35. Hi

    when using NM-16ESW module in router and then for example in the IOS type int f1/0 , IOS give the this error :

    invalid input detected at ' ' marker.

    why this error show me ?

    ReplyDelete
    Replies
    1. int f1/0 is not valid for your setup. use the "Router#show ip interface brief" command for show all interfaces and then select the one which you wana configure..

      thanks

      Delete
  36. Switch#vlan database
    Switch(vlan)#vlan 100
    VLAN 100 added:
    Name: VLAN0100
    Switch(vlan)#vlan 200
    VLAN 200 added:
    Name: VLAN0200
    Switch(vlan)#exit
    APPLY completed.
    Exiting....
    Switch#conf t
    Enter configuration commands, one per line. End with CNTL/Z.
    Switch(config)#interface e1/0
    Switch(config-if)#sw
    Switch(config-if)#switchport mode access
    ^
    % Invalid input detected at '^' marker.
    ------------------------------------------------

    any idea please

    Regards.

    ReplyDelete
    Replies
    1. try switchport mode access on fastethernet instead of ethernet, see what happen????

      Delete
    2. Well Thanks I have tried the Fastethernet and still it is the same, but i gave the interface an ip address connected to router and it is pinging, i mean I can ping the router connect to the fastethernet , not as yesterday when I used Ethernet, I couldn't even ping. thanks again,

      can anyone tell me why Switchport mode access is not working on my switch, It is 3600 router simulated as switch and I am using c3640-is-mz124-21.bin

      thanks again.

      Delete
  37. thank you it working good for me..

    ReplyDelete
  38. hi, what type and number of this IOS switch that you used in this Lab? can you tell so I can search for it myself.

    ReplyDelete
  39. Not Working the switchport mode access in c7200 & 3640.

    ReplyDelete
  40. Please find the below error that i am getting. Please help


    C:\unpack>unpack.exe
    'unpack.exe' is not recognized as an internal or external command,
    operable program or batch file.

    ReplyDelete
    Replies
    1. now what is this unpack.exe???

      Delete
  41. Hi Dear,

    I am Charan, preparing for CCNP SWITCH. I struggled a lot to do Switching Lab practice and this really helped me a lot.

    Thank you for the great support and sharing.

    ReplyDelete
  42. I do not use GNS3 for switching, I'm using SunOS SPARC in Simics to create network topology for switching practice, configuration and verification. VLAN, VTP, STP and other switch configuration works fine in SunOS.

    ReplyDelete
  43. I was wondering how can I do something like that...now, I got an answer...thx a lot

    ReplyDelete
  44. any 1 can give iso image 3600 ?

    ReplyDelete
  45. GREAT! THANKS SO MUCH.

    ReplyDelete
  46. where can we get the nm16esw module......i didnt find it in the slot option....how do we get that...IOS image is required

    ReplyDelete
  47. Thank you verry much, so helpful !

    ReplyDelete
  48. Hey thanks. Nice info. But what do I have to do to run vtp commands on this newly created switch. When I tried it in global mode, it asked me to create a file in which it will store the vtp database. I gave it the name : "vtp.dat". But then I couldn't do anything with that file or with any other vtp command. Any ideas?

    ReplyDelete
  49. I entered switchport mode access but it doesn't show up in the running config. Cant seem to figure out why... another site suggested that entering the commands in a specific order would make it work right but. I appreciate GNS3 but I wish I could just rent some real lab equipment for about three months..

    Unfortunately, GNS3 doesn't seem to be real tolerate of errors, once I write to the vlan.dat file when using these switch modules; so I have scrap the whole topology and start over just to test that theory... extra practice I suppose...

    Sw1Pod1#show run | section interface FastEthernet0/2
    interface FastEthernet0/2
    switchport access vlan 10
    switchport voice vlan 15

    ReplyDelete
    Replies
    1. switchport mode access is the default command it will not show up in running config

      Delete
  50. man for 10 months i am using gns3 and wanted to use switchport command
    and this the site that has given me the answer how to . Hats off to you.
    a big thanks to you and i am giong to bookmark your site.

    ReplyDelete
  51. Hi Thanks mate for sharing this information, i was able to configure successfully.

    ReplyDelete
  52. Hi, so cool idea but i have a problem, switch#Vlan database command did not apply.
    plz guide me. Thank's

    ReplyDelete
    Replies
    1. make sure you have used NM-16ESW module in that router..

      Delete
  53. I m getting following error while following your mentioned steps & plz help me to get it resolve.

    R6: error from server 127.0.0.1:7204: 206-unable to create VM instance 'ghost-c3640-Gns3 IOS for switch.image-127.0.0.1.ghost'

    ReplyDelete
    Replies
    1. Iep,

      Just change the name of the ".bin" by c3640-jk9o3s-mz.124-16a.bin and don't forget the IDLE PC auto calculation

      Delete
    2. Man you are awesome , i had the same issue and its solved .. Thanks a milllion brooo...

      Delete
    3. Thanks a lot whoever posted "Just change the name of the ".bin" by c3640-jk9o3s-mz.124-16a.bin and don't forget the IDLE PC auto calculation"

      Delete
    4. I tried this too but I keep getting this error:

      Server error [-3200] : unable to create VM instance 'Ghost'
      An emulator instance (PID 5288) is already running with identifier 0.
      If this is not the case, please erase file "c7200_i0_lock".

      VM Ghost: unable to create instance!

      I upgraded to GNS3 version 1.2.3. Could it be because of my version?

      Delete
    5. OK now somehow I overcame this problem but I got another error in the router console:

      Connected to Dynamips VM "R4" (ID 4, type c3600) - Console port
      Press ENTER to get the prompt.
      ROMMON emulation microcode.

      Launching IOS image at 0x80008000...

      Error : compressed image checksum is incorrect 0x9139C5F2
      Expected a checksum of 0xAC10AA9F

      !!! WARNING - VM is not running, will be unresponsive (status=1) !!!

      Delete
  54. Thanks its working great :)

    but i can not enable spanning tree protocol. How can I do it ? please help me.

    Thanks in advance.

    ReplyDelete
  55. Thanks for sharing. For those of you who can't even put it on, delete the space in the file name, somehow my GNS3 didn't like it.

    ReplyDelete
  56. I had the same problem, GNS3 wouldn't install the router on the workspace because of the name of the /.bin file. Make sure you replace the spaces with _ or whatever, then it's all good.

    ReplyDelete
  57. dear all...plz give me this ios c3640-jk9o3s-mz.124-16a..i can't find this on the internert plz send me...

    ReplyDelete
  58. I tried the above steps but dont see an option to use manual mode after I hit ok after selecting NMS-16ESW , and get this error logs :

    ---------Traceback lines (saved in exception.log)----------
    Traceback (most recent call last):

    File "GNS3\Scene.pyo", line 725, in slotStartNode

    File "GNS3\Node\IOSRouter.pyo", line 607, in startNode

    File "GNS3\Dynagen\dynagen.pyo", line 2542, in check_ghost_file

    File "GNS3\Dynagen\dynagen.pyo", line 2565, in _create_ghost_instance

    File "GNS3\Dynagen\dynamips_lib.pyo", line 2163, in __init__

    File "GNS3\Dynagen\dynamips_lib.pyo", line 4998, in send

    DynamipsError: 206-unable to create VM instance 'ghost-c3640-Gns3 IOS for switch.image-127.0.0.1.ghost'

    ReplyDelete
  59. Hello

    I have set up a router with 3600 series router IOS with NM-16ESW module.

    If I hover over the switch I see all the ethernet ports Fastetherenet 0/1 - 0/15 however when I go inside the router and type in show interface none of these ethernet ports show up. Any recommendations...

    ReplyDelete
    Replies
    1. try to connect these interfaces with other devices by manual selection, and then try again..

      Delete
  60. Great Work Man...Thumbs up...<3...it works for me...

    ReplyDelete
  61. excellent work..........thank youuuuuuuu

    ReplyDelete
  62. no idea how you get a layer 3 switch coming up, all i get is a router...

    ReplyDelete
  63. Kindly update me regarding the GNS3 , how to access from network. i try so many thing but not access.

    ReplyDelete
    Replies
    1. First connect gns3 to physical interface of your PC with gns3-cloud and then access it through network ..

      Delete
  64. i cant create the vlans... had the followin messages:
    S1(vlan)#vlan 2 name ITTeam
    VLAN 2 added:
    Name: ITTeam
    S1(vlan)#vlan 5 name Accounting
    VLAN 5 added:
    Name: Accounting
    S1(vlan)#exit
    % not enough space on flash to store vlan database. trying squeeze...
    % error squeezing flash - (No device available)
    Error on database apply 40: NV storage failure
    Use 'abort' command to exit
    S1(vlan)#

    and when i tryed to fulsh/erase the memory had the following message:
    S1#erase flash:
    Erasing the flash filesystem will remove all files! Continue? [confirm]
    %Error erasing flash: (No device available)
    S1#

    Maybe is a configuration (Gns3 IOS hardware config) issue... by the way is a 2691 with c2691-advipservicesk9-mz.124-15.T6..unpacked IOS image.

    ReplyDelete
    Replies
    1. hello, whould you help me, i have a same problem.

      Delete
  65. try adding a disk configuring your router, so a flash comes up

    ReplyDelete
  66. Ans:- 1. Must Be Getting Error Like This:-
    -------------------------------------------------------------------------

    R2(vlan)#vlan 12
    VLAN 12 added:
    Name: VLAN0012
    R2(vlan)#exi
    % not enough space on flash to store vlan database. trying squeeze...
    % error squeezing flash - (No device available)
    Error on database apply 40: NV storage failure
    Use 'abort' command to exit

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

    2. Error Erasing Flash :- If you Try directly with switch on , you will get like this
    -------------------------------------------------------------------------------
    R2(vlan)#abort
    Aborting....
    R2#era
    R2#erase fl
    R2#erase flash:
    Erasing the flash filesystem will remove all files! Continue? [confirm]
    %Error erasing flash: (No device available)
    --------------------------------------------------------------------------------------

    3. STEPS:-

    1. first write /save your config ( by typing "wr" in privilege(#) mode
    -----------------------------------------------------------------------------------
    R2#wr
    Building configuration...
    [OK]

    ---------------------------------------------------------------------------------
    2. stop switch/router (by right clicking on switch/router image in GNS
    ------------------------------------------------------------------------------------


    -------------------------------------------------------------------------------------
    3. Go to Configure , as seen in image options above:-
    ----------------------------------------------------------------------------------------------------------
    i.Click your device(sw/router) in list or select group (to apply to same kind of device from next time automatically)
    ii.locate Memories and disks --> discs--> PCMCIA disk0 size:- option
    iii. change size of flash to 1 mb or more
    iv. apply & click OK.


    ------------------------------------------------------------------------------------------------------------
    4. Start your device again
    ------------------------------------------------------------------
    (Note if you do this you will get error again)
    (
    R2#vlan da
    R2#vlan database
    R2(vlan)#vlan 12
    VLAN 12 added:
    Name: VLAN0012
    R2(vlan)#exi
    % not enough space on flash to store vlan database. trying squeeze...
    % error squeezing flash - (Operation not supported on this file)
    Error on database apply 40: NV storage failure
    Use 'abort' command to exit

    )
    -----------------------------------------------------------------
    5.Erase Flash now from privilege mode(#)
    --------------------------------------------------------------------
    R2#era
    R2#erase fl
    R2#erase flash:
    Erasing the flash filesystem will remove all files! Continue? [confirm]
    Current DOS File System flash card in flash: will be formatted into Low End File System flash card! Continue? [confirm]
    Erasing device... eeeeeeeeeeeeeeee ...erased
    Erase of flash: complete

    ---------------------------------------------------------------------------
    6. DONE. Now if you go to vlan database & create vlan & exit , it will be successful , (if you followed everything correctly)
    ---------------------------------------------------------------------------------------------------
    R2#vlan da
    R2#vlan database
    R2(vlan)#vlan 12
    VLAN 12 added:
    Name: VLAN0012
    R2(vlan)#exi
    APPLY completed.
    Exiting....

    ReplyDelete
  67. Hello ALL,

    i am facing some problem
    i am using gns3 after attached switch ios in gns3 my switch port is disable how i can enabled is any one know this error kindly let me know ASAP

    Thank you

    ReplyDelete
    Replies
    1. add NM-16ESW module from router configuration...!

      Delete
  68. I did add NM-16ESW and I right click a router to assign a connection cable, I do see Fast Ethernet Ports. However, when I double click on a router, it doesn't take me to the router console page completely. I am using MAC OS X and get the following message:

    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    Connected to Dynamips VM "R1" (ID 10, type c3600) - Console port
    Press ENTER to get the prompt.

    Please assist.

    ReplyDelete
  69. Hi,

    Can any one provide the switch IOS for latest GNS3, for TShoot labs Practice,

    Thanks IK

    ReplyDelete
  70. hi!. please i set up my vlan using the vlan database command on a 3600 switch, and after setting the vlans, i proceeded to the global config mode to assign switchports to the vlans and also confirmed that the switchports have been assigned to the respective vlans using the 'sh vlan-switch brief' command. The issue i'm having is that after saving with the 'copy run start' and then restart the switch, and do the same 'sh vlan-switch brief' , all the initially assigned port would go to the default vlan (vlan 1). That is, there would be no more switchports assigned to the initially configured vlans.
    please, any form of assistance with this issue is welcome. my email address is bakaretemiloluwa@yahoo.com

    ReplyDelete
  71. How to erase commands while configuring in console port. The delete and backspace keys never work

    ReplyDelete
  72. how to save run-configuration in gns3

    ReplyDelete
  73. can anyone explain how to change vtp versions in gns 3?

    ReplyDelete

UA-23728446-1