Network Connectivity
Verify the device can reach the NetDefense server:
fetch -o /dev/null https://hub.netdefense.ioThis guide helps you diagnose and resolve common issues with the NetDefense plugin.
The first step in troubleshooting is always to check the logs. NetDefense provides an integrated log viewer in the OPNsense web interface.
Navigate to Services > NetDefense > Log File
The log viewer displays real-time agent activity including:
Use the filter options to narrow down specific events:
tail -f /var/log/ndagent.log
tail -100 /var/log/ndagent.log
grep -i error /var/log/ndagent.log
grep ndagent /var/log/messagesSymptoms: The NetDefense agent fails to start after enabling it.
service ndagent statusExpected output when running:
NetDefense Agent is running (pid: 12345)If stopped:
NetDefense Agent is not runningls -la /usr/local/etc/ndagent.conf
cat /usr/local/etc/ndagent.confEnsure:
enabled=true is presenttoken= has a valid UUID valueserver_address= points to a valid URLSolutions:
Missing or invalid token: Navigate to Services > NetDefense > Settings and verify the Registration Token is correctly entered
Configuration not applied: Click Apply on the settings page to regenerate the configuration
Manual start for diagnostics:
/usr/local/bin/ndagent --config /usr/local/etc/ndagent.confThis runs the agent in the foreground and displays any errors directly.
Symptoms: The device appears offline in your NetDefense dashboard even though the agent is running.
Possible causes and solutions:
Network Connectivity
Verify the device can reach the NetDefense server:
fetch -o /dev/null https://hub.netdefense.ioFirewall Rules
Ensure outbound HTTPS (port 443) is allowed to NetDefense servers.
DNS Resolution
Verify DNS is resolving:
host hub.netdefense.ioSSL Issues
Temporarily disable SSL verification in settings to test if certificates are the issue.
Symptoms: Logs show registration failures or “PENDING” status that doesn’t resolve.
Check the logs for specific errors:
grep -i "registration\|pending\|token" /var/log/ndagent.logCommon registration issues:
| Error | Cause | Solution |
|---|---|---|
| Invalid token | Token format incorrect | Re-copy token from NetDefense dashboard |
| Token not found | Token doesn’t exist or expired | Generate a new token in dashboard |
| Device limit reached | Account device quota exceeded | Remove unused devices or upgrade plan |
| Already registered | Device ID used by another device | Click Reset ID in settings to generate new ID |
Symptoms: The agent connects but frequently disconnects.
Diagnostic steps:
Check for network instability:
ping -c 100 hub.netdefense.ioReview logs for disconnect patterns:
grep -i "disconnect\|connection\|websocket" /var/log/ndagent.logCheck system resources:
top -b -n 1 | head -20Solutions:
Symptoms: Logs show SSL/TLS errors or certificate verification failures.
grep -i "ssl\|certificate\|tls" /var/log/ndagent.logSolutions:
Update CA certificates:
pkg updatepkg upgrade ca_root_nssCheck system time: SSL verification requires accurate system time
datentpdate -q pool.ntp.orgTemporary workaround: Disable SSL verification in settings (not recommended for production)
Symptoms: Package installation fails with signature verification errors.
pkg: signature verification failedSolutions:
Update the fingerprint file:
fetch -o /usr/local/etc/pkg/fingerprints/netdefense/trusted/netdefense \ https://repo.netdefense.io/opnsense/fingerprints/netdefense/trusted/netdefenseClear package cache:
pkg clean -apkg update -fRetry the installation:
pkg install os-netdefenseSymptoms: Package manager cannot find the NetDefense repository.
pkg: repository netdefense has no meta fileSolutions:
Verify repository configuration:
cat /usr/local/etc/pkg/repos/netdefense.confTest repository connectivity:
fetch https://repo.netdefense.io/opnsense/meta.confRecreate repository configuration if corrupted:
cat > /usr/local/etc/pkg/repos/netdefense.conf <<'EOF'netdefense: { url: "https://repo.netdefense.io/opnsense", signature_type: "fingerprints", fingerprints: "/usr/local/etc/pkg/fingerprints/netdefense", enabled: yes, priority: 10}EOFpkg update -f#!/bin/shecho "=== NetDefense Health Check ==="
echo "\n--- Package Status ---"pkg info os-netdefense 2>/dev/null || echo "Package not installed"
echo "\n--- Service Status ---"service ndagent status
echo "\n--- Configuration ---"if [ -f /usr/local/etc/ndagent.conf ]; then echo "Config file exists" grep "enabled=" /usr/local/etc/ndagent.confelse echo "Config file NOT found"fi
echo "\n--- Network Connectivity ---"fetch -q -o /dev/null https://hub.netdefense.io && echo "Server reachable" || echo "Server NOT reachable"
echo "\n--- Recent Errors ---"grep -i error /var/log/ndagent.log 2>/dev/null | tail -5 || echo "No errors or log file not found"ps aux | grep ndagent
top -p $(pgrep ndagent) -n 1/usr/local/bin/ndagent --config /usr/local/etc/ndagent.conf --validate| Level | When to Use | Information Captured |
|---|---|---|
| DEBUG | Troubleshooting only | All details including raw data |
| INFO | Normal operation | Start/stop, connections, tasks |
| WARNING | Reduced logging | Potential issues only |
| ERROR | Minimal logging | Errors only |
If you’re unable to resolve an issue:
📋 Gather diagnostic information
📧 Contact support
🐛 Check known issues