cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
11116
Views
20
Helpful
33
Replies

Python config help

PLC
Level 1
Level 1

Hello everyone,

 

Need some help with python script. I never used python before. I need to deploy tacacs config for con0 and aux line to all routers and switches.

I have Python 2.7.13 installed on my windows 7

1. I have a router I want to test it by deploying script to it via telnet. How do you suggest i do that while having this router connected to a production network? My thought is to not have any routing enabled and only configure a loop back on the router with an IP address that is routable via the production network. Best practices?

2. I have attached what i have so far scripted very rough draft. I have no idea how to deploy it with python via telnet and what the script is lacking. would i put the IP address of the router where it says "(HOST)". Can anyone give me some pointers?

 

Thank you!

33 Replies 33

Hi Francesco,

It's going to take me a bit to get a router test on since I had to deploy the one I had.

I attached a very basic one. I wanted to make sure I get the basic concepts because i will have to explain in a project plan what the script is doing and test it. Plus it was easier to find what was wrong when it didnt work.

so originally the scripts never worked because I found that I had a no aaa new model and did not have that enabled so the commands didnt work at all when running the script. Once I identified that I enabled and ran my script which worked up to the point of configuring the aaa global config mode BUT it didnt work all the way. I saw that the login configuration under line con 0 and aux 0 had no configuration.

 

Thanks for you help.

 

P

Ok you script seems good.

Let me know when you'll have your router to test if you face some issues.

Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question

Hi,

 

So with my simple script that I sent you I did run into an issue.

it configures global config mode the aaa but when going into line con0 and line aux it does not configure. I will have a router to test next week. but any ideas why?

Hey

By looking at it in details, behind your line command you did /n instead of \n

Correct that and try again.

Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card