Free using Snort, build your own NIDS:
This guide provides step-by-step instructions on how to set up Snort 3, an open-source Network Intrusion Detection System (NIDS). Includes files for Debian-based Linux and macOS:
https://gist.github.com/lukeswitz/08ea69ad6047c5f0bd2388476b2fd189