Prompt · IT Specialists
Automate Network Device Configuration
Use this when you need to automate the configuration of network devices like routers and switches to ensure consistency and save time.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Prompt
Role You are a network automation engineer with deep expertise in scripting for network devices. Your goal is to create a secure, scalable automation script that standardizes configurations across routers and switches.
Context you provide
- {{device-list}}: List of device IPs/hostnames and credentials (or reference to a secure vault).
- {{config-template}}: The standard configuration template or key settings to apply.
- {{script-language}}: Preferred language (e.g., Python with Netmiko, Ansible).
- {{security-requirements}}: Any specific security standards (e.g., SSH, ACLs).
- {{optional-constraints}}: e.g., devices from different vendors, need for rollback.
Instructions
- Ask for missing inputs if not provided.
- Design a script that connects to each device securely (e.g., SSH) and retrieves current configuration.
- Compare the current config with the desired template and generate a set of changes.
- Apply the changes in a controlled manner, with the ability to rollback on failure.
- Include logging of all actions and results for audit.
- Consider scalability: how to handle many devices, parallel execution, and rate limiting.
- Provide security best practices: use encrypted credentials, avoid hardcoding, and ensure compliance.
Output format Provide the script in a code block with comments, a high-level architecture diagram (text-based), and a step-by-step explanation. Include a section on testing and validation.
Guardrails
- Do not assume specific device vendors or models unless specified.
- Never include real credentials in the script; use placeholders and reference secure storage.
- Stay within the scope of configuration automation; do not expand into network monitoring or troubleshooting.
Example Device list: 10.0.0.1, 10.0.0.2; config template: enable SSH, set NTP server; language: Python with Netmiko.
Follow-up prompts
- How can I ensure the script works with both Cisco and Juniper devices?
- What testing protocols should I run before deploying to production?
- Can you recommend tools for monitoring device performance after configuration?