Monday, October 17, 2011

Cambio a JunOS

La cosa no es tan fácil como pensaba al principio, merece toda mi atención la migración mental de IOS (Cisco) a JUNOS (Juniper).

Para empezar esta la costumbre de preparar templates (borradores) de configuración para luego aplicarlos... ok en Juniper no funciona igual, para lograrlo debes hacer el siguiente comando en modo de configuración;

root@kk# load ?
Possible completions:
factory-default Override existing configuration with factory default
merge Merge contents with existing configuration
override Override existing configuration
patch Load patch file into configuration
replace Replace configuration data
set Execute set of commands on existing configuration
update Update existing configuration


root@kk# load replace ?
Possible completions:
Filename (URL, local, remote, or floppy)
2674123.txt Size: 1771, Last changed: Aug 27 11:54:44
relative Load contents relative to current edit point
terminal Use login terminal

root@kk# load replace terminal ?
Possible completions:
<[Enter]> Execute this command
relative Load contents relative to current edit point
| Pipe through a command


Para detener el modo de edición venoso ;) se debe presionar ctrl+d

Luego si no hay errores en la configuración con un "commit" estará lista para ser usada la configuración. Ahora si hay errores pues hay que ver de que se tratan y tratar de repararlos... eso si recuerden que como el formato de edición esta basado en corchetes {} hay que fijarse que siempre estén todas las llaves cerradas.

root@kk# load replace terminal
[Type ^D at a new line to end input]

##configuraciones varias...

load complete


Entonces el comando mágico para editar al estilo Cisco (IOS) seria:

load replace terminal




#########################
OPCIONES QUE LEER:
#########################

merge:
Combines the current configuration and the configuration in filename or the one that you type at the terminal. A merge operation is useful when you are adding a new section to an existing configuration. If the existing configuration and the incoming configuration contain conflicting statements, the statements in the incoming configuration override those in the existing configuration.

override:
Discards the current candidate configuration and loads the configuration in filename or the one that you type at the terminal. When you use the override option and commit the configuration, all system processes reparse the configuration. You can use the override option at any level of the hierarchy.

replace: http://www.blogger.com/img/blank.gif
Searches for the replace tags, deletes the existing statements of the same name, if any, and replaces them with the incoming configuration. If there is no existing statement of the same name, the replace operation adds the statements marked with the replace tag to the configuration.

Note: For this operation to work, you must include replace tags in the text file or configuration you type at the terminal.



Source: http://www.juniper.net/techpubs/en_US/junos10.0/information-products/topic-collections/nog-baseline/junos-copy-paste-configuration.html

No comments:

Post a Comment