Customize iTerm2 to use with GNS3

Rate this post

Hi folks, today I’m goin to show you how to get the best of iTerm2 to use with GNS3 the idea is to use a custom script to connect to devices in GNS3 using iTerm2 tabs and use the Badge feature of iTerm2 to show the device who we are connected.

First we need to create a profile in iTerm2 I’ll recommend to call it GNS3.

iTerm2 Preferences

We need to put “\(session.name)” in the Badge field, that will configure the badge of windows with the name of the device we’re using in GNS3.

After that we goin to customize the profile, as you can see I use a semi transparent red color for the badge.

iTerm2 Preferences

Now it’s time to configure the GNS3 client, we coint to GNS3 -> preferences  and in the General menu we select the Console applications tab.

GNS3 Console Application Settings

And then click on the Edit button.

GNS3 Custom Console Application

Then we goin to select Custom in the drop down menu and paste the following Code:

osascript -e 'tell application "iTerm"' -e 'activate' -e 'if (count of windows) = 0 then' -e '   set t to (create window with default profile)' -e 'else' -e '   set t to current window' -e 'end if' -e 'tell t' -e '    create tab with profile "GNS3" command "sh"' -e '    set s to current session' -e '    tell s' -e '        set name to "%d"' -e '        write text "PATH=\"" & (system attribute "PATH") & "\" exec telnet %h %p"' -e '    end tell' -e 'end tell' -e 'end tell'

Take in consideration that in the script we reference the name of the  iTerm2 Profile if you use a name thats is different from GNS3 you need to modify it.

Then click ok in the ok and ok to save the settings.

The script will open iTerm2 app and create a new tab with the selected profile for each connection in GNS3.

the following is an example of a running session with this configuration in a simple GNS3 Tolology:

 

This slideshow requires JavaScript.

As you can see you can use the devices in tabs or rearrange these tabs to see and type in the devices at the same time using the broadcast input feature of iTerm2.

Now enjoy your lab with this little hacks 😉

Tagged , , , . Bookmark the permalink.

Leave a Reply