Micronics
  • Home
  • Links
  • Contact
Home » Tutorials

Part 2 of Dynamips External Cloud Interface on Linux

1 July 2008 10 Comments

Part 2 of Dynamips External Cloud Interface on Linux

Ok, so you want to make the network changes made in Part 1 permanent? Well its easier than Part 1. Most Linux distributions use an initalization system called “init”. Init is responsible for the way the linux system boots. So what daemons(services) are started, What order they are started in. Init uses scripts located in /etc/init.d/ to control these daemons. So I have taken a script from http://farfewertoes.com/ which was created for virtual box and modified it for dynamips. From your perspective this script does not need any modification as its using a config file.

First you need to download these two file dynamips and config Please remember where you saved them to. Then we need to install the dynamips control script. Do this by opening a terminal and changing to the root user.(su or sudo depending on distro) Then execute the following command which will copy the file to the /etc/init.d/

cp /path/to/your/download/directory/dynamips /etc/init.d/

Secondly so init can launch the script we need to make it executable with the following command.

chmod 755 /etc/init.d/dynamips

The configuration file needs to reside in a directory called dynamips under /etc. This directory doesn’t exist yet so do this by entering

mkdir /etc/dynamips

Now copy the configuration file to the newly created directory

cp /path/to/your/download/directory/config /etc/dynamips

Its time to modify the configuration file with values appropriate for your setup. If your familiar with console based editors great, Otherwise if you want to use a gui based editor you will most likely have to make the file writable for your user. Do this by entering

chmod 666 /etc/dynamips/code

This is a sample of the configuration file, The options are explained below so its time to put in your settings.

HOST_IF="eth1"
HOST_SETUP="static"
HOST_IPADDR="192.168.1.10/24"
HOST_GW="192.168.1.1"
DYNA_USER="user1"
TAPS="tap0"

HOST_IF=”eth1″   - Replace eth1 with your network card name, It might be eth0, eth1, eth2, wlan0. Refer to part1 if your not sure.

HOST_SETUP=”static” - So static means your statically configuring your card, dhcp means autoconfiguration and you can leave HOST_IPADDR and HOST_GW blank.

HOST_IPADDR=’192.168.1.10/24″ - This is your static ip address with subnet mask represented in cidr notation.

HOST_GW=”192.168.1.1″ -  Place the ip address of your default gateway here.

DYNA_USER=”user1″ - This should be the name of the user who runs the dynamips/gns3 program

TAPS=”tap0″ - You desired tap interface name, so tap0 tap1 tap2 etc.

Ok all done? Make sure to save the file to and set the permissions back to norma with

chmod 644 /etc/dynamips/config

Now its time to test the setup, Do this by entering the following command as root.

/etc/init.d/dynamips start

The output should be similar to what I have below.

bash:/etc/init.d # /etc/init.d/dynamips start
Set 'tap0' persistent and owned by uid 501

The easiest way to verify the setup is to enter the commands ip a and ip r. Compare your output to the following. Take note of the br0 and tap0 interfaces. They have been created and activated and  the br0 interface has been given the correct ip address.  The routing table also has the correct default gateway address.

bash:/etc/init.d # ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
3: eth1: <NO-CARRIER,BROADCAST,MULTICAST,PROMISC,UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:12:3f:43:a4:b3 brd ff:ff:ff:ff:ff:ff
7: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue
link/ether 00:12:3f:43:a4:b3 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.10/24 scope global br0
8: tap0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 500
link/ether 00:ff:9c:3c:21:23 brd ff:ff:ff:ff:ff:ff

bash# ip r
192.168.1.0/24 dev br0  proto kernel  scope link  src 192.168.1.10
169.254.0.0/16 dev eth1  scope link
127.0.0.0/8 dev lo  scope link
default via 10.27.134.1 dev eth1

Its now time to fire up your relevant dynamips config and test access to the router. If you can succesfully access your router and want to have this configuration applied on startup. Enter the following code.

chkconfig dynamips on

If for some reason you change your mind. Disable the script with the following.

chkconfig dynamips off

The Previous two commands instruct the system to enable or disable our settings on certain events. The major ones being startup and shutdown. If you want to manually start the script you can enter the first of the following commands.  To stop it and remove the settings try the second command.

/etc/init.d/dynamips start
/etc/init.d/dynamips stop

Congratulations, You should now have working configuration that automatically starts on system boot. Please feel free to leave any comments or questions you may have.

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

10 Comments »

  • joshatterbury.com » Blog Archive » blog:Dynamips Virtual Rack setup with remote access with a Termserv said:

    [...] My project for the last couple of days has been to setup a training environment for the other people I work with. I must say I’m happy with the results. I have setup 4 virtual racks, Each rack consisting of 6 routers, 3 backbone routers. Fully meshed frame setup. 4 x 3700’s acting as layer3 switches using NM-16ESW.  Each rack is managed individually with the capability to start,stop the routers remotely. Add in a Terminal Server for easy access and the fact that its automatically started on boot…. :).       Hopefully tomorrow I get a chance to document it all and post it up here.  Including .net files for the racks and termserv, Config file for the TermServ and  the Linux initialization script thats a modified version of this one_here. [...]

    # 3 July 2008 at 4:38 pm
  • joshatterbury.com » Blog Archive » Dynamips Setup, Linux, TermServ and 4 virtual racks. said:

    [...] a prerequisite to this tutorial. I am assuming that you have already configured your system as per this article. So I hope you are already familiar with terms such as bridge, br-0 tap interface, cloud as they are [...]

    # 10 July 2008 at 12:07 pm
  • joshatterbury.com » Blog Archive » Part 1 of Dynamips External Cloud Interface on Linux said:

    [...] Thats it for now. Feel free to ask any questions you have. My next post will be how to apply that configuration on boot here it is [...]

    # 18 July 2008 at 10:55 pm
  • joshatterbury.com » Blog Archive » Tutorial: Part 1 of Ultimate Dynamips Dynagen config - focusing on start on boot with Terminal Servers said:

    [...] a prerequisite to this tutorial. I am assuming that you have already configured your system as per this article. So I hope you are already familiar with terms such as bridge, br-0 tap interface, cloud as they are [...]

    # 18 July 2008 at 11:05 pm
  • nobbycat said:

    Thanks very much for your work.

    I got the following message:

    service dynamips does not support chkconfig

    For my Mandriva system I had to add the following to the script to allow it to be added by chkconfig

    #chkconfig: 345 20 80
    #description: Tap and Bridge interface for dynamips

    # 24 January 2009 at 10:24 pm
  • blindhog.net » Linux Bridging for GNS3 LAN communications said:

    [...] I discovered that I was able to communicate with every device on the LAN except the actual host machine. While troubleshooting, I finally read the GNS3 FAQ. Then I learned how to solve the problem with Josh Atterbury’s posts: ‘Dynamips External Cloud Interface on Linux – Part1 and Part2. [...]

    # 19 January 2010 at 5:56 am
  • dj said:

    Just been scratching my head trying to get this working on a Virtual Machine running under VMWare ESX. Fix is to set vswitch properties (under security) to promiscuous mode. Hope this helps others with the same issue.

    # 19 October 2010 at 2:40 am
  • Bowo said:

    Thanks very much for your work.
    It’s mean so much to my research plan.

    One problem is, what if I had multiple NIC and I want to connect it all to my GNS3 project? Can I just add it all at config file?

    Many thanks before.

    Satriyo Wibowo
    - beginner -

    # 14 December 2010 at 12:37 pm
  • Gunner said:

    How do you get this to work with multiple NICs? I have a 4 port card and I want to bridge br0 (tap0 & eth0), br1 (tap1 & eth1) etc.

    My aim is to fit several quad cards to the PC so that I can bridge many router interfaces to external switches. Am I missing something with the scripts? I have the following in ‘config’:

    HOST_IF=”eth0″
    HOST_SETUP=”dhcp”
    HOST_IPADDR=”
    HOST_GW=”
    DYNA_USER=”user1″
    TAPS=”tap0″
    HOST_IF=”eth1″
    HOST_SETUP=”dhcp”
    HOST_IPADDR=”
    HOST_GW=”
    DYNA_USER=”user1″
    TAPS=”tap1″
    .
    etc etc…..
    .
    TAPS=”tap4″

    “brctl show” has br0 with eth4 & tap4 assigned.

    I’m running Ubuntu 10.10

    Many thanks.

    # 26 January 2011 at 6:41 am
  • Willie said:

    Thank you, was about to switch back to windows gns3 until seeing this post.

    Really appreciated.

    # 28 August 2011 at 8:54 pm

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.

Recent Comments

  • Farhan on Part 1 of Dynamips External Cloud Interface on Linux
  • Willie on Part 2 of Dynamips External Cloud Interface on Linux
  • Praveen on Tutorial: Part 1 of Ultimate Dynamips Dynagen config - focusing on start on boot with Terminal Servers
  • Juanlu on Part 1 of Dynamips External Cloud Interface on Linux
  • Thibault on Part 1 of Dynamips External Cloud Interface on Linux
  • Michal on Part 1 of Dynamips External Cloud Interface on Linux

    Blogroll

    • Colorlabs Project
    • Michael Jubel
    • Hanna Siahaan
    • Majari Magazine
    • The Bloggerzine
    • Majari Kanayakan
    Powered by WordPress | Log in | Entries (RSS) | Comments (RSS) | Arthemia theme by Michael Hutagalung