Sniffing modes: Difference between revisions
(Add Known Limitations section for HEP3 timestamp handling) |
|||
| (22 intermediate revisions by 4 users not shown) | |||
| Line 1: | Line 1: | ||
{{DISPLAYTITLE:VoIPmonitor Deployment & Topology Guide}} | |||
'''This guide provides a comprehensive overview of VoIPmonitor's deployment models. It covers the fundamental choice between on-host and dedicated sensors, methods for capturing traffic, and detailed configurations for scalable, multi-site architectures.''' | |||
= | == Core Concept: Where to Capture Traffic == | ||
The first decision in any deployment is where the VoIPmonitor sensor (sniffer) will run. | |||
=== 1. On-Host Capture (on the PBX/SBC) === | |||
The sensor can be installed directly on the same Linux server that runs your PBX or SBC. | |||
* '''Pros:''' Requires no extra hardware, network changes, or port mirroring. It is the simplest setup. | |||
* '''Cons:''' Adds CPU, memory, and disk I/O load to your production voice server. If these resources are critical, a dedicated sensor is the recommended approach. | |||
=== 2. Dedicated Sensor === | |||
A dedicated Linux server runs only the VoIPmonitor sensor. This is the recommended approach for production environments as it isolates monitoring resources from your voice platform. To use a dedicated sensor, you must forward a copy of the network traffic to it using one of the methods below. | |||
== Methods for Forwarding Traffic to a Dedicated Sensor == | |||
= | === A. Hardware Port Mirroring (SPAN/RSPAN) === | ||
This is the most common and reliable method. You configure your physical network switch to copy all traffic from the switch ports connected to your PBX/SBC to the switch port connected to the VoIPmonitor sensor. This feature is commonly called '''Port Mirroring''', '''SPAN''', or '''RSPAN'''. Consult your switch's documentation for configuration details. | |||
The VoIPmonitor sensor interface will be put into promiscuous mode automatically. To capture from multiple interfaces, set <code>interface = any</code> in <code>voipmonitor.conf</code> and enable promiscuous mode manually on each NIC (e.g., <code>ip link set dev eth1 promisc on</code>). | |||
=== B. Software-based Tunnelling === | |||
*GRE | When hardware mirroring is not an option, many network devices and PBXs can encapsulate VoIP packets and send them to the sensor's IP address using a tunnel. VoIPmonitor natively supports a wide range of protocols. | ||
* | * '''Built-in Support:''' IP-in-IP, GRE, ERSPAN | ||
* | * '''UDP-based Tunnels:''' Configure the corresponding port in <code>voipmonitor.conf</code>: | ||
* | ** <code>udp_port_tzsp = 37008</code> (for MikroTik's TZSP) | ||
* | ** <code>udp_port_l2tp = 1701</code> | ||
*audiocodes tunneling | ** <code>udp_port_vxlan = 4789</code> (common in cloud environments) | ||
* | * '''Proprietary & Other Protocols:''' | ||
* | ** [[audiocodes tunneling|AudioCodes Tunneling]] (uses <code>udp_port_audiocodes</code> or <code>tcp_port_audiocodes</code>) | ||
** HEP (Homer Encapsulation Protocol) | |||
** IPFIX (for Oracle SBCs) (enable <code>ipfix*</code> options) | |||
= | ==== HEP (Homer Encapsulation Protocol) ==== | ||
HEP is a lightweight protocol for capturing and mirroring VoIP packets. Many SBCs and sip proxies (such as Kamailio, OpenSIPS, FreeSWITCH) support HEP to send a copy of traffic to a monitoring server. | |||
'''Configuration in voipmonitor.conf:''' | |||
<pre> | |||
# Enable HEP support | |||
hep = yes | |||
# Port to listen for HEP packets (default: 9060) | |||
hep_bind_port = 9060 | |||
= | # Optional: Bind to specific IP address | ||
# hep_bind_ip = 0.0.0.0 | |||
</pre> | |||
= | When <code>hep = yes</code>, VoIPmonitor listens for HEPv3 (and compatible HEPv2) packets and extracts the original VoIP traffic from the encapsulation. | ||
'''Use Cases:''' | |||
* Remote SBCs or PBXs export traffic to a centralized VoIPmonitor server | |||
* Kamailio/FreeSWITCH <code>siptrace</code> module integration | |||
* Environments where standard tunnels (GRE/ERSPAN) are not available | |||
'''Note:''' There is also <code>hep_kamailio_protocol_id_fix = yes</code> for Kamailio-specific protocol ID issues. | |||
''' | '''Known Limitations:''' | ||
HEP3 packets include a timestamp field that represents when the packet was captured at the source. VoIPmonitor uses this HEP timestamp for the call record. If the source HEP server has an unreliable or unsynchronized time source, this can cause incorrect timestamps in the captured calls. | |||
Currently, there is no built-in configuration option to ignore the HEP timestamp and instead use the time when VoIPmonitor receives the packet. If you need this functionality, please: | |||
* Request the feature on the product roadmap (no guaranteed ETA) | |||
* Consider a custom development project for a fee | |||
== | == Distributed Deployment Models == | ||
For monitoring multiple remote offices or a large infrastructure, a distributed model is essential. This involves a central GUI/Database server collecting data from multiple remote sensors. | |||
Remote | === Classic Mode: Standalone Remote Sensors === | ||
In this traditional model, each remote sensor is a fully independent entity. | |||
* '''How it works:''' The remote sensor processes packets and stores PCAPs locally. It connects directly to the central MySQL/MariaDB database to write CDRs. For PCAP retrieval, the GUI typically needs network access to each sensor's management port (default <code>TCP/5029</code>). | |||
* '''Pros:''' Simple conceptual model. | |||
* '''Cons:''' Requires opening firewall ports to each sensor and managing database credentials on every remote machine. | |||
==== Alternative PCAP Access: NFS/SSHFS Mounting ==== | |||
For environments where direct TCP/5029 access to remote sensors is impractical (e.g., firewalls, VPN limitations), you can mount remote spool directories on the central GUI server using NFS or SSHFS. | |||
'''Use Cases:''' | |||
* Firewall policies block TCP/5029 but allow SSH or NFS traffic | |||
* Remote sensors have local databases that need to be queried separately | |||
* You want the GUI to access PCAPs directly from mounted filesystems instead of proxying through TCP/5029 | |||
'''Configuration Steps:''' | |||
1. **Mount remote spools on GUI server:** | |||
Using NFS: | |||
<pre> | |||
# On GUI server, mount remote spool directory | |||
sudo mount -t nfs 10.224.0.101:/var/spool/voipmonitor /mnt/voipmonitor/sensor1 | |||
sudo mount -t nfs 10.224.0.102:/var/spool/voipmonitor /mnt/voipmonitor/sensor2 | |||
# Add to /etc/fstab for persistent mounts | |||
10.224.0.101:/var/spool/voipmonitor /mnt/voipmonitor/sensor1 nfs defaults 0 0 | |||
10.224.0.102:/var/spool/voipmonitor /mnt/voipmonitor/sensor2 nfs defaults 0 0 | |||
</pre> | |||
Using SSHFS: | |||
<pre> | |||
# On GUI server, mount remote spool via SSHFS | |||
sshfs voipmonitor@10.224.0.101:/var/spool/voipmonitor /mnt/voipmonitor/sensor1 | |||
sshfs voipmonitor@10.224.0.102:/var/spool/voipmonitor /mnt/voipmonitor/sensor2 | |||
# Add to /etc/fstab for persistent mounts (with key-based auth) | |||
voipmonitor@10.224.0.101:/var/spool/voipmonitor /mnt/voipmonitor/sensor1 fuse.sshfs defaults,IdentityFile=/home/voipmonitor/.ssh/id_rsa 0 0 | |||
</pre> | |||
2. **Configure PCAP spooldir path in GUI:** | |||
In the GUI, go to '''Settings > System Configuration > Sniffer data path''' and set it to search multiple spool directories. Each directory is separated by a colon (<code>:</code>). | |||
<pre> | |||
Sniffer data path: /var/spool/voipmonitor:/mnt/voipmonitor/sensor1:/mnt/voipmonitor/sensor2 | |||
</pre> | |||
The GUI will search these paths in order when looking for PCAP files. | |||
3. **Register remote sensors in GUI:** | |||
* | |||
* | |||
Go to '''Settings > Sensors''' and register each remote sensor: | |||
* | * '''Sensor ID:''' Must match <code>id_sensor</code> in each remote's <code>voipmonitor.conf</code> | ||
* '''Name:''' Descriptive name (e.g., "Site 1 - London") | |||
* '''Manager IP, Port:''' Optional with NFS/SSHFS mount (leave empty if mounting spools directly) | |||
'''Important Notes:''' | |||
* Each remote sensor must have a unique <code>id_sensor</code> configured in <code>voipmonitor.conf</code> | |||
* Remote sensors write directly to their local MySQL database (or possibly to a central database) | |||
* Filter calls by site using the <code>id_sensor</code> column in the CDR view | |||
* Ensure mounted directories are writable by the GUI user for PCAP uploads | |||
* For better performance, use NFS with async or SSHFS with caching options | |||
'''Filtering and Site Identification:''' | |||
* In the CDR view, use the '''Sensor''' dropdown filter to select specific sites | |||
* Alternatively, filter by IP address ranges using CDR columns | |||
* The <code>id_sensor</code> column in the database uniquely identifies which sensor captured each call | |||
* Sensor names can be customized in '''Settings > Sensors''' for easier identification | |||
'''Comparison: TCP/5029 vs NFS/SSHFS''' | |||
{| class="wikitable" | |||
! Approach | |||
! Network Traffic | |||
! Firewall Requirements | |||
! Performance | |||
! Use Case | |||
|- | |||
| TCP/5029 Proxy (Standard) | |||
| On-demand fetch per request | |||
| TCP/5029 outbound from GUI to sensors | |||
| Better (no continuous mount overhead) | |||
| Most deployments | |||
|- | |||
| NFS Mount | |||
| Continuous (filesystem access) | |||
| NFS ports (usually 2049) bidirectional | |||
| Excellent (local filesystem speed) | |||
| Local networks, high-throughput | |||
|- | |||
| SSHFS Mount | |||
| Continuous (encrypted filesystem) | |||
| SSH (TCP/22) outbound from GUI | |||
| Good (some encryption overhead) | |||
| Remote sites, cloud/VPN | |||
|} | |||
=== Modern Mode: Client/Server Architecture (v20+) — Recommended === | |||
This model uses a secure, encrypted TCP channel between remote sensors (clients) and a central sensor instance (server). The GUI communicates with the central server only, which significantly simplifies networking and security. | |||
This architecture supports two primary modes: | |||
# '''Local Processing:''' Remote sensors process packets locally and send only lightweight CDR data over the encrypted channel. PCAPs remain on the remote sensor. On-demand PCAP fetch is proxied via the central server (to the sensor's <code>TCP/5029</code>). | |||
# '''Packet Mirroring:''' Remote sensors forward the entire raw packet stream to the central server, which performs all processing and storage. Ideal for low-resource remote sites. | |||
==== Architecture Diagrams (PlantUML) ==== | |||
<kroki lang="plantuml"> | |||
@startuml | |||
skinparam shadowing false | |||
skinparam defaultFontName Arial | |||
skinparam rectangle { | |||
BorderColor #4A90E2 | |||
BackgroundColor #FFFFFF | |||
stereotypeFontColor #333333 | |||
} | |||
skinparam packageBorderColor #B0BEC5 | |||
skinparam packageBackgroundColor #F7F9FC | |||
title Client/Server Architecture — Local Processing Mode | |||
package "Remote Site" { | |||
[Remote Probe/Sensor] as Remote | |||
database "Local Storage (PCAP)" as RemotePCAP | |||
} | |||
package "Central Site" { | |||
[Central VoIPmonitor Server] as Central | |||
database "Central MySQL/MariaDB" as CentralDB | |||
[Web GUI] as GUI | |||
} | |||
Remote -[#2F6CB0]-> Central : Encrypted TCP/60024\nCDRs only | |||
Remote --> RemotePCAP : Stores PCAP locally | |||
Central --> CentralDB : Writes CDRs | |||
GUI -[#2F6CB0]-> Central : Queries data & requests PCAPs | |||
Central -[#2F6CB0]-> RemotePCAP : Fetches PCAPs on demand (TCP/5029) | |||
@enduml | |||
</kroki> | |||
<kroki lang="plantuml"> | |||
@startuml | |||
skinparam shadowing false | |||
skinparam defaultFontName Arial | |||
skinparam rectangle { | |||
BorderColor #4A90E2 | |||
BackgroundColor #FFFFFF | |||
stereotypeFontColor #333333 | |||
} | |||
skinparam packageBorderColor #B0BEC5 | |||
skinparam packageBackgroundColor #F7F9FC | |||
title Client/Server Architecture — Packet Mirroring Mode | |||
package "Remote Site" { | |||
[Remote Probe/Sensor\n(Low Resource)] as Remote | |||
} | |||
package "Central Site" { | |||
[Central VoIPmonitor Server] as Central | |||
database "Central MySQL/MariaDB" as CentralDB | |||
database "Central Storage (PCAP)" as CentralPCAP | |||
[Web GUI] as GUI | |||
} | |||
Remote -[#2F6CB0]-> Central : Encrypted TCP/60024\nRaw packet stream | |||
Central --> CentralDB : Writes CDRs | |||
Central --> CentralPCAP : Processes & stores PCAPs | |||
GUI -[#2F6CB0]-> Central : Queries data & downloads PCAPs | |||
@enduml | |||
</kroki> | |||
==== Step-by-Step Configuration Guide ==== | |||
; Prerequisites | |||
* VoIPmonitor v20+ on all sensors. | |||
* Central database reachable from the central server instance. | |||
* Unique <code>id_sensor</code> per sensor (< 65536). | |||
* NTP running everywhere (see '''Time Synchronization''' below). | |||
; Scenario A — Local Processing (default, low WAN usage) | |||
<pre> | |||
# /etc/voipmonitor.conf on the REMOTE sensor (LOCAL PROCESSING) | |||
id_sensor = 2 # unique per sensor (< 65536) | |||
server_destination = 10.224.0.250 | |||
server_destination_port = 60024 | |||
server_password = your_strong_password | |||
packetbuffer_sender = no # local analysis; sends only CDRs | |||
interface = eth0 # or: interface = any | |||
sipport = 5060 # example; add your usual sniffer options | |||
# No MySQL credentials here — remote sensor does NOT write to DB directly. | |||
</pre> | |||
<pre> | |||
# /etc/voipmonitor.conf on the CENTRAL server (LOCAL PROCESSING network) | |||
server_bind = 0.0.0.0 | |||
server_bind_port = 60024 | |||
server_password = your_strong_password | |||
mysqlhost = 10.224.0.201 | |||
mysqldb = voipmonitor | |||
mysqluser = voipmonitor | |||
mysqlpassword = db_password | |||
cdr_partition = yes # partitions for CDR tables | |||
mysqlloadconfig = yes # allows DB-driven config if used | |||
interface = # leave empty to avoid local sniffing | |||
# The central server will proxy on-demand PCAP fetches to sensors (TCP/5029). | |||
</pre> | |||
; Scenario B — Packet Mirroring (centralized processing/storage) | |||
<pre> | |||
# /etc/voipmonitor.conf on the REMOTE sensor (PACKET MIRRORING) | |||
id_sensor = 3 | |||
server_destination = 10.224.0.250 | |||
server_destination_port = 60024 | |||
server_password = your_strong_password | |||
packetbuffer_sender = yes # send RAW packet stream to central | |||
interface = eth0 # capture source; no DB settings needed | |||
</pre> | |||
<pre> | |||
# /etc/voipmonitor.conf on the CENTRAL server (PACKET MIRRORING) | |||
server_bind = 0.0.0.0 | |||
server_bind_port = 60024 | |||
server_password = your_strong_password | |||
mysqlhost = 10.224.0.201 | |||
mysqldb = voipmonitor | |||
mysqluser = voipmonitor | |||
mysqlpassword = db_password | |||
cdr_partition = yes | |||
mysqlloadconfig = yes | |||
# As this server does all analysis, configure as if sniffing locally: | |||
sipport = 5060 | |||
# ... add your usual sniffer/storage options (pcap directories, limits, etc.) | |||
</pre> | |||
==== Firewall Checklist (Quick Reference) ==== | |||
* '''Modern Client/Server (v20+):''' | |||
** '''Central Server:''' Allow inbound <code>TCP/60024</code> from remote sensors. Allow inbound <code>TCP/5029</code> from GUI (management/API to central sensor). | |||
** '''Remote Sensors (Local Processing only):''' Allow inbound <code>TCP/5029</code> from the central server (for on-demand PCAP fetch via proxy). Outbound <code>TCP/60024</code> to the central server. | |||
* '''Cloud Mode:''' | |||
** '''Remote Sensors:''' Allow outbound <code>TCP/60023</code> to <code>cloud.voipmonitor.org</code>. | |||
== Configuration & Checklists == | |||
=== Parameter Notes (clarifications) === | |||
* '''<code>id_sensor</code>''' — Mandatory in any distributed deployment (Classic or Client/Server). Must be unique per sensor (< 65536). The value is written to the database and used by the GUI to identify where a call was captured. | |||
* '''<code>cdr_partition</code>''' — In Client/Server, enable on the central server instance that writes to the database. It can be disabled on remote "client" sensors that only mirror packets. | |||
* '''<code>mysqlloadconfig</code>''' — When enabled, the sensor can load additional parameters dynamically from the <code>sensor_config</code> table in the database. Typically enabled on the central server sensor that writes to DB; keep disabled on remote clients which do not access DB directly. | |||
* '''<code>interface</code>''' — Use a specific NIC (e.g., <code>eth0</code>) or <code>any</code> to capture from multiple NICs. For <code>any</code> ensure promiscuous mode on each NIC. | |||
=== Initial Service Start & Database Initialization === | |||
After installation, the '''first startup''' against a new/empty database is critical. | |||
# Start the service: <code>systemctl start voipmonitor</code> | |||
# Follow logs to ensure schema/partition creation completes: | |||
#* <code>journalctl -u voipmonitor -f</code> | |||
#* or <code>tail -f /var/log/syslog | grep voipmonitor</code> | |||
You should see creation of functions and partitions shortly after start. If you see errors like <code>Table 'cdr_next_1' doesn't exist</code>, the sensor is failing to initialize the schema — usually due to insufficient DB privileges or connectivity. Fix DB access and restart the sensor so it can finish initialization. | |||
=== Time Synchronization === | |||
Accurate and synchronized time is '''critical''' for correlating call legs from different sensors. All servers (GUI, DB, and all Sensors) must run an NTP client (e.g., <code>chrony</code> or <code>ntpdate</code>) to keep clocks in sync. | |||
== Comparison of Remote Deployment Modes == | |||
{| class="wikitable" | |||
! Deployment Model | |||
! Packet Processing Location | |||
! PCAP Storage Location | |||
! Network Traffic to Central Server | |||
! GUI Connectivity | |||
|- | |||
| Classic Standalone | |||
| Remote | |||
| Remote | |||
| Minimal (MySQL CDRs) | |||
| GUI ↔ each Sensor (management port) | |||
|- | |||
| '''Modern Client/Server (Local Processing)''' | |||
| Remote | |||
| Remote | |||
| Minimal (Encrypted CDRs) | |||
| '''GUI ↔ Central Server only''' (central proxies PCAP fetch) | |||
|- | |||
| '''Modern Client/Server (Packet Mirroring)''' | |||
| '''Central''' | |||
| '''Central''' | |||
| High (Encrypted full packets) | |||
| '''GUI ↔ Central Server only''' | |||
|} | |||
== FAQ & Common Pitfalls == | |||
* '''Do remote sensors need DB credentials in Client/Server?''' No. Only the central server instance writes to DB. | |||
* '''Why is <code>id_sensor</code> required everywhere?''' The GUI uses it to tag and filter calls by capture source. | |||
* '''Local Processing still fetches PCAPs from remote — who connects to whom?''' The GUI requests via the central server; the central server then connects to the remote sensor's <code>TCP/5029</code> to retrieve the PCAP. | |||
== AI Summary for RAG == | |||
'''Summary:''' This guide covers the deployment topologies for VoIPmonitor. It contrasts running the sensor on the same host as a PBX versus on a dedicated server. For dedicated sensors, it details methods for forwarding traffic, including hardware-based port mirroring (SPAN) and various software-based tunneling protocols (IP-in-IP, GRE, TZSP, VXLAN, HEP, AudioCodes, IPFIX). The core of the article explains distributed architectures for multi-site monitoring, comparing the "classic" standalone remote sensor model with the modern, recommended "client/server" model. It details the two operational modes of the client/server architecture: local processing (sending only CDRs, PCAPs remain remote with central-proxied fetch) and packet mirroring (sending full, raw packets for central processing), which is ideal for low-resource endpoints. The article also explains an alternative approach for classic remote sensors: mounting PCAP spools via NFS or SSHFS when TCP/5029 access to sensors is blocked by firewalls. The guide concludes with step-by-step configuration, firewall rules, critical parameter notes, and the importance of NTP plus first-start DB initialization. | |||
'''Keywords:''' deployment, architecture, topology, on-host, dedicated sensor, port mirroring, SPAN, RSPAN, traffic mirroring, tunneling, GRE, TZSP, VXLAN, HEP, AudioCodes, IPFIX, remote sensor, multi-site, client server mode, packet mirroring, local processing, firewall rules, NTP, time synchronization, cloud mode, NFS, SSHFS, spooldir mounting | |||
'''Key Questions:''' | |||
* How do I set up VoIPmonitor to monitor multiple remote locations? | |||
* What is the difference between the classic remote sensor and the modern client/server mode? | |||
* When should I use packet mirroring (<code>packetbuffer_sender</code>) instead of local processing? | |||
* What are the firewall requirements for the client/server deployment model? | |||
* How can I access PCAP files from remote sensors if TCP/5029 is blocked? | |||
* How do I configure NFS or SSHFS to mount remote PCAP spools? | |||
* How do I configure the GUI sniffer data path for multiple mounted spools? | |||
* Can I run the sensor on the same machine as my Asterisk/FreeSWITCH server? | |||
* What is a SPAN port and how is it used with VoIPmonitor? | |||
* Why is NTP important for a distributed VoIPmonitor setup? | |||
* What is HEP and how do I configure VoIPmonitor to receive HEP packets? | |||
* How do I configure GRE, ERSPAN, and VXLAN tunneling for VoIPmonitor? | |||
Latest revision as of 06:04, 5 January 2026
This guide provides a comprehensive overview of VoIPmonitor's deployment models. It covers the fundamental choice between on-host and dedicated sensors, methods for capturing traffic, and detailed configurations for scalable, multi-site architectures.
Core Concept: Where to Capture Traffic
The first decision in any deployment is where the VoIPmonitor sensor (sniffer) will run.
1. On-Host Capture (on the PBX/SBC)
The sensor can be installed directly on the same Linux server that runs your PBX or SBC.
- Pros: Requires no extra hardware, network changes, or port mirroring. It is the simplest setup.
- Cons: Adds CPU, memory, and disk I/O load to your production voice server. If these resources are critical, a dedicated sensor is the recommended approach.
2. Dedicated Sensor
A dedicated Linux server runs only the VoIPmonitor sensor. This is the recommended approach for production environments as it isolates monitoring resources from your voice platform. To use a dedicated sensor, you must forward a copy of the network traffic to it using one of the methods below.
Methods for Forwarding Traffic to a Dedicated Sensor
A. Hardware Port Mirroring (SPAN/RSPAN)
This is the most common and reliable method. You configure your physical network switch to copy all traffic from the switch ports connected to your PBX/SBC to the switch port connected to the VoIPmonitor sensor. This feature is commonly called Port Mirroring, SPAN, or RSPAN. Consult your switch's documentation for configuration details.
The VoIPmonitor sensor interface will be put into promiscuous mode automatically. To capture from multiple interfaces, set interface = any in voipmonitor.conf and enable promiscuous mode manually on each NIC (e.g., ip link set dev eth1 promisc on).
B. Software-based Tunnelling
When hardware mirroring is not an option, many network devices and PBXs can encapsulate VoIP packets and send them to the sensor's IP address using a tunnel. VoIPmonitor natively supports a wide range of protocols.
- Built-in Support: IP-in-IP, GRE, ERSPAN
- UDP-based Tunnels: Configure the corresponding port in
voipmonitor.conf:udp_port_tzsp = 37008(for MikroTik's TZSP)udp_port_l2tp = 1701udp_port_vxlan = 4789(common in cloud environments)
- Proprietary & Other Protocols:
- AudioCodes Tunneling (uses
udp_port_audiocodesortcp_port_audiocodes) - HEP (Homer Encapsulation Protocol)
- IPFIX (for Oracle SBCs) (enable
ipfix*options)
- AudioCodes Tunneling (uses
HEP (Homer Encapsulation Protocol)
HEP is a lightweight protocol for capturing and mirroring VoIP packets. Many SBCs and sip proxies (such as Kamailio, OpenSIPS, FreeSWITCH) support HEP to send a copy of traffic to a monitoring server.
Configuration in voipmonitor.conf:
# Enable HEP support hep = yes # Port to listen for HEP packets (default: 9060) hep_bind_port = 9060 # Optional: Bind to specific IP address # hep_bind_ip = 0.0.0.0
When hep = yes, VoIPmonitor listens for HEPv3 (and compatible HEPv2) packets and extracts the original VoIP traffic from the encapsulation.
Use Cases:
- Remote SBCs or PBXs export traffic to a centralized VoIPmonitor server
- Kamailio/FreeSWITCH
siptracemodule integration - Environments where standard tunnels (GRE/ERSPAN) are not available
Note: There is also hep_kamailio_protocol_id_fix = yes for Kamailio-specific protocol ID issues.
Known Limitations:
HEP3 packets include a timestamp field that represents when the packet was captured at the source. VoIPmonitor uses this HEP timestamp for the call record. If the source HEP server has an unreliable or unsynchronized time source, this can cause incorrect timestamps in the captured calls.
Currently, there is no built-in configuration option to ignore the HEP timestamp and instead use the time when VoIPmonitor receives the packet. If you need this functionality, please:
- Request the feature on the product roadmap (no guaranteed ETA)
- Consider a custom development project for a fee
Distributed Deployment Models
For monitoring multiple remote offices or a large infrastructure, a distributed model is essential. This involves a central GUI/Database server collecting data from multiple remote sensors.
Classic Mode: Standalone Remote Sensors
In this traditional model, each remote sensor is a fully independent entity.
- How it works: The remote sensor processes packets and stores PCAPs locally. It connects directly to the central MySQL/MariaDB database to write CDRs. For PCAP retrieval, the GUI typically needs network access to each sensor's management port (default
TCP/5029). - Pros: Simple conceptual model.
- Cons: Requires opening firewall ports to each sensor and managing database credentials on every remote machine.
Alternative PCAP Access: NFS/SSHFS Mounting
For environments where direct TCP/5029 access to remote sensors is impractical (e.g., firewalls, VPN limitations), you can mount remote spool directories on the central GUI server using NFS or SSHFS.
Use Cases:
- Firewall policies block TCP/5029 but allow SSH or NFS traffic
- Remote sensors have local databases that need to be queried separately
- You want the GUI to access PCAPs directly from mounted filesystems instead of proxying through TCP/5029
Configuration Steps:
1. **Mount remote spools on GUI server:**
Using NFS:
# On GUI server, mount remote spool directory sudo mount -t nfs 10.224.0.101:/var/spool/voipmonitor /mnt/voipmonitor/sensor1 sudo mount -t nfs 10.224.0.102:/var/spool/voipmonitor /mnt/voipmonitor/sensor2 # Add to /etc/fstab for persistent mounts 10.224.0.101:/var/spool/voipmonitor /mnt/voipmonitor/sensor1 nfs defaults 0 0 10.224.0.102:/var/spool/voipmonitor /mnt/voipmonitor/sensor2 nfs defaults 0 0
Using SSHFS:
# On GUI server, mount remote spool via SSHFS sshfs voipmonitor@10.224.0.101:/var/spool/voipmonitor /mnt/voipmonitor/sensor1 sshfs voipmonitor@10.224.0.102:/var/spool/voipmonitor /mnt/voipmonitor/sensor2 # Add to /etc/fstab for persistent mounts (with key-based auth) voipmonitor@10.224.0.101:/var/spool/voipmonitor /mnt/voipmonitor/sensor1 fuse.sshfs defaults,IdentityFile=/home/voipmonitor/.ssh/id_rsa 0 0
2. **Configure PCAP spooldir path in GUI:**
In the GUI, go to Settings > System Configuration > Sniffer data path and set it to search multiple spool directories. Each directory is separated by a colon (:).
Sniffer data path: /var/spool/voipmonitor:/mnt/voipmonitor/sensor1:/mnt/voipmonitor/sensor2
The GUI will search these paths in order when looking for PCAP files.
3. **Register remote sensors in GUI:**
Go to Settings > Sensors and register each remote sensor: * Sensor ID: Must matchid_sensorin each remote'svoipmonitor.conf* Name: Descriptive name (e.g., "Site 1 - London") * Manager IP, Port: Optional with NFS/SSHFS mount (leave empty if mounting spools directly)
Important Notes:
- Each remote sensor must have a unique
id_sensorconfigured invoipmonitor.conf - Remote sensors write directly to their local MySQL database (or possibly to a central database)
- Filter calls by site using the
id_sensorcolumn in the CDR view - Ensure mounted directories are writable by the GUI user for PCAP uploads
- For better performance, use NFS with async or SSHFS with caching options
Filtering and Site Identification:
- In the CDR view, use the Sensor dropdown filter to select specific sites
- Alternatively, filter by IP address ranges using CDR columns
- The
id_sensorcolumn in the database uniquely identifies which sensor captured each call - Sensor names can be customized in Settings > Sensors for easier identification
Comparison: TCP/5029 vs NFS/SSHFS
| Approach | Network Traffic | Firewall Requirements | Performance | Use Case |
|---|---|---|---|---|
| TCP/5029 Proxy (Standard) | On-demand fetch per request | TCP/5029 outbound from GUI to sensors | Better (no continuous mount overhead) | Most deployments |
| NFS Mount | Continuous (filesystem access) | NFS ports (usually 2049) bidirectional | Excellent (local filesystem speed) | Local networks, high-throughput |
| SSHFS Mount | Continuous (encrypted filesystem) | SSH (TCP/22) outbound from GUI | Good (some encryption overhead) | Remote sites, cloud/VPN |
Modern Mode: Client/Server Architecture (v20+) — Recommended
This model uses a secure, encrypted TCP channel between remote sensors (clients) and a central sensor instance (server). The GUI communicates with the central server only, which significantly simplifies networking and security.
This architecture supports two primary modes:
- Local Processing: Remote sensors process packets locally and send only lightweight CDR data over the encrypted channel. PCAPs remain on the remote sensor. On-demand PCAP fetch is proxied via the central server (to the sensor's
TCP/5029). - Packet Mirroring: Remote sensors forward the entire raw packet stream to the central server, which performs all processing and storage. Ideal for low-resource remote sites.
Architecture Diagrams (PlantUML)
Step-by-Step Configuration Guide
- Prerequisites
- VoIPmonitor v20+ on all sensors.
- Central database reachable from the central server instance.
- Unique
id_sensorper sensor (< 65536). - NTP running everywhere (see Time Synchronization below).
- Scenario A — Local Processing (default, low WAN usage)
# /etc/voipmonitor.conf on the REMOTE sensor (LOCAL PROCESSING) id_sensor = 2 # unique per sensor (< 65536) server_destination = 10.224.0.250 server_destination_port = 60024 server_password = your_strong_password packetbuffer_sender = no # local analysis; sends only CDRs interface = eth0 # or: interface = any sipport = 5060 # example; add your usual sniffer options # No MySQL credentials here — remote sensor does NOT write to DB directly.
# /etc/voipmonitor.conf on the CENTRAL server (LOCAL PROCESSING network) server_bind = 0.0.0.0 server_bind_port = 60024 server_password = your_strong_password mysqlhost = 10.224.0.201 mysqldb = voipmonitor mysqluser = voipmonitor mysqlpassword = db_password cdr_partition = yes # partitions for CDR tables mysqlloadconfig = yes # allows DB-driven config if used interface = # leave empty to avoid local sniffing # The central server will proxy on-demand PCAP fetches to sensors (TCP/5029).
- Scenario B — Packet Mirroring (centralized processing/storage)
# /etc/voipmonitor.conf on the REMOTE sensor (PACKET MIRRORING) id_sensor = 3 server_destination = 10.224.0.250 server_destination_port = 60024 server_password = your_strong_password packetbuffer_sender = yes # send RAW packet stream to central interface = eth0 # capture source; no DB settings needed
# /etc/voipmonitor.conf on the CENTRAL server (PACKET MIRRORING) server_bind = 0.0.0.0 server_bind_port = 60024 server_password = your_strong_password mysqlhost = 10.224.0.201 mysqldb = voipmonitor mysqluser = voipmonitor mysqlpassword = db_password cdr_partition = yes mysqlloadconfig = yes # As this server does all analysis, configure as if sniffing locally: sipport = 5060 # ... add your usual sniffer/storage options (pcap directories, limits, etc.)
Firewall Checklist (Quick Reference)
- Modern Client/Server (v20+):
- Central Server: Allow inbound
TCP/60024from remote sensors. Allow inboundTCP/5029from GUI (management/API to central sensor). - Remote Sensors (Local Processing only): Allow inbound
TCP/5029from the central server (for on-demand PCAP fetch via proxy). OutboundTCP/60024to the central server.
- Central Server: Allow inbound
- Cloud Mode:
- Remote Sensors: Allow outbound
TCP/60023tocloud.voipmonitor.org.
- Remote Sensors: Allow outbound
Configuration & Checklists
Parameter Notes (clarifications)
id_sensor— Mandatory in any distributed deployment (Classic or Client/Server). Must be unique per sensor (< 65536). The value is written to the database and used by the GUI to identify where a call was captured.cdr_partition— In Client/Server, enable on the central server instance that writes to the database. It can be disabled on remote "client" sensors that only mirror packets.mysqlloadconfig— When enabled, the sensor can load additional parameters dynamically from thesensor_configtable in the database. Typically enabled on the central server sensor that writes to DB; keep disabled on remote clients which do not access DB directly.interface— Use a specific NIC (e.g.,eth0) oranyto capture from multiple NICs. Foranyensure promiscuous mode on each NIC.
Initial Service Start & Database Initialization
After installation, the first startup against a new/empty database is critical.
- Start the service:
systemctl start voipmonitor - Follow logs to ensure schema/partition creation completes:
journalctl -u voipmonitor -f- or
tail -f /var/log/syslog | grep voipmonitor
You should see creation of functions and partitions shortly after start. If you see errors like Table 'cdr_next_1' doesn't exist, the sensor is failing to initialize the schema — usually due to insufficient DB privileges or connectivity. Fix DB access and restart the sensor so it can finish initialization.
Time Synchronization
Accurate and synchronized time is critical for correlating call legs from different sensors. All servers (GUI, DB, and all Sensors) must run an NTP client (e.g., chrony or ntpdate) to keep clocks in sync.
Comparison of Remote Deployment Modes
| Deployment Model | Packet Processing Location | PCAP Storage Location | Network Traffic to Central Server | GUI Connectivity |
|---|---|---|---|---|
| Classic Standalone | Remote | Remote | Minimal (MySQL CDRs) | GUI ↔ each Sensor (management port) |
| Modern Client/Server (Local Processing) | Remote | Remote | Minimal (Encrypted CDRs) | GUI ↔ Central Server only (central proxies PCAP fetch) |
| Modern Client/Server (Packet Mirroring) | Central | Central | High (Encrypted full packets) | GUI ↔ Central Server only |
FAQ & Common Pitfalls
- Do remote sensors need DB credentials in Client/Server? No. Only the central server instance writes to DB.
- Why is
id_sensorrequired everywhere? The GUI uses it to tag and filter calls by capture source. - Local Processing still fetches PCAPs from remote — who connects to whom? The GUI requests via the central server; the central server then connects to the remote sensor's
TCP/5029to retrieve the PCAP.
AI Summary for RAG
Summary: This guide covers the deployment topologies for VoIPmonitor. It contrasts running the sensor on the same host as a PBX versus on a dedicated server. For dedicated sensors, it details methods for forwarding traffic, including hardware-based port mirroring (SPAN) and various software-based tunneling protocols (IP-in-IP, GRE, TZSP, VXLAN, HEP, AudioCodes, IPFIX). The core of the article explains distributed architectures for multi-site monitoring, comparing the "classic" standalone remote sensor model with the modern, recommended "client/server" model. It details the two operational modes of the client/server architecture: local processing (sending only CDRs, PCAPs remain remote with central-proxied fetch) and packet mirroring (sending full, raw packets for central processing), which is ideal for low-resource endpoints. The article also explains an alternative approach for classic remote sensors: mounting PCAP spools via NFS or SSHFS when TCP/5029 access to sensors is blocked by firewalls. The guide concludes with step-by-step configuration, firewall rules, critical parameter notes, and the importance of NTP plus first-start DB initialization.
Keywords: deployment, architecture, topology, on-host, dedicated sensor, port mirroring, SPAN, RSPAN, traffic mirroring, tunneling, GRE, TZSP, VXLAN, HEP, AudioCodes, IPFIX, remote sensor, multi-site, client server mode, packet mirroring, local processing, firewall rules, NTP, time synchronization, cloud mode, NFS, SSHFS, spooldir mounting
Key Questions:
- How do I set up VoIPmonitor to monitor multiple remote locations?
- What is the difference between the classic remote sensor and the modern client/server mode?
- When should I use packet mirroring (
packetbuffer_sender) instead of local processing? - What are the firewall requirements for the client/server deployment model?
- How can I access PCAP files from remote sensors if TCP/5029 is blocked?
- How do I configure NFS or SSHFS to mount remote PCAP spools?
- How do I configure the GUI sniffer data path for multiple mounted spools?
- Can I run the sensor on the same machine as my Asterisk/FreeSWITCH server?
- What is a SPAN port and how is it used with VoIPmonitor?
- Why is NTP important for a distributed VoIPmonitor setup?
- What is HEP and how do I configure VoIPmonitor to receive HEP packets?
- How do I configure GRE, ERSPAN, and VXLAN tunneling for VoIPmonitor?