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 shows live agent activity, including:
Use the filter options to narrow down specific events:
DEBUG, INFO, WARNING, ERROR)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.confConfirm:
enabled=true is presenttoken= holds a valid UUIDserver_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\|extra_ca_file" /var/log/ndagent.logFrom agent 1.21.0, the agent checks NetDefense’s certificate against root certificates built into the agent, not the firewall’s certificate store, so updating the firewall’s CA bundle doesn’t change what it trusts.
Solutions:
Behind a TLS-inspection proxy: an error naming extra_ca_file means the certificate the agent was shown isn’t signed by a root it trusts. Its presented_issuer field names the issuer of the topmost certificate in the chain the agent was shown, which behind an inspection proxy is the proxy’s CA. Add that CA in Extra CA File.
Check system time: SSL verification requires accurate system time
datentpdate -q pool.ntp.orgOn an agent older than 1.21.0, update CA certificates:
pkg updatepkg upgrade ca_root_nssTemporary 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/prod/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/prod/opnsense/meta.confRecreate repository configuration if corrupted:
cat > /usr/local/etc/pkg/repos/netdefense.conf <<'EOF'netdefense: { url: "https://repo.netdefense.io/prod/opnsense", signature_type: "fingerprints", fingerprints: "/usr/local/etc/pkg/fingerprints/netdefense", enabled: yes, priority: 10}EOFpkg update -fSymptoms: A device in a firmware track isn’t updating, a step shows a hold reason such as held_check_failed, or the Flavour setting under System > Firmware > Settings keeps coming back after you reset it.
Solutions:
See what NetDefense recorded for the device:
ndcli firmware status --name <device>ndcli firmware history <device>Read the agent’s log under Services > NetDefense > Log File. Lines about the firmware pin start with Firmware flavour written, The firmware pin needs to be written again, or The pinned release folder is not on the device's mirror.
Look the reason up in Troubleshooting. A held step changed nothing, and the track’s next window tries again.
To take the device out of its track, move it to Unmanaged in NetDefense. Resetting the Flavour on the firewall doesn’t release it: the agent puts the pin back. See Firmware tracks on the firewall.
#!/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 can’t resolve an issue on your own:
Gather diagnostic information
Open a support ticket
ndcli support create (see Support)Ask in the Community