Wireshark - インストール - FreeBSD

 クラウディア
1. 概要
2. インストール
3. アップデート

1. 概要

 事情があって、「FreeBSD」でネットワークの情報をモニタする必要にせまられたのです。  「netstat」等のコマンドもありますが、通信している内容の生に近い値が見たい。  調べてみると、パッケージが用意されているようです。  「FreeBSD 14.0 RELEASE」でやってみます。

2. インストール

 「pkg」で調べて見ると。

$ pkg search wireshark
wireshark-4.2.0                Powerful network analyzer/capture tool
wireshark-nox11-4.2.0          Powerful network analyzer/capture tool (without GUI)
 と、「CUI」「GUI」が用意されているのですが。  「ports」には、1つしかない。  オプションで「CUI」「GUI」を切り替えるようです。

cd /usr/ports/net/wireshark
make config
 下記が、デフォルトの状態です。
「Wireshark Portable」-「/usr/ports/net/wireshark」「make conffig①」
「Wireshark Portable」-「/usr/ports/net/wireshark」「make conffig②」

 とりあえず、「GUI」は使わないのと、「GSSAPI」は面倒くさいので。

	・「GUI」をオフ
	・「GSSAPI」を「GSSAPI_NONE」

 にします。
 後でわかりましたが、この「GUI」オプションはご破算になります。


cd /usr/ports/net/wireshark
make
 思いのほか、「make」に時間がかかります。  「python」のモジュールがだいぶ、インストールされるようで、「UI」は「python」で実装するのかしら?  と、途中で、エラーで、止まりました。  どうも、「GUI」関係のパッケージでエラーになります。  オプションで、「GUI」を無効にしたのにな、と思って、オプションを見ると、「GUI」のチェックをが復活しておる。  チェックをはずして、「OK」で抜けた直後に、確認するとまたチェックがついている。  調べてみたら、「[Bug 270151] net/wireshark nox11/GUI setting not stored in options」に対策が書いてありました。

cd /usr/ports/net/wireshark
make FLAVOR=nox11
 で、「GUI」オプションなしで、「make」できます。

cd /usr/ports/net/wireshark
make FLAVOR=nox11 install
 「install」にも必要でした。  インストール時のログを残しておきます。

===>  Installing for wireshark-nox11-4.2.2
===>  Checking if wireshark-nox11 is already installed
===>   Registering installation for wireshark-nox11-4.2.2
Installing wireshark-nox11-4.2.2...
In order for wireshark be able to capture packets when used by unprivileged
user, /dev/bpf should be in network group and have read-write permissions.
For example:

# chgrp network /dev/bpf*
# chmod g+r /dev/bpf*
# chmod g+w /dev/bpf*

In order for this to persist across reboots, add the following to
/etc/devfs.conf:

own  bpf* root:network
perm bpf* 0660

===> SECURITY REPORT:
      This port has installed the following binaries which execute with
      increased privileges.
/usr/local/bin/dumpcap

      This port has installed the following files which may act as network
      servers and may therefore pose a remote security risk to the system.
/usr/local/bin/sharkd
/usr/local/lib/wireshark/extcap/udpdump

      If there are vulnerabilities in these programs there may be a security
      risk to the system. FreeBSD makes no guarantee about the security of
      ports included in the Ports Collection. Please type 'make deinstall'
      to deinstall the port if this is a concern.

      For more information, and contact details about the security
      status of this software, see the following webpage:
https://www.wireshark.org/
 で、「CUI」版はとても難しそうです。  別のページに残していこうと思います。

3. アップデート

 アップデート時も、「FLAVOR=nox11」が必須になりますので、「portupgrade」では、失敗します。  その辺、「メンテナンス・トラブルシュート - pkg・ports - その他一般」あたりにも書きましたが。  以下の手順でアップデートします。

cd /usr/ports/net/wireshark
make FLAVOR=nox11 deinstall clean
make FLAVOR=nox11
make FLAVOR=nox11 reinstall
ハイスピードプランU-NEXT世界最大級のオンライン英会話EF English Live