What is network automation with Python and Ansible?
Why Interviewers Ask This
Senior Networking engineers are expected to reason about architecture, performance, and edge cases. This question separates mid-level from senior candidates by testing deep system-level understanding.
Answer
Network automation eliminates manual CLI configuration. Python with Netmiko: Netmiko is a multi-vendor SSH library that abstracts vendor differences. Connect and configure: from netmiko import ConnectHandler; device = {"device_type": "cisco_ios", "host": "192.168.1.1", "username": "admin", "password": "pass"}; conn = ConnectHandler(**device); output = conn.send_command("show interfaces"). NAPALM (Network Automation and Programmability Abstraction Layer with Multivendor support) provides a unified API across vendors for configuration management and state retrieval. Ansible: uses YAML playbooks and network-specific modules (cisco.ios.ios_interfaces, arista.eos.eos_vlans). No agent needed on network devices — uses SSH or APIs. Example: - name: Configure VLAN; cisco.ios.ios_vlans: config: - name: Management vlan_id: 10 state: active. Nornir: Python-native automation framework (alternative to Ansible). Key tools: netconf-console (NETCONF), gnmic (gNMI for streaming telemetry), Batfish (network configuration validation). Store configs in Git for version control and peer review.
Common Mistake
Many candidates answer correctly but can't explain the 'why'. Always be prepared to justify your answer with a concrete example or use case from your Networking experience.
Previous
What is TCP window scaling and large receive offload?
Next
What is wireless mesh networking?