Skip to content

Blog

batfish でレイヤー 1 トポロジーを定義する

Batfish は計算処理を行う際、「同じネットワーク (アドレス範囲) に所属していれば、インターフェイスが隣接している」と判定します。

file

しかし、例えば「同じアドレス帯を再利用している」「リンクローカルアドレスを利用している」というケースは「同じアドレスが・異なる箇所で複数回、利用される」ことは十分、有り得ます。 こういった場合は 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.

LinearMouse をインストールして macOS でマウス設定を調整する

macOS でマウス設定を微調整するアプリケーションとしては CursorSense が有名だそうです。 CursorSense は 20 日の試用期間があるものの、それ以降は有料 (現時点では「980 円」の買い切り) のようです。 その為、無料の類似ソフトウェアを探したところ Linear Mouse という OSS のソフトウェアがあるそうですので試してみました。

Flet で GUI な Python アプリケーションを作成する

Python で GUI アプリケーションを作成する場合、以下のようなライブラリから何れかを選択するケースが多いと思います。

上記以外にも Flet を使うことも可能です。 Flet を利用する場合、GUI アプリケーションとして動作させることが可能ですが、Web アプリケーションとして動作させることも可能です。 今回は Flet 公式サイトに掲載されているサンプルアプリケーションを動作させるところまで試してみます。

ASA への VPN 接続時、複数の宛先を選択出来るようにする

以前に ASA への AnyConnect 接続時、複数の宛先を選択出来るようにする というメモを書きました。 Cisco AnyConnect は後継になる Cisco SecureClient というソフトウェアへ移行していますが、旧 AnyConnect と新 SecureClient ではカスタムプロファイルを配置すべきファイルパスが異なっている為、メモしておきます。

2to3 で Python2 コードを Python3 コードへ変換する

2to3 を使うと Python2 ベースのコードを Python3 へ変換することが出来ます。 とは言え、2to3 も万能なわけではありませんので、2to3 が修正してくれなかった部分は手動で修正していく必要があります。 2to3 は pip でインストールすることが出来ます。

1
python3 -m pip install 2to3