In this lesson, we will cover:

  • How to install Batfish.
  • An introduction to snapshots.
  • How to validate your snapshots.
  • An introduction to questions.
  • An introduction to Pandas.

Installing Batfish

Batfish Service

As we previously mentioned Batfish runs as a containerized service. Therefore, to install Batfish we must first have Docker running.

For those of you that are new to Docker:

Docker is a container platform that can be used to create lightweight isolated environments, allowing you to easily separate dependencies between projects.

The installation of Docker is outside the scope of this series but you can find the installation guides at:

Once installed you can run Batfish by performing the following:

docker pull batfish/allinone
docker run --name batfish -d -p 8888:8888 -p 9997:9997 -p 9996:9996 batfish/allinone

Batfish Client

Next we will need to install the pybatfish client. To do this we will first create a virtual environment, then install pybatfish.

apt install python3-pip virtualenv

virtualenv --python=`which python3` bf-venv
source bf-venv/bin/activate

python3 -m pip install --upgrade git+

Example Topology

For the context of this series, our example network will be based on the following topology.


The key points that you should know about the topology are shown below:

Ready to Master Network Automation? Start Your Journey Today!
Our membership provides:
  • Full deep-dive course library (inc. Batfish, pyATS, Netmiko)
  • Code repositories inc. full course code, scripts and examples
  • 24x7 multi-vendor labs (Arista, Cisco, Juniper)
  • Private online community
  • Live monthly tech sessions
  • Access to tech session library

Join Now ➜
Close You've successfully subscribed to Packet Coders.
Close Success! Your account is fully activated, you now have access to all content.
Close Welcome back! You've successfully signed in.
Close Nearly there! To activate your account, please click the link in the email we just sent you.