{"id":482,"date":"2009-12-14T21:10:45","date_gmt":"2009-12-14T19:10:45","guid":{"rendered":"http:\/\/www.netexpertise.eu\/en\/?p=482"},"modified":"2021-10-05T20:29:03","modified_gmt":"2021-10-05T18:29:03","slug":"virtual-cisco-router","status":"publish","type":"post","link":"http:\/\/www.netexpertise.eu\/en\/systems\/linux\/virtual-cisco-router.html","title":{"rendered":"A Virtual Cisco Router on your Network"},"content":{"rendered":"\n<p>Dynamips and dynagen let you create a virtual <a href=\"\/en\/category\/networking\/cisco\">Cisco<\/a> router on a Linux box. It would be even better if that router was reachable from the LAN, wouldn&#8217;t it? Going further, that same router could lead us to another couple of virtual routers running in a lab.<br>&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Download and Installation<\/h3>\n\n\n\n<p>Download dynamips and dynagen from <a href=\"https:\/\/sourceforge.net\/projects\/dyna-gen\/files\/\" target=\"_blank\" rel=\"noreferrer noopener\">sourceforge.net<\/a>. Pay attention Dynagen last version 0.11.0 requires Dynamips 0.2.8-RC2.<br>The 2 programs are provided as rpm packages for Redhat\/Fedora.<br>&nbsp;<br>On other Linux systems such as Debian or Ubuntu, Dynagen is provided as an archive you can extract and from which dynagen can be linked from a bin directory of yours. As for Dynamips, it needs to be taken out from the rpm. You can also <a href=\"\/count\/click.php?id=12\">download<\/a> it from netexpertise.eu.<br>You may get an error while running dynamips:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">[root@cisco_host]$ dynamips -h\ndynamips: error while loading shared libraries:\nlibpcap.so.0.9: cannot open shared object file: No such file or directory\n\n[root@cisco_host]$ ln -s \/usr\/lib\/libpcap.so.0.9.8 \/usr\/lib\/libpcap.so.0.9<\/code><\/pre>\n\n\n\n<p>&nbsp;<br>A symbolic link should sort things out.<br>&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Install Network Utilities<\/h3>\n\n\n\n<p>The 2 following tools are needed:<br>&#8211; brctl from bridge-utils package (on all Linux flavours) &#8211; to create a bridge<br>&#8211; tunctl from <a href=\"http:\/\/rpmfind.net\/linux\/rpm2html\/search.php?query=tunctl\" target=\"_blank\" rel=\"noreferrer noopener\">rpmfind<\/a> for Redhat\/Fedora and uml-utilities for Debian\/Ubuntu &#8211; to create a tap interface. This isn&#8217;t absolutely needed since dynagen can create a tap interface on its own but is definately handy.<br>&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Create Bridge and Connect to the Network<\/h3>\n\n\n\n<p>Bridge br0 will be made up of the eth1 interface connected to the LAN and tap0 linked to the Cisco router. 192.168.0.100 is the Linux box IP.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">[root@cisco_host]$ brctl addbr br0\n[root@cisco_host]$ ifconfig br0 up\n[root@cisco_host]$ ifconfig eth1 0.0.0.0\n[root@cisco_host]$ brctl addif br0 eth1\n[root@cisco_host]$ ifconfig br0 192.168.0.100 netmask 255.255.255.0 up<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><br>Virtual Cisco Router Configuration File<\/h3>\n\n\n\n<p>Create the following Dynagen configuration file. You will need to copy your own Cisco image on your server as this is proprietary indeed. This is where we map the Cisco f0\/0 interface to tap0.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"vim\" class=\"language-vim\">[localhost]\nworkingdir = \/tmp\n\n    [[ 7200 ]]\n    image = \/root\/c7200-js-mz.124-3.bin\n    ram = 128\n    idlepc = 0x6082c30c\n\n    [[ router R1 ]]\n    console = 2001\n    f0\/0 = NIO_tap:tap0<\/code><\/pre>\n\n\n\n<p>\u00a0<br>I suggest you check <a href=\"http:\/\/dynagen.org\/tutorial.htm#_Toc193247999\" target=\"_blank\" rel=\"noreferrer noopener\">dynagen tutorial<\/a> to find out what&#8217;s your your best idlepc value so you do not get your CPU load rise to 100%. We can then launch Dynamips hypervisor and Dynagen to run the virtual router.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">[root@cisco_host]$ dynamips -H 7200&amp;\n[1] 2347\n[root@cisco_host]$ Cisco Router Simulation Platform (version 0.2.8-RC2-x86)\nCopyright (c) 2005-2007 Christophe Fillot.\nBuild date: Apr 20 2008 12:25:53\nHypervisor TCP control server started (port 7200).\n\n[root@cisco_host]$ dynagen router.net\nReading configuration file...\n\nShutdown in progress...\nShutdown completed.\nNetwork successfully loaded\n\nDynagen management console for Dynamips and Pemuwrapper 0.11.0\nCopyright (c) 2005-2007 Greg Anuzelli, contributions Pavel Skovajsa\n\n=&gt;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><br>Adding the Cisco Router to the Bridge<\/h3>\n\n\n\n<p>tap0 has now been created by Dynagen and can now be brought up and added to the bridge.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">[root@cisco_host]$ brctl addif br0 tap0\n[root@cisco_host]$ ifconfig tap0 up<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><br>Connect to the Router<\/h3>\n\n\n\n<p>Connect on the router with telnet on port 2001 &#8211; as set in the configuration file earlier &#8211; and experience the console as if you were on a real Cisco router IOS.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"vim\" class=\"language-vim\">[root@cisco_host]$ telnet localhost 2001\nrouter>enable\nrouter#show interface summary\n\n *: interface is up\n IHQ: pkts in input hold queue     IQD: pkts dropped from input queue\n OHQ: pkts in output hold queue    OQD: pkts dropped from output queue\n RXBS: rx rate (bits\/sec)          RXPS: rx rate (pkts\/sec)\n TXBS: tx rate (bits\/sec)          TXPS: tx rate (pkts\/sec)\n TRTL: throttle count\n\n  Interface              IHQ   IQD  OHQ   OQD  RXBS RXPS  TXBS TXPS TRTL\n------------------------------------------------------------------------\n* FastEthernet0\/0          0     0    0     0     0    0     0    0    0\n  FastEthernet0\/1          0     0    0     0     0    0     0    0    0\nNOTE:No separate counters are maintained for subinterfaces\n     Hence Details of subinterface are not shown\n\nrouter#conf t\nEnter configuration commands, one per line.  End with CNTL\/Z.\nrouter(config)#int fa0\/0\nrouter(config-if)#ip address 192.168.0.101 255.255.255.0\nrouter(config-if)#no shutdown\nrouter(config-if)#end\nrouter#\n\nrouter#ping 192.168.0.1\n\nType escape sequence to abort.\nSending 5, 100-byte ICMP Echos to 192.168.0.1, timeout is 2 seconds:\n!!!!!\nSuccess rate is 100 percent (5\/5), round-trip min\/avg\/max = 8\/11\/16 ms\nrouter#ping 192.168.0.100\n\nType escape sequence to abort.\nSending 5, 100-byte ICMP Echos to 192.168.0.100, timeout is 2 seconds:\n.!!!!\nSuccess rate is 80 percent (4\/5), round-trip min\/avg\/max = 4\/20\/36 ms<\/code><\/pre>\n\n\n\n<p>&nbsp;<br>192.168.0.1 being the gateway or a device on the LAN.<br>You can now virtualize as many Cisco routers as you wish, within the limits of your machine&#8217;s resources.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Dynamips and dynagen let you create a virtual Cisco router on a Linux box. It would be even better if that router was reachable from the LAN, wouldn&#8217;t it? Going further, that same router could lead us to another couple of virtual routers running in a lab.&nbsp; Download and Installation Download dynamips and dynagen from [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[21,11],"tags":[388,169,386,274,290],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.8.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Netexpertise - A Virtual Cisco Router on your Network<\/title>\n<meta name=\"description\" content=\"Create a virtual Cisco router on Linux with real Cisco images, and make it reachable from the network\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.netexpertise.eu\/en\/systems\/linux\/virtual-cisco-router.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Netexpertise - A Virtual Cisco Router on your Network\" \/>\n<meta property=\"og:description\" content=\"Create a virtual Cisco router on Linux with real Cisco images, and make it reachable from the network\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.netexpertise.eu\/en\/systems\/linux\/virtual-cisco-router.html\" \/>\n<meta property=\"og:site_name\" content=\"Netexpertise\" \/>\n<meta property=\"article:published_time\" content=\"2009-12-14T19:10:45+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-10-05T18:29:03+00:00\" \/>\n<meta name=\"author\" content=\"dave\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@netexpertise\" \/>\n<meta name=\"twitter:site\" content=\"@netexpertise\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.netexpertise.eu\/en\/systems\/linux\/virtual-cisco-router.html\",\"url\":\"https:\/\/www.netexpertise.eu\/en\/systems\/linux\/virtual-cisco-router.html\",\"name\":\"Netexpertise - A Virtual Cisco Router on your Network\",\"isPartOf\":{\"@id\":\"http:\/\/www.netexpertise.eu\/en\/#website\"},\"datePublished\":\"2009-12-14T19:10:45+00:00\",\"dateModified\":\"2021-10-05T18:29:03+00:00\",\"author\":{\"@id\":\"http:\/\/www.netexpertise.eu\/en\/#\/schema\/person\/cb4cd666549d22e9070ec1cfc1a496fa\"},\"description\":\"Create a virtual Cisco router on Linux with real Cisco images, and make it reachable from the network\",\"breadcrumb\":{\"@id\":\"https:\/\/www.netexpertise.eu\/en\/systems\/linux\/virtual-cisco-router.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.netexpertise.eu\/en\/systems\/linux\/virtual-cisco-router.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.netexpertise.eu\/en\/systems\/linux\/virtual-cisco-router.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/www.netexpertise.eu\/en\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"A Virtual Cisco Router on your Network\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/www.netexpertise.eu\/en\/#website\",\"url\":\"http:\/\/www.netexpertise.eu\/en\/\",\"name\":\"Netexpertise\",\"description\":\"Systems \/ Networks \/ DevOps\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/www.netexpertise.eu\/en\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"http:\/\/www.netexpertise.eu\/en\/#\/schema\/person\/cb4cd666549d22e9070ec1cfc1a496fa\",\"name\":\"dave\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/www.netexpertise.eu\/en\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/1.gravatar.com\/avatar\/1129916e1f4955bd632f27f836f64e55?s=96&d=mm&r=g\",\"contentUrl\":\"http:\/\/1.gravatar.com\/avatar\/1129916e1f4955bd632f27f836f64e55?s=96&d=mm&r=g\",\"caption\":\"dave\"},\"sameAs\":[\"http:\/\/www.netexpertise.eu\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Netexpertise - A Virtual Cisco Router on your Network","description":"Create a virtual Cisco router on Linux with real Cisco images, and make it reachable from the network","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.netexpertise.eu\/en\/systems\/linux\/virtual-cisco-router.html","og_locale":"en_US","og_type":"article","og_title":"Netexpertise - A Virtual Cisco Router on your Network","og_description":"Create a virtual Cisco router on Linux with real Cisco images, and make it reachable from the network","og_url":"https:\/\/www.netexpertise.eu\/en\/systems\/linux\/virtual-cisco-router.html","og_site_name":"Netexpertise","article_published_time":"2009-12-14T19:10:45+00:00","article_modified_time":"2021-10-05T18:29:03+00:00","author":"dave","twitter_card":"summary_large_image","twitter_creator":"@netexpertise","twitter_site":"@netexpertise","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.netexpertise.eu\/en\/systems\/linux\/virtual-cisco-router.html","url":"https:\/\/www.netexpertise.eu\/en\/systems\/linux\/virtual-cisco-router.html","name":"Netexpertise - A Virtual Cisco Router on your Network","isPartOf":{"@id":"http:\/\/www.netexpertise.eu\/en\/#website"},"datePublished":"2009-12-14T19:10:45+00:00","dateModified":"2021-10-05T18:29:03+00:00","author":{"@id":"http:\/\/www.netexpertise.eu\/en\/#\/schema\/person\/cb4cd666549d22e9070ec1cfc1a496fa"},"description":"Create a virtual Cisco router on Linux with real Cisco images, and make it reachable from the network","breadcrumb":{"@id":"https:\/\/www.netexpertise.eu\/en\/systems\/linux\/virtual-cisco-router.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.netexpertise.eu\/en\/systems\/linux\/virtual-cisco-router.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.netexpertise.eu\/en\/systems\/linux\/virtual-cisco-router.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/www.netexpertise.eu\/en"},{"@type":"ListItem","position":2,"name":"A Virtual Cisco Router on your Network"}]},{"@type":"WebSite","@id":"http:\/\/www.netexpertise.eu\/en\/#website","url":"http:\/\/www.netexpertise.eu\/en\/","name":"Netexpertise","description":"Systems \/ Networks \/ DevOps","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/www.netexpertise.eu\/en\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"http:\/\/www.netexpertise.eu\/en\/#\/schema\/person\/cb4cd666549d22e9070ec1cfc1a496fa","name":"dave","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/www.netexpertise.eu\/en\/#\/schema\/person\/image\/","url":"http:\/\/1.gravatar.com\/avatar\/1129916e1f4955bd632f27f836f64e55?s=96&d=mm&r=g","contentUrl":"http:\/\/1.gravatar.com\/avatar\/1129916e1f4955bd632f27f836f64e55?s=96&d=mm&r=g","caption":"dave"},"sameAs":["http:\/\/www.netexpertise.eu"]}]}},"_links":{"self":[{"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/posts\/482"}],"collection":[{"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/comments?post=482"}],"version-history":[{"count":0,"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/posts\/482\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/media?parent=482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/categories?post=482"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/tags?post=482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}