Sie sind auf Seite 1von 2

Acceso basado en roles y views.

A continuacin vamos a configurar un view que slo permite el uso de los comandos show interface. A
continuacin vamos a configurar un modo que al iniciar sesin a travs de telnet o ssh se habilitara un view
restringido.
Primeramente debemos acceder al view raiz. Otros views pueden ser nicamente creados o modificados desde el
modo view o view raiz.
Router(config)#aaa new-model
Router(config)#enable secret lalala
Router(config)#^Z
Router#disable
Router>enable view
*Mar 1 00:06:41.363: %PARSER-6-VIEW_SWITCH: successfully set to view root.
Ahora estamos en el root view y podemos crear un nuevo view llamado INTONLY.

Router#conf t
Router(config)#parser view INTONLY
*Mar 1 00:07:59.527: %PARSER-6-VIEW_CREATED: view INTONLY successfully created.
Ahora nosotros creamos un enable pass para este view y agregamos los comandos que deseamos. A menos que
los comandos configurados sean excluidos del view.

Router(config-view)#secret INTONLYPASS
Router(config-view)#commands exec include show interface

Ahora configuramos ssh y el aaa necesario

Router(config)#exit
Router(config)#ip domain name acme.com
Router(config)#crypto key generate rsa
Router(config)#aaa authorization exec default local
Router(config)#aaa authentication login default local enable
Router(config)#aaa authorization exec default local

El usuario INTGUY es restringido en el view INTONLY view y la prueba saldra para un usuario por defecto para otro
acceso.

Router(config)#username INTGUY view INTONLY password 0 INTGUY
Router(config)#username test password 0 test
Router(config)#^Z

Ahora desde un host podemos conectarnos con ssh directamente en el view INTONLY utilizando la informacin de
la cuenta INTGUY. Vea como todos los comandos aparte de show interface fallan.
Pepetrillo@linux:~$ ssh INTGUY@Router

Password:

Router#show parser view
Current view is INTONLY

Router#?
Exec commands:
<1-99> Session number to resume
enable Turn on privileged commands
exit
Exit from the EXEC
show Show running system information

Router#show ?
flash: display information about flash: file system
parser Display parser information
slot0: display information about slot0: file system
slot1: display information about slot1: file system

Router#show run
^
% Invalid input detected at ^ marker.

Router# conf t
^
% Invalid input detected at ^ marker.
Router#ping 192.168.1.2
^
% Invalid input detected at ^ marker.

Router#show int
FastEthernet0/0 is up, line protocol is up
Hardware is AmdFE, address is cc00.1300.0000 (bia cc00.1300.0000)
Internet address is 192.168.1.1/24
MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,

0 output buffer failures, 0 output buffers swapped out
Loopback0 is up, line protocol is up
Hardware is Loopback
Internet address is 10.10.10.10/8

0 output buffer failures, 0 output buffers swapped out

Los views tambin pueden estar formados por mltiples views y reutilizados por otros views. stos se configuran
con el comando superview.

Router>enable view
Router#conf t
Router(config)#parser view lol superview
*Mar 1 01:21:19.643: %PARSER-6-SUPER_VIEW_CREATED: super view lol successfully created.
Router(config-view)#secret lol
Router(config-view)#view INTONLY
*Mar 1 01:21:51.635: %PARSER-6-SUPER_VIEW_EDIT_ADD: view INTONLY added to superview lol.

Das könnte Ihnen auch gefallen