Removed
- NetDefense Agent binary (
/usr/local/bin/ndagent) - Service configuration
- Web interface plugin files
- Log configuration templates
- Action configuration files
This guide explains how to completely remove the NetDefense plugin and its repository configuration from your OPNsense firewall.
Navigate to System > Firmware > Plugins
Find os-netdefense in the list of installed plugins
Click the trash icon next to the plugin to uninstall
Confirm the removal when prompted
Connect to your OPNsense device
ssh root@your-opnsense-ipStop the NetDefense service
service ndagent stopRemove the package
pkg remove os-netdefenseConfirm the removal when prompted (type y)
If you no longer want to receive NetDefense updates or want to completely remove all traces of the repository:
Remove the repository configuration file
rm /usr/local/etc/pkg/repos/netdefense.confRemove the fingerprints directory
rm -rf /usr/local/etc/pkg/fingerprints/netdefenseUpdate the package database
pkg update -fFor a complete removal of the plugin and repository configuration, run this script:
#!/bin/sh
echo "Stopping NetDefense Agent..."service ndagent stop 2>/dev/null
echo "Removing NetDefense package..."pkg remove -y os-netdefense
echo "Removing repository configuration..."rm -f /usr/local/etc/pkg/repos/netdefense.conf
echo "Removing fingerprints..."rm -rf /usr/local/etc/pkg/fingerprints/netdefense
echo "Updating package database..."pkg update -f
echo "NetDefense removal complete."After removal, verify all components are gone:
pkg info os-netdefense
service ndagent status
ls /usr/local/etc/pkg/repos/netdefense.conf
ls /usr/local/etc/pkg/fingerprints/netdefenseRemoved
/usr/local/bin/ndagent)Preserved
/var/log/)config.xml)The removal process does not delete the NetDefense configuration stored in OPNsense’s config.xml. This allows for easy reinstallation with existing settings. To completely remove the configuration data:
Navigate to System > Configuration > Backups
Click Download to create a backup of your current configuration
Edit the downloaded XML file and remove the <netdefense> section under <OPNsense>
Navigate to System > Configuration > Backups
Upload the modified configuration file
cp /conf/config.xml /conf/config.xml.backup
configctl template reload OPNsense/NetDefenseIf you want to remove NetDefense-related logs:
rm -f /var/log/ndagent.logIf you need to reinstall NetDefense later:
config.xmlRemoving the plugin from your device does not remove the device from your NetDefense account. To fully remove the device, use NDCLI:
# List devices to find the exact namendcli device list
# Remove the device from your organizationndcli device remove <device-name>This frees up the device slot in your NetDefense account.
If a login order on the device was ever edited by hand to include a server NetDefense manages, take the managed server out of that hand-edited order before removing the device. Decommission never rewrites an order it didn’t write itself (it only logs the fact — see below), so a stale name left behind will silently reactivate if a server with that exact name is ever created again later, on this device or another one that shares the same login-order policy.
If the device you removed had an external authentication server configured — LDAP or Active Directory — two follow-ups aren’t automatic:
Rotate the directory-side bind password, unconditionally. The device’s decommission process deletes the authentication server snippet’s entry on the firewall, but it has no way to invalidate the credential on the directory server itself — a copy of the old device’s config (a downloaded backup, for instance) can still use it to authenticate against your directory. Rotate the password even if you believe nothing else used that bind account:
ndcli variable org set ldap_bind_password --value-stdin < ./new-bindpw.txtChange the password on the directory side first, then update the variable, then sync any remaining devices that authenticate against the same directory account so they pick up the new value. If a server on another device still binds with the same account through a device- or OU-level override of the same variable, update that override the same way.
Check /var/log/ndagent-decommission.log on the firewall for a leftover authentication-related entry — decommission preserves system logs, so it’s still there after the plugin uninstalls itself. Look for:
auth family failing after its retries — servers and the bind password may remain on the device;ORDER_REFERENCES_DELETED_SERVER — a login order that still names a server decommission just deleted, because that order wasn’t NetDefense’s to rewrite;ORDER_CHANGED_SINCE_WRITTEN — the login order was edited by hand since NetDefense last wrote it, so decommission left it alone rather than resetting it to the OPNsense default.Update or remove any leftover order entry yourself if the device is being repurposed rather than scrapped.
See Authentication Servers for why the password rotation matters even after the device itself is gone.