09-08-2017 06:27 PM - edited 03-08-2019 11:58 AM
Hi there,
Appreciate any pointers here.
I have to deploy tacacs configure for line con 0 and line aux. The configuration is as follows:
line con 0
login authentication no_tacacs
line aux 0
login authentication dial_in
aaa authentication login no_tacacs local * For console
aaa authentication login dial_in local * For Aux
I need to deploy this to all network (routers and switches) devices globally.
I never used python before. I am on windows 7 and have python 2.7.13 installed. via youtube and google.com I got a rough draft script below but have no idea how deploy to my test router I have. the router is 2911 with no routing enabled. I have never done this in a test environment.
Question 1. How can setup the router as a test router?
I have no routing protocol or static enabled and thought to only create a loopback with an IP configured for the vlan i am going to put it on that i can connect to via telnet on a production network. your thoughts?
Question 2.
I got a good start of the script below but not sure how to deploy with python. i need to add a part in the script to telnet by IP and port? or do i put the IP where the "(HOST") is?
Thank you support community in advance!
tn = telnetlib.Telnet (HOST)
tn.read_until("Username: ")
tn.write("username\n")
if password:
tn.read_until("Password: ")
tn.write (password + "\n")
tn.write("enable\n")
tn.write (password + "\n")
tn.write("config t\n")
tn.write("aaa authentication login no_tacacs local\n")
tn.write("aaa authentication login dial_in local\n")
tn.write("line con 0/n")
tn.write("login authentication no_tacacs\n")
tn.write("line aux 0/n")
tn.write("login authentication dial_in\n")
tn.write("exit\n")
tn.write("exit\n")
tn.write("wr mem\n")
09-08-2017 07:38 PM
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