Ian P. Christian's Personal Blog Random witterings from pookey

24Apr/103

Configuring a Cisco 2509-RJ terminal server

I recently purchased myself a cisco 2509-RJ, which is similar to the 2509 / 2511, however rather than an octopus cable to connect to other devices, RJ45-RJ45 rollover cables are used. This article shows a full configuration example and details on the cables required. The configuration allows for reverse telneting into other devices.

This configuration below allows you to telnet to the router (192.168.1.1) and get presented with a menu to access all other connected devices, or alternatively telnet to 192.168.1.1 on port 2001 to connect to the first line, 2002 for the second line and so on. If you connect to other devices via the menu or by connecting to a line from the prompt on the 2509, you can exit the session by using ctrl-^ x (ctrl+shift+6, then x).


!
version 12.2
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname access
!
enable secret 5 $1$pczA$NtVMhZZyro2YQdYXOstu0.
enable password cisco
!
username pookey password 0 cisco
ip subnet-zero
no ip domain-lookup
ip host port8 2008 192.168.0.1
ip host port7 2007 192.168.0.1
ip host port6 2006 192.168.0.1
ip host port5 2005 192.168.0.1
ip host port4 2004 192.168.0.1
ip host port3 2003 192.168.0.1
ip host port2 2002 192.168.0.1
ip host port1 2001 192.168.0.1
!
ip ssh time-out 120
ip ssh authentication-retries 3
!
!
!
!
interface Loopback0
ip address 192.168.0.1 255.255.255.255
!
interface Ethernet0
ip address 192.168.1.1 255.255.255.0
!
interface Serial0
no ip address
shutdown
!
ip classless
no ip http server
ip pim bidir-enable
!
!
menu cserver title ^C

To get back to the menu press "CTRL+SHIFT+6"
then "X". You must then clear the connection and
begin a new console session to re-connect to
that device.
--------------------------------------------------------
1 - Connect to console1 | c1 - clear console 1
2 - Connect to console2 | c2 - clear console 2
3 - Connect to console3 | c3 - clear console 3
4 - Connect to console4 | c4 - clear console 4
5 - Connect to console5 | c5 - clear console 5
6 - Connect to console6 | c6 - clear console 6
7 - Connect to console7 | c7 - clear console 7
8 - Connect to console8 | c8 - clear console 8
--------------------------------------------------------
show - show lines in use | prompt - exit menu
Exit - logout |
--------------------------------------------------------^C
menu cserver prompt ^CPlease enter command or selection:^C
menu cserver command 1 telnet port1
menu cserver command 2 telnet port2
menu cserver command 3 telnet port3
menu cserver command 4 telnet port4
menu cserver command 5 telnet port5
menu cserver command 6 telnet port6
menu cserver command 7 telnet port7
menu cserver command 8 telnet port8
menu cserver command cl1 cl1
menu cserver command cl2 cl2
menu cserver command cl3 cl3
menu cserver command cl4 cl4
menu cserver command cl5 cl5
menu cserver command cl6 cl6
menu cserver command cl7 cl7
menu cserver command cl8 cl8
menu cserver command menuexit menu-exit
menu cserver command exit exit
menu cserver command show show line tty 1 8
menu cserver options show pause
menu cserver command c1 clear line 1
menu cserver command c2 clear line 2
menu cserver command c3 clear line 3
menu cserver command c4 clear line 4
menu cserver command c5 clear line 5
menu cserver command c6 clear line 6
menu cserver command c7 clear line 7
menu cserver command c8 clear line 8
menu cserver command prompty menu-exit
menu cserver clear-screen
menu cserver single-space
!
line con 0
logging synchronous
line 1 8
no exec
exec-timeout 0 0
transport input all
telnet break-on-ip
telnet sync-on-break
telnet ip-on-break
flowcontrol hardware
line aux 0
line vty 0 4
password cisco
login local
autocommand menu cserver
!
end

As you can see from the 'autocommand' used both for my user (pookey) and globally on the VTYs, the menu is shown on login. This is how it looks:

On a 2509RJ, the cable required to connect the console ports is a rollover cable, with an RJ45 at both ends. This looks like this:

sorry it's not very clear! I only have my phone for taking pictures!

These cables can be made pretty easily by cutting up a standard Cisco rollover cable and crimping an RJ45 on each end. For lab use, you can easily get 3 or 4 shorter rollover cables from one of Cisco's standard serial cable.

show line will show which lines are active:

access#show lin
   Tty Typ     Tx/Rx    A Modem  Roty AccO AccI   Uses   Noise  Overruns   Int
     0 CTY              -    -      -    -    -      0       0     0/0       -
     1 TTY   9600/9600  -    -      -    -    -      1       1     0/0       -
*    2 TTY   9600/9600  -    -      -    -    -      1      40     0/0       -
     3 TTY   9600/9600  -    -      -    -    -      0       0     0/0       -
     4 TTY   9600/9600  -    -      -    -    -      0       0     0/0       -
     5 TTY   9600/9600  -    -      -    -    -      0       0     0/0       -
     6 TTY   9600/9600  -    -      -    -    -      0       0     0/0       -
     7 TTY   9600/9600  -    -      -    -    -      0       0     0/0       -
     8 TTY   9600/9600  -    -      -    -    -      0       0     0/0       -
     9 AUX   9600/9600  -    -      -    -    -      0       0     0/0       -
    10 VTY              -    -      -    -    -      3       0     0/0       -
*   11 VTY              -    -      -    -    -      2       0     0/0       -
    12 VTY              -    -      -    -    -      2       0     0/0       -
    13 VTY              -    -      -    -    -      0       0     0/0       -
    14 VTY              -    -      -    -    -      0       0     0/0       -

You can see that line 2 is active at the moment, this is active in this case because I've a telnet session open to port 2001. This means trying to attach to this from the 2509 will fail:

access#port2
Trying port2 (192.168.0.1, 2002)...
% Connection refused by remote host

I have to clear it before I can connect:

access#clear line 2
[confirm]
 [OK]

Below you can see a connection starting, then me pressing ctrl+^ x to return to the access server.

access#port2
Trying port2 (192.168.0.1, 2002)... Open

Switch>
access#
Comments (3) Trackbacks (0)
  1. Cheers for this – not seen an example config for the Menu system anywhere else. Very useful!


Leave a comment

No trackbacks yet.