vkdev.net logo Networker's apps
Contact: vk@vkdev.net
Download cpath

#cpath

cpath computes the path a packet would take between two endpoints by walking the topology offline. It reads collected configurations and neighbor state from a directory of devices, builds an in-memory graph, and resolves the forwarding path hop by hop — without sending any probes to the live network.

This makes it useful in two situations: when the network you are investigating is unreachable, and when you want to predict the path that a configuration change will produce before deploying it.

#Installation

curl -L -O https://vkdev.net/downloads/cpath
chmod +x cpath
sudo mv cpath /usr/local/bin/
[ screenshot of cpath output — replace this ]
A traced path from a source to a destination, hop by hop.

#Usage

Point cpath at a snapshot directory, give it a source and a destination, and it prints the computed path.

cpath --snapshot ./snapshots/today/ 10.0.1.5 10.0.42.17
The snapshot directory must contain one configuration file per device and, optionally, neighbor or routing-table dumps under state/. cpath will work with configuration alone but produces more accurate paths when state is present.
[ topology diagram with traced path — replace this ]
cpath highlights the forwarding path through the topology.

#What-if mode

cpath can also load a proposed change on top of a snapshot and recompute the path under the hypothetical configuration. This is intended for pre-change validation.

cpath --snapshot <dir> --overlay <patch.cfg> <src> <dst>
The overlay file is parsed in the same dialect as the underlying device and applied non-destructively for the duration of the run.