Skip to main content
ML Defender supports three deployment methods: Vagrant multi-VM (development/testing), Docker Compose (containerized), and Debian packages (production). This guide covers network topology, service dependencies, and health verification.

Network Topology

ML Defender operates in two modes:

Host-Based IDS Mode

Gateway Mode (Dual-NIC)

Vagrant Multi-VM Deployment

Recommended for development, testing, and gateway mode validation.

Prerequisites

Deployment Steps

1

Clone repository

2

Start Defender VM (development mode)

The Vagrantfile.multi-vm provisions:
  • Debian Bookworm 12 (8GB RAM, 6 CPUs)
  • Dual-NIC configuration (eth1: WAN, eth3: LAN)
  • IP forwarding and NAT for gateway mode
  • All dependencies (eBPF, ONNX Runtime, etcd, llama.cpp)
  • Pre-built components
3

Start Client VM (gateway testing)

The client VM:
  • IP: 192.168.100.50
  • Gateway: 192.168.100.1 (defender eth3)
  • Includes attack simulation tools (hping3, nmap, tcpreplay)
4

Verify network configuration

5

Build components

6

Start the pipeline

Service Startup Order

Components must start in this order due to ZMQ socket binding:
  1. Firewall ACL Agent (SUB socket on :5572) - Must bind first
  2. ML Detector (PUB socket on :5572) - Connects to firewall
  3. Sniffer (PUSH socket to :5571) - Sends to detector
The run_lab_dev.sh script handles this automatically:
source/scripts/run_lab_dev.sh

Docker Compose Deployment

Recommended for containerized environments and CI/CD pipelines.

Prerequisites

Deployment Steps

1

Configure services

Review docker-compose.yaml:
source/docker-compose.yaml
2

Build images

3

Start services

4

Verify deployment

Health Checks

All services include health checks:

Debian Package Deployment

Recommended for production deployments on Debian/Ubuntu servers.

Package Information

ML Defender provides a sniffer-ebpf package:
source/debian/control

Build Package

1

Install build dependencies

2

Build Debian package

3

Install package

4

Configure service

Systemd Service

The package includes a systemd service unit:
source/debian/sniffer-ebpf.service

Health Checks and Verification

Component Status

Port Verification

IPSet Verification

Log Verification

Pipeline Verification

Performance Verification

Network Capture Verification

Stopping and Cleanup

Vagrant

Docker Compose

Debian Package

Next Steps

Monitoring

Set up monitoring and observability

Performance Tuning

Optimize for your workload

Troubleshooting

Diagnose and fix issues

Configuration

Configure components