cisco — Example: TACACS Authentication

The following example shows how to configure the router to prompt for and verify a username and password, authorize the user’s EXEC level, and specify it as the method of authorization for privilege level 2. In this example, if a local username is entered at the username prompt, that username is used for authentication. If the user is authenticated using the local database, EXEC authorization using RADIUS will fail because no data is saved from the RADIUS authentication. The method list also uses the local database to find an autocommand. If there is no autocommand, the user becomes the EXEC user.

If the user then attempts to issue commands that are set at privilege level 2, TACACS+ is used to attempt to authorize the command.

Device> enable Device# configure terminal Device(config)# aaa authentication login default group radius local Device(config)# aaa authorization exec default group radius local Device(config)# aaa authorization command 2 default group tacacs+ if-authenticated Device(config)# radius server radserver Device(config-sg-radius)# address ipv4 10.2.3.1 Device(config-sg-radius)# exit Device(config)# radius-server attribute 44 include-in-access-req Device(config)# radius-server attribute 8 include-in-access-req Device(config)# end The lines in this sample RADIUS authentication and authorization configuration are defined as follows:

• The aaa authentication login default group radius local command specifies that the username and password are verified by RADIUS or, if RADIUS is not responding, by the router’s local user database. • The aaa authorization exec default group radius local command specifies that RADIUS authentication information be used to set the user’s EXEC level if the user authenticates with RADIUS. If no RADIUS information is used, this command specifies that the local user database be used for EXEC authorization.

• The aaa authorization command 2 default group tacacs+ if-authenticated command specifies TACACS+ authorization for commands set at privilege level 2, if the user has already successfully authenticated. • The radius-server attribute 44 include-in-access-req command sends RADIUS attribute 44 (Acct-Session-ID) in access-request packets. • The radius-server attribute 8 include-in-access-req command sends RADIUS attribute 8 (Framed-IP-Address) in access-request packets. Example: TACACS Authentication The following example shows how to configure TACACS+ as the security protocol to be used for PPP authentication:

Device> enable Device# configure terminal Device(config)# aaa new-model Device(config)# aaa authentication ppp test group tacacs+ local Device(config)# interface gigabitethernet 1/1/2 Device(config-if)# ppp authentication chap pap test Device(config-if)# exit Device(config)# tacacs server server1 Device(config-server-tacacs)# address ipv4 192.0.2.3 Device(config-server-tacacs)# key key1 Device(config-server-tacacs)# end The lines in this sample TACACS+ authentication configuration are defined as follows: • The aaa new-model command enables the AAA security services. Configuring Authentication Example: TACACS Authentication Configuring Authentication 37