Introduction to Suricata
Ubuntu/Debian
Deep Dive into Network Security
Suricata is an open-source, high-performance Network Threat Detection engine that functions as an Intrusion Detection System (IDS) and Intrusion Prevention System (IPS). Developed by the Open Information Security Foundation (OISF), it monitors network traffic in real time to identify malicious activity, unauthorized access attempts, and policy violations. Unlike traditional packet sniffers, Suricata inspects both packet headers and payload data using a powerful signature-based rules engine to keep your infrastructure safe.
One of the standout features of Suricata is its modern multi-threaded architecture. This design allows it to split network traffic analysis across multiple CPU cores simultaneously, enabling seamless processing of high-speed, heavy-volume network traffic without causing hardware bottlenecks or dropping critical packets. Additionally, Suricata goes beyond standard signature matching by performing advanced protocol parsing, network flow tracking, and file extraction directly from intercepted network streams.
Suricata operates in two distinct modes depending on your security needs. In passive IDS mode, it analyzes copied network traffic via af-packet and alerts administrators without interfering with packet delivery. In active IPS mode, Suricata hooks directly into the Linux Netfilter framework via NFQUEUE, giving it the power to inspect packets inline and actively drop or reject malicious connections before they reach their target. It also generates clean JSON log outputs (EVE logs) that integrate seamlessly into central monitoring tools like Elastic Stack or Splunk.
Prerequisites
- Operating System: An active installation of Ubuntu (20.04, 22.04, 24.04 LTS) or Debian (Debian 11 Bullseye or Debian 12 Bookworm).
- User Privileges: Administrative access with
sudoprivileges or direct access to therootuser account. - System Resources: Minimum 2 CPU cores and 2 GB RAM (higher network volume requires additional CPU cores and memory).
- Network Access: Active internet access to download software packages, dependencies, and signature updates.
- Networking Tools: Basic awareness of your active network interface name (such as
eth0orens18).
Step-by-Step Installation
Update System Packages
sudo apt update && sudo apt upgrade -y sudo apt install software-properties-common curl wget apt-transport-https jq lsb-release -y
Add Official Repositories
sudo add-apt-repository ppa:oisf/suricata-stable -y sudo apt update
# Automatically detects if your system is bullseye or bookworm
DEBIAN_RELEASE=$(lsb_release -cs)
echo "deb http://deb.debian.org/debian ${DEBIAN_RELEASE}-backports main" | sudo tee /etc/apt/sources.list.d/backports.list
sudo apt update
Install Suricata Package
sudo apt install suricata -y
DEBIAN_RELEASE=$(lsb_release -cs)
sudo apt install suricata -t ${DEBIAN_RELEASE}-backports -y
Configure Network Variables and Interfaces
ip a
sudo nano /etc/suricata/suricata.yaml
vars:
address-groups:
HOME_NET: "[192.168.1.0/24]"
EXTERNAL_NET: "!$HOME_NET"
af-packet: - interface: eth0 # Replace eth0 with your network interface
Download Latest Threat Rules
sudo suricata-update
Configure Active IPS Mode (NFQUEUE)
sudo sed -i 's/LISTENMODE=af-packet/LISTENMODE=nfqueue/' /etc/default/suricata
echo "re:." | sudo tee /etc/suricata/drop.conf sudo suricata-update
sudo iptables -I INPUT -j NFQUEUE --queue-bypass sudo iptables -I OUTPUT -j NFQUEUE --queue-bypass sudo iptables -I FORWARD -j NFQUEUE --queue-bypass
Start and Enable the Suricata Service
sudo systemctl enable suricata sudo systemctl restart suricata sudo systemctl status suricata
Verify Installation and Rule Action
curl http://testmynids.org/uid/index.html
sudo grep "ATTACK_RESPONSE" /var/log/suricata/fast.log
CTCservers Recommended Tutorials
Web, Network
Step-by-Step Guide: Install AMD ROCm on Ubuntu with RX 6600 GPU
Learn how to quickly and easily set up AMD ROCm on Ubuntu for your RX 6600 GPU, enabling powerful machine learning, AI workloads, and GPU-accelerated computing right on your system.
Web, Network, Linux, Mysql, Ubuntu
LAMP Setup Guide 2026: Ubuntu & Debian | CTCservers
Install a secure LAMP stack on Debian or Ubuntu. Follow our step-by-step guide to configure Linux, Apache, MySQL, and PHP for your web server.
Web, Network, Ubuntu
Deploy Phi-3 with Ollama on Ubuntu GPU | CTCservers
Learn how to easily deploy the Phi-3 LLM on an Ubuntu 24.04 GPU server using Ollama and WebUI. Follow our step-by-step tutorial for seamless AI hosting.
Discover CTCservers Dedicated Server Locations
CTCservers servers are available around the world, providing diverse options for hosting websites. Each region offers unique advantages, making it easier to choose a location that best suits your specific hosting needs.