Socket Programming Basics: A Tiny TCP Port Reachability Checker in Python
Build a TCP port reachability checker with Python's socket module — connect_ex, timeouts, DNS resolution, and a management-plane service audit across a device list.
Build a TCP port reachability checker with Python's socket module — connect_ex, timeouts, DNS resolution, and a management-plane service audit across a device list.
Run ping, traceroute, and nslookup from Python with subprocess.run — capture output, check return codes, set timeouts, and avoid shell-injection bugs.
Use Python's re module to pull IPs, MACs, interface counters, and BGP states out of show command output — with named groups and the metacharacters that cover most network parsing.
Python's built-in ipaddress module handles subnets, host iteration, overlap detection, and subnetting for network engineers — no pip install required.
A complete, device-agnostic walkthrough for building a road-warrior OpenVPN server on an OPNsense firewall (running on a Zimaboard), then connecting iPhone, Android, MacBook, Windows, and Linux clients to your home network.
Day 7 closes Week 1 of the Python for Network Engineers series. Read and write files cleanly with `with`, catch only the exceptions you mean, and use the standard logging module so your scripts leave a real paper trail.
Day 6 of the Python for Network Engineers series. Define functions, use *args/**kwargs the way Netmiko expects, write your first reusable module, and learn the __name__ == '__main__' guard.
Day 5 of the Python for Network Engineers series. if/elif/else, for, while, break, continue, plus enumerate/zip/range — wired against a real device inventory.
Day 4 of the Python for Network Engineers series. The four built-in containers — list, tuple, dict, set — and which one to reach for when modeling devices, inventories, VLAN lists, and config drift.
Day 3 of the Python for Network Engineers series. Indexing, slicing, split/strip/replace/join, and f-string formatting — the small set of built-in string operations that handles most CLI-output parsing.