Skip to main content
COSMICBYTEZLABS
NewsSecurityHOWTOsToolsStudyTraining
ProjectsChecklistsAI RankingsNewsletterStatusTagsAbout
Subscribe

Press Enter to search or Esc to close

News
Security
HOWTOs
Tools
Study
Training
Projects
Checklists
AI Rankings
Newsletter
Status
Tags
About
RSS Feed
Reading List
Subscribe

Stay in the Loop

Get the latest security alerts, tutorials, and tech insights delivered to your inbox.

Subscribe NowFree forever. No spam.
COSMICBYTEZLABS

Your trusted source for IT intelligence, cybersecurity insights, and hands-on technical guides.

429+ Articles
114+ Guides

CONTENT

  • Latest News
  • Security Alerts
  • HOWTOs
  • Projects
  • Exam Prep

RESOURCES

  • Search
  • Browse Tags
  • Newsletter Archive
  • Reading List
  • RSS Feed

COMPANY

  • About Us
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CosmicBytez Labs. All rights reserved.

System Status: Operational
  1. Home
  2. HOWTOs
  3. Network Monitoring Basics: Detect Threats Before They Spread
Network Monitoring Basics: Detect Threats Before They Spread
HOWTOIntermediate

Network Monitoring Basics: Detect Threats Before They Spread

Learn how to set up effective network monitoring using open-source tools. Covers traffic analysis, alerting, and common indicators of compromise.

Security Team

Security Engineering

January 15, 2026
7 min read

Prerequisites

  • Basic networking knowledge
  • Linux command line
  • Understanding of TCP/IP

Overview

Effective network monitoring is essential for security and operational visibility. This guide covers fundamental concepts and tools for monitoring your network infrastructure.

Who Should Use This Guide

  • Network administrators managing infrastructure
  • Security analysts monitoring for threats
  • System administrators troubleshooting connectivity
  • SOC teams building detection capabilities

Why Monitor Your Network

BenefitDescription
Intrusion DetectionIdentify malicious activity early
TroubleshootingDiagnose network issues quickly
Capacity PlanningTrack bandwidth utilization trends
ComplianceMeet regulatory audit requirements
ForensicsSupport incident investigation

Requirements

System Requirements

ComponentRequirement
Operating SystemLinux (Ubuntu 22.04+, Debian 12+)
RAM4GB minimum, 8GB+ recommended
Storage50GB+ for log retention
NetworkSPAN/mirror port access recommended

Tools Referenced

ToolPurposeInstallation
tcpdumpPacket captureapt install tcpdump
WiresharkGraphical analysisapt install wireshark
SuricataNetwork IDSapt install suricata
PrometheusMetrics collectionContainer or binary
GrafanaVisualizationContainer or binary

Key Metrics to Monitor

Bandwidth and Throughput

MetricDescriptionAlert Threshold
Inbound trafficData received per interface> 80% capacity
Outbound trafficData sent per interface> 80% capacity
Protocol distributionTraffic by protocol typeUnusual protocols
Peak usageMaximum utilization timesCapacity planning

Connection Statistics

MetricDescriptionAlert Threshold
Active connectionsCurrent established connections> baseline + 50%
New connections/secConnection rate> 1000/sec
Connection durationAverage session lengthAnomalous patterns
Port utilizationServices in useUnexpected ports

Error Rates

MetricDescriptionAlert Threshold
Packet dropsLost packets> 1%
RetransmissionsTCP retries> 5%
ICMP errorsNetwork layer issuesSudden increase
Interface errorsHardware/driver issuesAny sustained errors

Process

Step 1: Install Packet Capture Tools

Set up fundamental traffic analysis capability.

Installation:

# Debian/Ubuntu
sudo apt update
sudo apt install tcpdump wireshark nethogs iftop -y

Verification:

tcpdump --version
wireshark --version

Expected Output: Version information for each tool.


Step 2: Capture Network Traffic

Use tcpdump for command-line packet capture.

Basic Capture Commands:

# Capture traffic on interface
sudo tcpdump -i eth0 -n
 
# Capture specific port
sudo tcpdump -i eth0 port 443
 
# Capture and write to file
sudo tcpdump -i eth0 -w capture.pcap
 
# Read from capture file
tcpdump -r capture.pcap
 
# Filter by host
sudo tcpdump -i eth0 host 10.0.0.50
 
# Capture specific protocols
sudo tcpdump -i eth0 'tcp port 80 or tcp port 443'

Verification:

ls -la capture.pcap

Expected Result: Capture file created with packet data.


Step 3: Analyze Traffic with Wireshark

Use graphical analysis for deep packet inspection.

Common Display Filters:

FilterPurpose
httpHTTP traffic only
dnsDNS queries and responses
tcp.flags.syn == 1TCP SYN packets
tcp.flags.reset == 1Connection resets
frame.len > 1000Large packets
ip.addr == 10.0.0.100Specific IP address

Analysis Workflow:

  1. Open capture file in Wireshark
  2. Apply display filter for traffic type
  3. Follow TCP streams for full conversation
  4. Export suspicious traffic for further analysis

Step 4: Monitor Real-Time Bandwidth

Track bandwidth usage by process and connection.

Using iftop:

sudo iftop -i eth0

Key Display Information:

ColumnDescription
TXTransmitted data
RXReceived data
TOTALCombined bandwidth
CumulativeSession totals

Using nethogs (per-process):

sudo nethogs eth0

Verification: Real-time display shows active connections and bandwidth.


Step 5: Deploy Suricata IDS

Install network-based intrusion detection.

Installation:

sudo apt install suricata -y

Configuration (/etc/suricata/suricata.yaml):

vars:
  address-groups:
    HOME_NET: "[10.0.0.0/8,172.16.0.0/12,192.168.0.0/16]"
    EXTERNAL_NET: "!$HOME_NET"
 
af-packet:
  - interface: eth0
    cluster-id: 99
    cluster-type: cluster_flow
    defrag: yes
 
outputs:
  - eve-log:
      enabled: yes
      filename: eve.json
      types:
        - alert
        - dns
        - http
        - tls

Update Rules:

sudo suricata-update
sudo systemctl restart suricata

Verification:

sudo systemctl status suricata
tail -f /var/log/suricata/fast.log

Expected Result: Suricata running; alerts appearing in log.


Step 6: Set Up Prometheus Monitoring

Deploy metrics collection infrastructure.

Install Node Exporter:

wget https://github.com/prometheus/node_exporter/releases/download/v1.7.0/node_exporter-1.7.0.linux-amd64.tar.gz
tar xvf node_exporter-1.7.0.linux-amd64.tar.gz
sudo mv node_exporter-1.7.0.linux-amd64/node_exporter /usr/local/bin/

Create Systemd Service (/etc/systemd/system/node_exporter.service):

[Unit]
Description=Node Exporter
After=network.target
 
[Service]
Type=simple
ExecStart=/usr/local/bin/node_exporter
Restart=always
 
[Install]
WantedBy=multi-user.target

Enable Service:

sudo systemctl daemon-reload
sudo systemctl enable --now node_exporter

Verification:

curl http://localhost:9100/metrics | head -20

Expected Result: Prometheus metrics displayed.


Step 7: Configure Alerting

Set up alerts for security-relevant events.

Prometheus Alerting Rules:

groups:
  - name: network
    rules:
      - alert: HighBandwidth
        expr: rate(node_network_receive_bytes_total[5m]) > 100000000
        for: 5m
        labels:
          severity: warning
        annotations:
          summary: High inbound bandwidth detected
 
      - alert: ManyConnections
        expr: node_netstat_Tcp_CurrEstab > 1000
        for: 5m
        labels:
          severity: warning
        annotations:
          summary: Unusual number of connections

Common Indicators of Compromise

Suspicious Traffic Patterns

IndicatorDescriptionDetection Method
Port scansSequential port connectionsSuricata rules, connection logs
BeaconingRegular intervals to same destinationFlow analysis, timing patterns
DNS tunnelingUnusual DNS query patternsDNS log analysis, query length
Data exfiltrationLarge outbound transfersBandwidth monitoring, flow analysis
C2 trafficConnections to known bad IPsThreat intelligence integration

Detection Examples

# Find potential port scans
sudo tcpdump -i eth0 'tcp[tcpflags] & tcp-syn != 0' -c 1000
 
# Look for DNS tunneling (long queries)
sudo tcpdump -i eth0 port 53 -A | grep -E '.{50,}\.'
 
# Large data transfers
sudo tcpdump -i eth0 -n 'greater 10000'

Troubleshooting

SymptomPossible CauseSolution
No packets capturedWrong interfaceVerify interface with ip link
Permission deniedMissing privilegesRun with sudo
Suricata not alertingRules not loadedRun suricata-update
High CPU on captureToo much trafficUse BPF filters
Missing metricsExporter not runningCheck systemd status

Verification Checklist

Tools

  • tcpdump installed and working
  • Wireshark available for analysis
  • Suricata IDS deployed
  • Prometheus/Grafana configured

Configuration

  • SPAN/mirror port configured (if available)
  • IDS rules updated
  • Alerting rules defined
  • Dashboards created

Operations

  • Baseline traffic documented
  • Log retention configured
  • Alert escalation defined
  • Regular review scheduled

Best Practices

PracticeDescription
Baseline Normal BehaviorDocument typical patterns before detecting anomalies
Network Segmentation VisibilityMonitor inter-VLAN traffic at boundaries
Log RetentionKeep logs 90+ days for investigation
Regular Rule UpdatesUpdate IDS signatures weekly

References

  • Suricata Documentation
  • Wireshark User Guide
  • Prometheus Documentation

Last Updated: January 2026

#Networking#Monitoring#Security#IDS#Traffic Analysis

Related Articles

How to Set Up BGP Monitoring and Route Alerts

Learn how to monitor BGP routing and detect route hijacks, leaks, and misconfigurations using open-source tools. Covers BGPalerter, RIPE RIS Live,...

12 min read

Building a Secure Homelab in 2026: Complete Guide

Learn how to set up a production-grade homelab with proper network segmentation, monitoring, and security controls. Perfect for IT professionals and...

6 min read

WireGuard VPN Setup: Secure Remote Access

Deploy a modern, high-performance VPN using WireGuard. Covers server setup, client configuration, and security best practices for secure remote access.

7 min read
Back to all HOWTOs