Connecting to your Dynamips Lab

Now that you have your hardware up and running, how do you connect to your devices in Linux?

There are actually quite a few ways to accomplish this and I will briefly go over a few of them.

Note that all these methods will require the program ser2net.  This program will basically allow you telnet to your serial (usb in our case) ports!  Yes, it is as cool as it sounds.

Virtual Terminal Server

Now, you could use a real terminal server, but it is completely unnecessary.  I quickly sold mine once I discovered that you could easily virtualize one with dynamips.

For full instructions, check out my good pal Artem’s website: http://www.ccie4u.info

This is nice for people that are used to using a terminal server and comfortable with control-shift-6 x.  😉

Telnet in Multiple Tabs

This one is pretty straightforward.

Your net file should specify which port you want each device to be running on.

In Dynagen, it looks like this:

Dynagen management console for Dynamips and Pemuwrapper 0.11.0

Copyright (c) 2005-2007 Greg Anuzelli, contributions Pavel Skovajsa
=>
=> list
Name       Type       State      Server          Console
R1         3725       stopped    localhost:7200  2001
R2         3725       stopped    localhost:7200  2002
R3         3725       stopped    localhost:7200  2003
R4         3725       stopped    localhost:7200  2004
R5         3725       stopped    localhost:7200  2005
R6         3725       stopped    localhost:7200  2006
BB1        3725       stopped    localhost:7201  2011
BB2        3725       stopped    localhost:7201  2012
BB3        3725       stopped    localhost:7201  2013
FRSW       FRSW       always on  localhost:7201  n/a
=>

In the example above it is the number under the “Console” column.

All you have to do to console to a device is type telnet localhost port.

With a simple script you can launch each device in it’s own tab.

Here is an example with gnome-terminal:

gnome-terminal --tab -e "telnet localhost 2001" --tab -e "telnet localhost 2002" --tab -e "telnet localhost 2003"

It’s functional and very easy to use.

You could even use a terminal emulator with built-in bookmark support, etc, to simplify matters even further.

Screen

Ah, GNU Screen, where have you been all my life?

Screen has quickly become my favorite choice for connecting to my lab.

It’s flexible, highly configurable, and the learning curve is pretty low.

What’s awesome about Screen is that it fixes the main issue I had with terminal servers. Namely, it stores each “screen’s” buffer independently. You can easily scroll back after you’ve flipped through a few devices.  Screen uses vi-like navigation for scrolling back which may take some getting used to if you aren’t familiar with vi.

I was going to type up a tutorial but this site explains it better than I could:  http://inetpro.org/wiki/Using_GNU_Screen_w/_dynamips/dynagen

Give it a try, I think you will like it.

As you can see, I’ve probably barely scraped the surface.  That’s the beauty of Linux and I’m sure everyone has their own favorite way to connect.  Heck, I’m sure someone out there is still manually moving that console cable.  🙂  At the end of the day if you’re happy with your solution then keep at it.  Feel free to share you ideas and suggestions too, I love trying out new things.

Advertisements

About this entry