: La Interfaz de Línea de Comandos (CLI) de un Router Última actualización: 29 de Noviembre de 2003 Autor: Eduardo Collado edu@eduangi.com : 1
Contenido Accediendo a un router Cisco Por consola con GNU/Linux Por consola con Windows Por módem Por telnet Modos de acceso Comandos Funciones de ayuda del router 2
Accediendo a un router (I) A un router se puede acceder mediante un terminar o acceder a el de forma remota. Acceso consola mediante minicom a través de un GNU/Linux Acceso consola mediante Hyperterminal a través de un Windows 3
Accediendo a un router (II) El software que utilicemos de conexión de consola tendrá la siguiente configuración: 9600 bits por segundo Sin control de flujo 8 bits de datos Sin paridad 1 Bit de stop 4
Accediendo a un router (III) Para conectarnos por consola a un router tenemos que conectar el cable de consola en el puerto por ejemplo COM1 (Windows) ttys0 (Linux) con el DB-9 y con extremo RJ-45 en el puerto console del router. 5
Accediendo a un router (IV) Para conectarnos por consola a un router desde un módem conectaremos un extremo DB-25 en el módem y el RJ-45 en el puerto aux del router. 6
Accediendo a un router (V) Para conectarnos mediante telnet (una vez tenga una dirección IP configurada y el cableado instalado lo haremos directamente utilizando el comando telnet de cualquier Sistema Operativo. 7
Registrarse en un router Cisco Antes de empezar hemos de considerar que existen tres tipos básicos de modos en un router Cisco. Modo de usuario: En el que se entra por defecto, nos permite pocas opciones. Modo Privilegiado: Entramos en el mediante el comando enable, ya podemos hacer más cosas. Modo de Configuración: Entramos en el mediante el comando configure terminal, en este modo ya es posible modificar la configuración del router. 8
Modos de un router Cisco User Access Verification Prompt del modo de usuario Password:xxxxxxxx Router-Cisco>enable Password:xxxxxxxx Prompt del modo privilegiado Router-Cisco#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router-Cisco(config)#exit Router-Cisco#disable Prompt del modo de configuración Router-Cisco> Nombre del router 9
Lista de comandos del modo usuario (I) Para obtener los comandos posibles utilizaremos el caracter? <1-99> Session number to resume access-enable Create a temporary Access-List entry access-profile Apply user-profile to interface clear Reset functions connect Open a terminal connection disable Turn off privileged commands disconnect Disconnect an existing network connection enable Turn on privileged commands exit Exit from the EXEC help Description of the interactive help system lat Open a lat connection lock Lock the terminal login Log in as a particular user logout Exit from the EXEC mrinfo Request neighbor and version information from a multicast router mstat Show statistics after multiple multicast traceroutes mtrace Trace reverse multicast path from destination to source name-connection Name an existing network connection 10
Lista de comandos del modo usuario (II) pad Open a X.29 PAD connection ping Send echo messages ppp Start IETF Point-to-Point Protocol (PPP) resume Resume an active network connection rlogin Open an rlogin connection show Show running system information slip Start Serial-line IP (SLIP) systat Display information about terminal lines telnet Open a telnet connection terminal Set terminal line parameters tn3270 Open a tn3270 connection traceroute Trace route to destination tunnel Open a tunnel connection udptn Open an udptn connection where List active connections x28 Become an X.28 PAD x3 Set X.3 parameters on PAD xremote Enter XRemote mode 11
Lista de comandos del modo privilegiado (I) Para obtener los comandos posibles utilizaremos el caracter? <1-99> Session number to resume access-enable Create a temporary Access-List entry access-profile Apply user-profile to interface access-template Create a temporary Access-List entry alps ALPS exec commands archive manage archive files bfe For manual emergency modes setting cd Change current directory clear Reset functions clock Manage the system clock configure Enter configuration mode connect Open a terminal connection copy Copy from one file to another debug Debugging functions (see also 'undebug') delete Delete a file dir List files on a filesystem disable Turn off privileged commands disconnect Disconnect an existing network connection enable Turn on privileged commands erase Erase a filesystem exit Exit from the EXEC help Description of the interactive help system isdn Run an ISDN EXEC command on a BRI interface 12
Lista de comandos del modo privilegiado (II) lat Open a lat connection lock Lock the terminal login Log in as a particular user logout Exit from the EXEC more Display the contents of a file mrinfo Request neighbor and version information from a multicast router mrm IP Multicast Routing Monitor Test mstat Show statistics after multiple multicast traceroutes mtrace Trace reverse multicast path from destination to source name-connection Name an existing network connection ncia Start/Stop NCIA Server no Disable debugging functions pad Open a X.29 PAD connection ping Send echo messages ppp Start IETF Point-to-Point Protocol (PPP) pwd Display current working directory reload Halt and perform a cold restart rename Rename a file restart Restart Connection resume Resume an active network connection rlogin Open an rlogin connection 13
Lista de comandos del modo privilegiado (III) rsh Execute a remote command rtr RTR Exec Configuration sdlc Send SDLC test frames send Send a message to other tty lines setup Run the SETUP command facility show Show running system information slip Start Serial-line IP (SLIP) start-chat Start a chat-script on a line systat Display information about terminal lines tarp TARP (Target ID Resolution Protocol) commands telnet Open a telnet connection terminal Set terminal line parameters test Test subsystems, memory, and interfaces tn3270 Open a tn3270 connection traceroute Trace route to destination tunnel Open a tunnel connection udptn Open an udptn connection undebug Disable debugging functions (see also 'debug') verify Verify a file where List active connections which-route Do OSI route table lookup and display results write Write running configuration to memory, network, or terminal x28 Become an X.28 PAD x3 Set X.3 parameters on PAD xremote Enter XRemote mode 14
Uso de las funciones de ayuda del router Comando help Router-Cisco#help Help may be requested at any point in a command by entering a question mark '?'. If nothing matches, the help list will be empty and you must backup until entering a '?' shows the available options. Two styles of help are provided: 1. Full help is available when you are ready to enter a command argument (e.g. 'show?') and describes each possible argument. 2. Partial help is provided when an abbreviated argument is entered and you want to know what arguments match the input (e.g. 'show pr?'.) Ejemplo: Router-Cisco#show interface? Async BVI CTunnel Dialer Async interface Bridge-Group Virtual Interface CTunnel interface Dialer interface Ethernet IEEE 802.3 Loopback Multilink Null Serial............ Loopback interface Multilink-group interface Null interface Serial 15
Uso de comandos de edición de IOS Ctrl + A Mueve el cursor hasta el principio de la línea de comandos. Ctrl + E Mueve el cursor hasta el final de la línea de comandos. Esc + B Retrocede unapalabra. Ctrl + F Avanza un caracter. Ctrl + B Retrocede un caracter. Esc + F Avanza una palabra. 16
Uso del historial de comandos de IOS Crtl + P o Flecha arriba Recupera el último comando Crtl + N o Flecha abajo Recupera el comando más reciente show history Muestra el buffer de comandos terminal history [size número_de_lineas] Ajusta el tamaño del buffer no terminal editing Desactiva las funciones de edición avanzadas terminal editing Reactiva las funciones de edición avanzadas Tecla de tabular Completa la entrada 17
Bibliografía del Tema 17 Guía del Primer Año Ed. Cisco Press [Cap.17] 18