Using iTerm for GNS3

When using GNS3 to create Network Simulations, one of the items that stuck me was – how do I use my existing terminal client to login to the Cisco routers?

Follow these steps:

Open the GNS3 preferences dialog and navigate to the Console applications tab

The preferenes window

Under the Console application command for Telnet, click on the Edit button and paste the following script:

osascript -e 'set posix_path to do shell script "echo \"$PATH\""' -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 default profile command "sh"' -e '    set s to current session' -e '    tell s' -e '        set name to "%d"' -e '        write text "PATH=" & quoted form of posix_path & " exec telnet %h %p"' -e '    end tell' -e 'end tell' -e 'end tell'

The above script (poorly formatted) launches iTerm and logs each tab into the various routers you have configured.

Checkout the image below

Terminal window with 3 telnet terminals