02-04-2024 05:27 PM - edited 02-04-2024 05:28 PM
We are about to implement AAA/TACACS admin authentication for switches on our remote site and we need to make sure that once we paste the script that we do not loose access to the remote switch. is there any tips on doing this without loosing access to the switch and needing to go onsite just to access the console. the script is provided below for reference:
!
aaa new-model
!
!
aaa group server tacacs+ AAA01
server-private key
server
ip tacacs source-interface Vlan17
!
aaa authentication login NETLOGIN group AAA01 local
aaa authorization exec NETLOGIN group AAA01 local
aaa authorization commands 15 NETLOGIN group AAA01 local
aaa authorization configuration NETLOGIN group AAA01
aaa accounting exec NETLOGIN start-stop group AAA01
aaa accounting commands 15 NETLOGIN start-stop group AAA01
!
line vty 0 4
authorization commands 15 NETLOGIN
authorization exec NETLOGIN
accounting commands 15 NETLOGIN
accounting exec NETLOGIN
login authentication NETLOGIN
transport input ssh
transport output ssh
line vty 5 15
authorization commands 15 NETLOGIN
authorization exec NETLOGIN
accounting commands 15 NETLOGIN
accounting exec NETLOGIN
login authentication NETLOGIN
transport input ssh
transport output ssh
!
Solved! Go to Solution.
02-04-2024 10:51 PM
It's always handy to perform a sanity check before issuing the IOS commands
Once that is done and confirmed, then you can proceed to configure a device. As @johnd2310 mentioned, you can issue a "reload in 10" for extra belts and braces. However, I never do that in practice (I used to). What I do now is a little more sophisticated.
ssh to the device
enter the commands up to (but not including) the aaa commands
aaa new-model
aaa group server tacacs+ AAA01
server-private key
server xxxxx
ip tacacs source-interface Vlan17
end
and then test the comms to the AAA server
test aaa group AAA01 testusername testpassword new-code
You can replace the testusername and testpassword with real credentials. if you use dummy credentials then the expected response on the CLI should be
Sending password
User rejected
else you'll see something like this
Sending password
User successfully authenticated
USER ATTRIBUTES
username "johnf"
reply-message "Enter password:"
At this point you're 100% sure you're talking to the AAA server.
What happens next is crucial.
When you enter the aaa commands, you'll hit a roadblock when you enter the aaa authorization. Because, how the IOS is talking to the AAA server and will request authorization. At this point, simply log into the same device again, and then paste all the aaa commands again, starting from the aaa accounting .... statements
If you get locked out for whatever reason, don't panic. Go into the AAA server (e.g. ISE) and untick the TACACS+ box for that device. That will cause the IOS to get no response from AAA, and hence, fallback to local auth (as the case in your statement aaa authentication login NETLOGIN group AAA01 local )
02-04-2024 10:05 PM
Hi,
Thanks
John
02-05-2024 01:38 AM
Wow this "reload in (minutes)" command is new to me. glad i asked this question here!
02-04-2024 10:51 PM
It's always handy to perform a sanity check before issuing the IOS commands
Once that is done and confirmed, then you can proceed to configure a device. As @johnd2310 mentioned, you can issue a "reload in 10" for extra belts and braces. However, I never do that in practice (I used to). What I do now is a little more sophisticated.
ssh to the device
enter the commands up to (but not including) the aaa commands
aaa new-model
aaa group server tacacs+ AAA01
server-private key
server xxxxx
ip tacacs source-interface Vlan17
end
and then test the comms to the AAA server
test aaa group AAA01 testusername testpassword new-code
You can replace the testusername and testpassword with real credentials. if you use dummy credentials then the expected response on the CLI should be
Sending password
User rejected
else you'll see something like this
Sending password
User successfully authenticated
USER ATTRIBUTES
username "johnf"
reply-message "Enter password:"
At this point you're 100% sure you're talking to the AAA server.
What happens next is crucial.
When you enter the aaa commands, you'll hit a roadblock when you enter the aaa authorization. Because, how the IOS is talking to the AAA server and will request authorization. At this point, simply log into the same device again, and then paste all the aaa commands again, starting from the aaa accounting .... statements
If you get locked out for whatever reason, don't panic. Go into the AAA server (e.g. ISE) and untick the TACACS+ box for that device. That will cause the IOS to get no response from AAA, and hence, fallback to local auth (as the case in your statement aaa authentication login NETLOGIN group AAA01 local )
02-05-2024 01:38 AM
Thank you so much for this!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide