How To Install Ntopng on openSUSE
Network monitoring is essential for maintaining security, optimizing performance, and troubleshooting issues in any Linux environment. Ntopng stands as one of the most powerful open-source network traffic analyzers available today, offering deep packet inspection and intuitive visualization capabilities for system administrators. Installing and configuring ntopng on openSUSE provides comprehensive visibility into your network traffic patterns, protocol distribution, and potential security threats.
This comprehensive guide covers multiple approaches to installing ntopng on openSUSE, from package-based methods to source compilation, along with detailed configuration instructions and optimization techniques. Whether you’re managing a small network or enterprise infrastructure, by the end of this tutorial, you’ll have a fully functional network monitoring solution tailored to your specific requirements.
We’ll explore three distinct installation methods, each with its own advantages, followed by essential configuration steps, integration options, and troubleshooting tips to ensure your ntopng deployment runs optimally on openSUSE Leap or Tumbleweed distributions.
Understanding Ntopng
Ntopng (Network Top Next Generation) represents a significant evolution from the original ntop tool, completely rewritten to leverage modern web technologies and efficient C++ programming. As a high-performance network traffic analyzer, ntopng provides real-time insights into your network’s behavior through detailed packet inspection and traffic analysis.
At its core, ntopng captures and processes network packets traversing monitored interfaces, identifying applications, protocols, and traffic patterns. The software employs the nDPI (Deep Packet Inspection) library to classify network flows into hundreds of protocols and applications, from common HTTP traffic to specialized industrial protocols.
Key features that make ntopng valuable for openSUSE administrators include:
- Real-time traffic monitoring and bandwidth analysis
- Flow-based network traffic visualization
- Host activity tracking and communication patterns
- Protocol and application recognition
- Geolocation mapping of network connections
- Historical data storage and trending
- Alert generation for anomalous traffic patterns
- Intuitive web-based interface accessible from any browser
For openSUSE environments, ntopng offers particular advantages through its efficient resource utilization and seamless integration with Linux networking components. The architecture allows for flexible deployment options, from small single-interface monitoring to distributed setups across complex networks. Unlike commercial alternatives that require dedicated appliances, ntopng transforms your existing openSUSE server into a sophisticated network visibility platform.
Prerequisites
Before proceeding with ntopng installation on openSUSE, ensure your system meets the following requirements to guarantee successful deployment and optimal performance:
Supported openSUSE Versions
- openSUSE Leap 15.4 or newer
- openSUSE Leap 15.5
- openSUSE Tumbleweed (rolling release)
System Requirements
- Minimum 2 CPU cores (4+ cores recommended for busy networks)
- At least 2GB RAM (4GB+ recommended for production environments)
- 20GB free disk space for database storage and historical data
- At least one active network interface to monitor
Required Permissions
Administrator access via sudo or root is necessary for installation and configuration. All commands in this guide assume sudo privileges are available.
Essential Dependencies
Ntopng relies on several key components to function properly:
- Redis server (for data storage)
- libpcap (packet capture library)
- libmaxminddb (for GeoIP functionality)
- zlib and other compression libraries
- Development tools (for source compilation)
Network Configuration
Ensure the network interfaces you intend to monitor are properly configured and active. For remote access to the ntopng web interface, you’ll need to configure your firewall to permit access to the ntopng web port (default: 3000/tcp).
With these prerequisites in place, you can proceed to choose and implement one of the three installation methods detailed in the following sections, selecting the approach that best fits your specific requirements and comfort level with openSUSE administration.
Installation Method 1: Using Snap Package
The Snap package system offers a convenient way to install ntopng on openSUSE with minimal configuration. This containerized approach includes all dependencies, simplifying the installation process significantly.
Step 1: Install Snap Support
First, add Snap support to your openSUSE system by opening a terminal and executing the appropriate commands for your distribution version:
For openSUSE Leap 15.4:
sudo zypper addrepo --refresh https://download.opensuse.org/repositories/system:/snappy/openSUSE_Leap_15.4 snappy
sudo zypper --gpg-auto-import-keys refresh
sudo zypper install snapd
For openSUSE Leap 15.5:
sudo zypper addrepo --refresh https://download.opensuse.org/repositories/system:/snappy/openSUSE_Leap_15.5 snappy
sudo zypper --gpg-auto-import-keys refresh
sudo zypper install snapd
For openSUSE Tumbleweed:
sudo zypper addrepo --refresh https://download.opensuse.org/repositories/system:/snappy/openSUSE_Tumbleweed snappy
sudo zypper --gpg-auto-import-keys refresh
sudo zypper install snapd
Step 2: Enable and Start Snap Services
After installing the snapd package, enable and start the necessary services:
sudo systemctl enable --now snapd
sudo systemctl enable --now snapd.apparmor
Create the symbolic link for snap:
sudo ln -s /var/lib/snapd/snap /snap
Step 3: Install Ntopng via Snap
With Snap properly configured, install ntopng using the following command:
sudo snap install ntopng
Step 4: Configure Interface Access
By default, snap installations have limited access to system resources. Grant ntopng the necessary permissions to monitor network interfaces:
sudo snap connect ntopng:network-observe
sudo snap connect ntopng:network-control
sudo snap connect ntopng:firewall-control
Step 5: Verify Installation
Confirm that ntopng is running properly:
sudo snap services ntopng
If needed, restart the service:
sudo snap restart ntopng
Advantages and Limitations
The Snap installation method offers several benefits:
- Simplified installation process with minimal commands
- Automatic updates through the Snap system
- Consistent operation across different openSUSE versions
- Isolated environment preventing dependency conflicts
However, this approach has some limitations:
- Slightly higher resource usage due to containerization
- Potential performance impact compared to native installations
- Less flexibility for custom configurations
- More restricted access to system resources
After completing these steps, the ntopng web interface should be accessible at http://your_server_ip:3000/
(default admin/admin credentials).
Installation Method 2: Compiling from Source
Compiling ntopng from source provides maximum flexibility and ensures you have the latest features and optimizations. While more complex than package-based installations, this method allows for customized builds tailored to your specific environment.
Step 1: Install Build Dependencies
Begin by installing the necessary development tools and libraries:
sudo zypper install git gcc g++ make cmake autoconf automake libtool pkg-config \
libpcap-devel libzmq-devel libcurl-devel libmaxminddb-devel libxml2-devel \
libsqlite3-devel libmariadb-devel redis hiredis-devel libpng-devel \
libelf-devel libcap-devel zlib-devel binutils-devel
Step 2: Configure Redis
Redis is essential for ntopng’s data storage capabilities:
sudo systemctl enable redis
sudo systemctl start redis
redis-cli ping
The response should be “PONG”, confirming Redis is operational.
Step 3: Clone and Build nDPI Library
The nDPI library provides deep packet inspection capabilities:
cd /tmp
git clone https://github.com/ntop/nDPI.git
cd nDPI
./autogen.sh
./configure
make
sudo make install
Step 4: Clone and Build Ntopng
Now clone and compile ntopng itself:
cd /tmp
git clone https://github.com/ntop/ntopng.git
cd ntopng
./autogen.sh
./configure
make
sudo make install
Step 5: Create Configuration Directory
Set up the configuration directory structure:
sudo mkdir -p /usr/local/etc/ntopng
sudo cp /tmp/ntopng/conf/ntopng.conf.sample /usr/local/etc/ntopng/ntopng.conf
Step 6: Configure Installation
Edit the configuration file to specify which interfaces to monitor:
sudo nano /usr/local/etc/ntopng/ntopng.conf
Add these basic configuration parameters (customize as needed):
--interface=eth0
--local-networks=192.168.1.0/24
--redis=localhost
--http-port=3000
Step 7: Update Library Path
Ensure the system can find the newly installed libraries:
sudo ldconfig
Step 8: Test Your Installation
Run ntopng manually to verify everything works correctly:
sudo ntopng /usr/local/etc/ntopng/ntopng.conf
Troubleshooting Compilation Issues
If you encounter errors during compilation:
- Missing Dependencies: Install any additional packages mentioned in error messages
- Version Conflicts: Remove previous installations before compiling
- Compilation Errors: Ensure you’re using the latest source code
- nDPI Compatibility: Make sure nDPI and ntopng versions are compatible
Source compilation provides the most current version with optimizations specific to your environment, making it ideal for production deployments where performance is critical.
Installation Method 3: Using Package Repositories
Installing ntopng from package repositories offers a balance between simplicity and functionality. This method utilizes the official ntop repositories to provide properly packaged versions for openSUSE.
Step 1: Add Official Ntop Repository
First, add the ntop package repository appropriate for your openSUSE version:
For openSUSE Leap 15.4/15.5:
sudo zypper addrepo https://packages.ntop.org/opensuse/15/x86_64/ ntop
For openSUSE Tumbleweed:
sudo zypper addrepo https://packages.ntop.org/opensuse/tumbleweed/x86_64/ ntop
Step 2: Import Repository GPG Key
Import the GPG key to verify package integrity:
sudo rpm --import https://packages.ntop.org/ntop.key
Step 3: Refresh Repository Information
Update your repository metadata:
sudo zypper refresh
Step 4: Install Ntopng and Dependencies
Install ntopng along with required components:
sudo zypper install ntopng redis
If you want the PF_RING enhanced packet capture capabilities:
sudo zypper install pfring-dkms nprobe
Step 5: Configure Redis
Ensure Redis is properly configured and running:
sudo systemctl enable redis
sudo systemctl start redis
Step 6: Review Initial Configuration
The package installation creates a basic configuration file at /etc/ntopng/ntopng.conf
. Review and modify this file as needed:
sudo nano /etc/ntopng/ntopng.conf
Ensure your monitoring interface is specified:
-i=eth0
Step 7: Start and Enable the Ntopng Service
Enable ntopng to start at boot and launch the service:
sudo systemctl enable ntopng
sudo systemctl start ntopng
Step 8: Verify Service Status
Check that ntopng is running correctly:
sudo systemctl status ntopng
The repository installation provides a production-ready ntopng configuration that integrates cleanly with openSUSE’s package management system, making it suitable for most deployment scenarios. This method offers the benefit of simplified updates through your standard system update process.
Configuring Ntopng After Installation
Proper configuration is essential for maximizing ntopng’s monitoring capabilities on your openSUSE system. The primary configuration file location varies depending on your installation method:
- Snap installation: Configuration via snap settings
- Source installation:
/usr/local/etc/ntopng/ntopng.conf
- Repository installation:
/etc/ntopng/ntopng.conf
Essential Configuration Parameters
Edit the appropriate configuration file using your preferred text editor:
sudo nano /etc/ntopng/ntopng.conf
Key parameters to configure include:
Interface Selection
Specify which network interfaces to monitor:
-i=eth0,eth1
Use any
to monitor all interfaces: -i=any
Local Network Definition
Define your local network ranges to distinguish between internal and external traffic:
--local-networks=192.168.1.0/24,10.0.0.0/8
Web Interface Settings
Configure the web interface port (default is 3000):
--http-port=3000
For HTTPS access:
--https-port=3001
--cert-file=/path/to/certificate.pem
--key-file=/path/to/privatekey.pem
Data Retention
Control how long ntopng keeps historical data:
--data-dir=/var/lib/ntopng
--daemon
Authentication
Set an administrator password (replacing default credentials):
--set-admin-password=your_secure_password
Redis Configuration
Specify Redis connection details if using a non-default setup:
--redis=localhost:6379
Applying Configuration Changes
After modifying the configuration file, restart ntopng to apply changes:
For systemd service:
sudo systemctl restart ntopng
For snap installation:
sudo snap restart ntopng
Testing Your Configuration
Access the Ntopng web interface by navigating to http://your_server_ip:3000/
in your browser. Login with admin credentials and verify that your configured interfaces appear in the dashboard and are collecting traffic data.
Creating a Systemd Service for Ntopng
When installing ntopng from source, you’ll need to create a systemd service to manage its operation. This ensures ntopng starts automatically at boot and can be managed consistently with other system services.
Creating the Service File
Create a new systemd service file:
sudo nano /etc/systemd/system/ntopng.service
Add the following content, adjusting paths as necessary for your installation:
[Unit]
Description=ntopng High-Speed Web-based Traffic Analysis
After=network.target redis-server.service
Requires=redis-server.service
[Service]
Type=simple
ExecStart=/usr/local/bin/ntopng /usr/local/etc/ntopng/ntopng.conf
Restart=on-failure
RestartSec=30
User=ntopng
Group=ntopng
LimitCORE=infinity
[Install]
WantedBy=multi-user.target
Creating a Dedicated User
For security, create a dedicated user for running ntopng:
sudo useradd -r -s /bin/false ntopng
Setting Proper Permissions
Ensure the ntopng user has appropriate permissions:
sudo mkdir -p /var/lib/ntopng
sudo chown -R ntopng:ntopng /var/lib/ntopng
sudo chmod 750 /var/lib/ntopng
If you installed from source:
sudo chown -R ntopng:ntopng /usr/local/share/ntopng
sudo chmod -R 755 /usr/local/share/ntopng
Enabling and Starting the Service
Reload systemd to recognize the new service file:
sudo systemctl daemon-reload
Enable the service to start at boot:
sudo systemctl enable ntopng
Start the ntopng service:
sudo systemctl start ntopng
Verifying Service Status
Check that the service is running properly:
sudo systemctl status ntopng
Troubleshooting Service Issues
If the service fails to start, investigate using these steps:
- Check service logs:
sudo journalctl -u ntopng -n 50
- Verify configuration file syntax:
ntopng --check-config /path/to/ntopng.conf
- Test manual execution:
sudo -u ntopng /usr/local/bin/ntopng /usr/local/etc/ntopng/ntopng.conf
- Ensure Redis is running:
sudo systemctl status redis
- Check file permissions:
ls -la /var/lib/ntopng
Basic Usage and Interface Navigation
After successful installation, ntopng provides a feature-rich web interface for monitoring and analyzing network traffic. Here’s how to navigate and use the basic features:
Accessing the Web Interface
Open your web browser and navigate to http://your_server_ip:3000/
. Log in with your administrator credentials. The default username is “admin” with password “admin” unless changed during configuration.
Dashboard Overview
The main dashboard presents a comprehensive overview of your network with several key elements:
- Traffic Overview: Real-time graphs showing inbound and outbound traffic rates
- Active Hosts: Currently active devices on your network with traffic volumes
- Traffic Distribution: Charts showing protocol breakdown and application usage
- Interface Status: Status of all monitored network interfaces
- Alert Notifications: Any triggered alerts appear prominently
Exploring Host Information
Click on any host IP in the dashboard to access detailed information about that device:
- Historical traffic graphs and patterns
- Current and recent network connections
- Applications and protocols used
- Detailed breakdown of traffic flows
- DNS activity and queries
Analyzing Traffic Flows
The “Flows” section provides detailed analysis of network conversations:
- Navigate to “Flows” in the main menu
- Filter by host, protocol, or application
- Sort by volume, duration, or time
- Expand individual flows for packet-level details
Interpreting Visualizations
Ntopng excels at presenting complex data through intuitive visualizations:
- Sankey Diagrams: Visual representation of traffic flow between hosts
- Chord Diagrams: Show relationships between hosts and applications
- Treemaps: Hierarchical view of traffic distribution
- Time Series Graphs: Historical trends with zoom capabilities
Understanding these basic navigation elements allows you to quickly gain insights into your network’s behavior, identify anomalies, and investigate potential issues on your openSUSE system.
Advanced Configuration Options
Ntopng offers extensive customization options for advanced users seeking to tailor the monitoring environment to specific requirements. These configurations enhance security, performance, and integration capabilities.
Fine-tuning for Performance
Optimize ntopng’s performance with these advanced settings:
--packet-sampling=X # Sample 1 packet every X (reduces CPU load)
--max-num-flows=500000 # Limit maximum flows tracked
--max-num-hosts=100000 # Limit maximum hosts tracked
--disable-dns-resolution # Disable reverse DNS (improves performance)
Traffic Policies and Shaping
Implement traffic policies for better analysis:
--traffic-shaping-policy=/etc/ntopng/traffic_shaping.conf
Create the policy file with definitions for traffic categories, priorities, and quotas.
Alert Configuration
Set up advanced alerts based on custom thresholds:
--alert-time-freq=300 # Alert check frequency in seconds
For granular alert configuration, use the web interface under “Settings > Alerts” to define:
- Bandwidth threshold alerts
- Connection count alerts
- Geographic access alerts
- Protocol anomaly detection
- Custom script-based alerts
User Management
Create additional users with restricted access through the web interface under “Settings > Users”. Access levels include:
- Administrator: Full system access
- Standard User: View-only for assigned interfaces
- Unprivileged User: Limited dashboard access
Secure Web Interface
Enable HTTPS with proper certificates:
--https-port=3001
--cert-file=/etc/ntopng/cert.pem
--key-file=/etc/ntopng/key.pem
Generate self-signed certificates if needed:
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ntopng/key.pem -out /etc/ntopng/cert.pem
Data Retention Configuration
Customize how long ntopng retains historical data:
--data-retention-days=30 # Days to keep historical data
--disable-timeseries # Disable timeseries (save disk space)
Integration with Other Tools
Ntopng’s capabilities can be extended through integration with complementary tools, creating a comprehensive network monitoring ecosystem on your openSUSE system.
nProbe Integration
Combine ntopng with nProbe for enhanced flow collection and analysis:
Install nProbe on openSUSE:
sudo zypper install nprobe
Configure nProbe to collect and export flows:
sudo nprobe --interface eth0 --collector-port 5556 --zmq tcp://127.0.0.1:5556
Configure ntopng to receive nProbe data:
-i=tcp://127.0.0.1:5556
This combination allows ntopng to analyze flow data from remote network segments without direct access to the traffic.
Grafana Visualization
Export ntopng metrics to Grafana for custom dashboards:
Install Grafana on openSUSE:
sudo zypper install grafana
Enable ntopng time series database:
--enable-influxdb
--influxdb-url=http://localhost:8086
--influxdb-dbname=ntopng
Create a Grafana dashboard using the InfluxDB data source to visualize long-term trends.
Syslog Integration
Send ntopng alerts to your syslog server:
--syslog=1
--syslog-facility=local5
--syslog-level=5
External Authentication
Integrate with LDAP or Active Directory for centralized authentication:
--auth-type=ldap
--ldap-server=ldap://ldap.example.com
--ldap-base-dn=dc=example,dc=com
--ldap-bind-dn=cn=admin,dc=example,dc=com
--ldap-bind-password=password
--ldap-search-filter=(&(objectClass=person)(uid=%u))
API Integration
Leverage ntopng’s REST API for custom automations:
--enable-rest-api
Access API documentation at http://your_server:3000/lua/rest/v1/get/
Common Issues and Troubleshooting
Even with careful installation and configuration, you may encounter issues with ntopng on openSUSE. Here are solutions to common problems:
Dependency Resolution Problems
Issue: Missing or incompatible dependencies after installation.
Solution:
sudo zypper install --force libpcap libmaxminddb redis hiredis libzmq
sudo ldconfig
Network Interface Detection Issues
Issue: Ntopng fails to detect or capture traffic on interfaces.
Solution:
- Verify interface exists:
ip addr show
- Check permissions:
sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/ntopng
- Try specifying the interface explicitly:
-i=eth0
- For virtual environments, ensure promiscuous mode is enabled
Web Interface Access Problems
Issue: Cannot access the web interface after installation.
Solution:
- Verify ntopng is running:
sudo systemctl status ntopng
- Check firewall settings:
sudo firewall-cmd --permanent --add-port=3000/tcp
- Verify configured HTTP port:
grep http-port /etc/ntopng/ntopng.conf
- Check for port conflicts:
sudo netstat -tulpn | grep 3000
Database Errors
Issue: Redis connection errors in logs.
Solution:
sudo systemctl stop ntopng
sudo systemctl stop redis
sudo rm -rf /var/lib/redis/dump.rdb
sudo systemctl start redis
sudo systemctl start ntopng
Log File Analysis
When troubleshooting, check ntopng’s logs:
# For systemd installations
sudo journalctl -u ntopng -n 100
# For source installations
sudo tail -f /var/log/ntopng.log
Common log errors and solutions:
- “Unable to open interface”: Check interface name and permissions
- “Cannot connect to redis”: Verify Redis is running
- “Error while loading GeoIP database”: Install libmaxminddb
Performance Optimization
Optimizing ntopng’s performance ensures efficient monitoring without overwhelming your openSUSE system resources. These strategies balance monitoring detail with resource consumption.
Hardware Considerations
For optimal ntopng performance on openSUSE:
- CPU: Multi-core processors (4+ cores recommended for busy networks)
- Memory: Minimum 4GB RAM, 8GB+ for networks with many hosts
- Storage: SSD storage for the Redis database improves responsiveness
- Network: Dedicated monitoring interface for high-throughput networks
Memory Management
Control ntopng’s memory usage:
--max-num-hosts=50000 # Limit tracked hosts
--max-num-flows=100000 # Limit tracked flows
Disk Space Management
Manage storage requirements:
--data-dir=/path/to/storage
--data-retention-days=7 # Adjust retention period
--disable-timeseries
--disable-top-talkers
Sampling Configuration
For high-throughput networks, implement packet sampling:
--packet-sampling=10 # Sample 1 packet in 10
Redis Optimization
Tune Redis for better performance by editing /etc/redis/redis.conf
:
maxmemory 2gb
maxmemory-policy volatile-lru
appendonly yes
appendfsync everysec
Congratulations! You have successfully installed Ntopng. Thanks for using this tutorial for installing the Ntopng network monitoring tool on openSUSE Linux system. For additional help or useful information, we recommend you check the official Ntopng website.