Network Virtualization

Tools and libraries for packet manipulation and network device automation.

Netmiko is where to start with Python network automation libraries; when many vendors need one API, move to NAPALM. Scapy works a layer down, on raw packets.

How to choose:

  • Running show and config commands on devices over SSH: Netmiko
  • Config changes across vendors, with a diff before commit: NAPALM
  • Forging, sending, sniffing, or dissecting packets: Scapy

Listed in editorial order. Click a column header to re-sort the whole list.

Press / to search. Tags open their category. Click a row for details.

Search and filter

Results

Row number Tags
A brilliant packet manipulation library.
secdev/github.com/secdev/scapy /12,659 stars /
Multi-vendor library to simplify CLI connections to network devices.
ktbyers/github.com/ktbyers/netmiko /4,312 stars /
Cross-vendor API to manipulate network devices.

Network Virtualization guide

Netmiko gathers show-command output and makes config changes across a very broad set of platforms, and spares you most of the low-level regex matching on device prompts. Describe the device in a dict with its device_type, host, and credentials, and pass it to ConnectHandler, which picks the right class and opens the SSH connection. Run show commands with send_command(), and config commands with send_config_set(), which enters config mode for you.

NAPALM puts a unified API over different network operating systems. Get a driver with get_network_driver() and open the device in a with block, which the docs say to stick with for most situations, since it opens and closes the session for you. To change config, load a candidate that replaces or merges into the running one, check it with compare_config(), then commit or discard it. The docs also say to test your workflow and try to break things on a lab first.

Scapy sends, sniffs, dissects, and forges network packets, as an interactive shell or as a library you import. Build a packet by stacking layers with the / operator, like IP()/TCP(), and override only the fields whose defaults you don't want. Sending packets needs root privileges, so start the shell with sudo scapy.

Know a project that belongs here?

Tell us what it does and why it stands out.