73 lines
2.5 KiB
Bash
Executable File
73 lines
2.5 KiB
Bash
Executable File
#!/bin/sh
|
|
set -e
|
|
|
|
#DEBHELPER#
|
|
|
|
case "$1" in
|
|
configure)
|
|
# Set narrow capabilities for packet capture and eBPF support without requiring root/sudo.
|
|
# If eBPF capabilities are unavailable, fall back to packet capture only;
|
|
# rustnet will degrade to procfs process detection rather than auto-grant CAP_SYS_ADMIN.
|
|
if command -v setcap >/dev/null 2>&1; then
|
|
# CAP_NET_RAW: read-only packet capture (non-promiscuous mode)
|
|
# CAP_BPF, CAP_PERFMON: eBPF support for enhanced process tracking
|
|
setcap 'cap_net_raw,cap_bpf,cap_perfmon+eip' /usr/bin/rustnet 2>/dev/null || \
|
|
setcap 'cap_net_raw+eip' /usr/bin/rustnet || true
|
|
fi
|
|
|
|
cat <<EOF
|
|
|
|
================================================================================
|
|
RustNet has been installed with eBPF support!
|
|
|
|
NETWORK PACKET CAPTURE PERMISSIONS:
|
|
RustNet requires specific Linux capabilities for packet capture and eBPF
|
|
process detection. These have been automatically set if setcap is available.
|
|
|
|
To verify permissions are set correctly:
|
|
getcap /usr/bin/rustnet
|
|
|
|
Expected output (Linux 5.8+ with eBPF support):
|
|
/usr/bin/rustnet cap_net_raw,cap_bpf,cap_perfmon=eip
|
|
|
|
Or, if eBPF capabilities were unavailable during install:
|
|
/usr/bin/rustnet cap_net_raw=eip
|
|
|
|
If capabilities are not set, you can manually set them:
|
|
# For modern Linux 5.8+ with eBPF support
|
|
sudo setcap 'cap_net_raw,cap_bpf,cap_perfmon+eip' /usr/bin/rustnet
|
|
|
|
# Packet capture only (eBPF falls back to procfs)
|
|
sudo setcap 'cap_net_raw+eip' /usr/bin/rustnet
|
|
|
|
Note: RustNet uses read-only packet capture (no promiscuous mode).
|
|
CAP_NET_ADMIN is NOT required.
|
|
|
|
Alternatively, run rustnet with sudo:
|
|
sudo rustnet
|
|
|
|
eBPF FALLBACK:
|
|
If eBPF fails to load, rustnet will automatically fall back to procfs-based
|
|
process detection. Check the TUI Statistics panel to see which detection
|
|
method is active.
|
|
|
|
GEOIP (OPTIONAL):
|
|
To show country codes for remote IPs, install GeoLite2 databases:
|
|
sudo apt-get install geoipupdate
|
|
Edit /etc/GeoIP.conf with your free MaxMind credentials, then run:
|
|
sudo geoipupdate
|
|
See: https://github.com/domcyrus/rustnet/blob/main/INSTALL.md#geoip-databases-optional
|
|
|
|
USAGE:
|
|
rustnet # Start network monitoring
|
|
rustnet --help # Show all options
|
|
|
|
For more information, visit: https://github.com/domcyrus/rustnet
|
|
================================================================================
|
|
|
|
EOF
|
|
;;
|
|
esac
|
|
|
|
exit 0
|