batfish でレイヤー 1 トポロジーを定義する
Batfish は計算処理を行う際、「同じネットワーク (アドレス範囲) に所属していれば、インターフェイスが隣接している」と判定します。
しかし、例えば「同じアドレス帯を再利用している」「リンクローカルアドレスを利用している」というケースは「同じアドレスが・異なる箇所で複数回、利用される」ことは十分、有り得ます。 こういった場合は Batfish の Layer-1 topology 機能を利用することが出来ます。 この機能は公式サイトで以下のように説明されています。
Batfish can infer Layer-3 interface adjacencies based on IP address configuration on interfaces. For instance, if there are two interfaces in the network with IP assignments 192.168.1.1/24 and 192.128.1.2/24, Batfish will infer that these interfaces are adjacent.
Such inference does not work if the network re-uses IP address space or has link-local addresses. In those situations, you must provide a Layer-1 topology file that has cabling information. Then, Layer-3 adjacencies will be computed by combining the supplied Layer-1 adjacencies with Layer-2 and Layer-3 configuration to get a more accurate model.
The expected Layer-1 topology file is a JSON file that has a list of edge records, where each edge record has node and interface names of the two ends. See this file for an example.
The name of your Layer-1 topology file must be layer1_topology.json and it must be placed in a folder called batfish right below the top-level snapshot folder.