Using GNU Screen w/ dynamips/dynagen

From Internetworkpro
Jump to: navigation, search
Configuration.png This page or section provides device configuration instructions
Please note that the information on this page has not been checked for accuracy and is not intended as a replacement to documentation. Please ensure you understand your desired objectives before attempting to apply any examples listed.
See more examples at Category:Configuration
Blank.png This page contains configuration examples or information on dynamips
The examples on this page are intended for use with dynamips, the Cisco router emulator. This information is not intended for use on hardware routers, and is primarily used for troubleshooting, testing, and certification lab study.
Support of Dynamips is found on Hackis_Forum. For other dynamips pages see Category:Dynamips

Just correct the scripts for your setup and run "screen -c load.dynagui.screenrc" and "screen -c telnet.screenrc" in 2 seperate putty/ssh sessions and you're gold!


telnet.screenrc:


hardstatus alwayslastline "%{rk}%H %{gk}%c %{yk}%M%d %{wk}%?%-Lw%?%{bw}%n*%f %t%?(%u)%?%{wk}%?%+Lw%?"
screen -t BB 0
screen -t R1 1
screen -t R2 2
screen -t R3 3
screen -t R4 4
screen -t R5 5
screen -t R6 6
screen -t SW1 7
screen -t SW2 8
at R1 stuff "telnet localhost 2000 \015"
at R2 stuff "telnet localhost 2001 \015"
at R3 stuff "telnet localhost 2002 \015"
at R4 stuff "telnet localhost 2003 \015"
at R5 stuff "telnet localhost 2004 \015"
at R6 stuff "telnet localhost 2005 \015"
at SW1 stuff "telnet localhost 2006 \015"
at SW2 stuff "telnet localhost 2007 \015"

load.dynagui.screenrc:
RUN FIRST, THIS LOADS DYNAGEN/DYNAMIPS INSTANCES!


hardstatus alwayslastline "%{rk}%H %{gk}%c %{yk}%M%d %{wk}%?%-Lw%?%{bw}%n*%f %t%?(%u)%?%{wk}%?%+Lw%?"
screen -t hyper 0
screen -t dgen 1
at hyper stuff "/home/cisco/current/dyna -H 7200 & \015"
at hyper stuff "/home/cisco/current/dyna -H 7201 & \015"
at dgen stuff "sleep 2;/home/cisco/current/dgen/dynagen /home/cisco/current/auto.net \015"

FWIW, I stole this code from someone else on #cisco... forgot who. KEwlb maybe?
--Loceur 22:30, 23 January 2007 (CST)


[edit] Yeah, I think I'm cooler than locuer AND kewlb!, check this out;

Edit your dynagen.ini file (On my machine, find it in /usr/bin/dynagen.ini), and change the telnet= line:

telnet = screen -X screen -t "%d Dynamips (%h:%p)" -l `if [ -z "\`ps axu | grep 'telnet %h %p' | grep -v grep\`" ]; then echo telnet %h %p; else echo '/bin/false'; fi`

Fire up dynagen, then just type con /all to open up all of your console windows. --Sartan 00:49, 23 December 2008 (CST)

Personal tools
Namespaces

Variants
Actions
Navigation
Categories
Toolbox